/**
 * Splash 背景图片
 *
 * 
 *   `SizedBox.expand(child: Assets.images.picBgHome.image(fit: BoxFit.cover))`
 * sizes 属性说明：
 *   图片在 MobileShell 内（max-width: 540px）。
 *   - 视口 ≤ 540px：MobileShell = 100vw，图片 = 100vw
 *   - 视口 > 540px：MobileShell = 540px，图片 = 540px
 */
import Image from "next/image";

export function SplashBackground({
  src,
  objectPosition,
}: {
  src: string;
  objectPosition?: string;
}) {
  return (
    <div className="absolute inset-0 z-0 overflow-hidden bg-splash-background">
      <Image
        src={src}
        alt=""
        fill
        priority
        sizes="(max-width: 540px) 100vw, 540px"
        className="object-cover object-center"
        style={{ objectPosition }}
      />
    </div>
  );
}
