import {AbiirEyebrow} from '~/components/AbiirEyebrow'; import type {AbiirHomeHeroCms} from '~/lib/homeHero'; import {ABIIR_WIDE_INNER_FRAME_CLASS} from '~/lib/springGlowBanner'; import heroOption04Src from '~/assets/Hero_option04.jpg'; /** Figma hero band height + marquee. */ const FIGMA_HERO_H = 978; const FIGMA_MARQUEE_H = 68; function toHeroImageData( input: | { id?: string | null; url: string; altText?: string | null; width?: number | null; height?: number | null; } | null | undefined, ) { if (!input?.url) return null; return { id: input.id ?? undefined, url: input.url, altText: input.altText ?? '', width: input.width ?? undefined, height: input.height ?? undefined, }; } const HERO_IMAGE_STATIC = toHeroImageData({ id: 'hero-option-04', url: heroOption04Src, altText: 'ABiiR skincare — hero', width: 855, height: FIGMA_HERO_H, }); function pickHeroImageData(cms: AbiirHomeHeroCms) { if (cms.image?.url) { return toHeroImageData({ id: cms.image.id, url: cms.image.url, altText: cms.image.alt, width: cms.image.width, height: cms.image.height, }); } return HERO_IMAGE_STATIC; } function isExternalHref(href: string) { return /^https?:\/\//i.test(href); } function HeroCtaLink({ href, className, style, children, }: { href: string; className?: string; style?: React.CSSProperties; children: React.ReactNode; }) { return ( {children} ); } /** Figma icon564:2080 — 15×15 */ function HeroCtaArrowIcon({className}: {className?: string}) { return ( ); } export type AbiirHomeHeroProps = { cms: AbiirHomeHeroCms; }; /** * Hero: Figma `633:2179` — 1710×978 frame, image `absolute inset-0 object-cover`, copy * `left: 206px`, `width: 637px`, vertically centered on `lg` (unpadded 1710 rail). * Viewport gutters extend `gradientStart` / `gradientEnd` past the frame. */ export function AbiirHomeHero({cms}: AbiirHomeHeroProps) { const heroBurgundy = cms.accentBurgundy; const imageData = pickHeroImageData(cms); const edgeLeft = cms.gradientStart; const edgeRight = cms.gradientEnd; /** Space outside the centered 1710px shell (matches Spring Glow full-bleed gutters). */ const viewportGutterWidth = 'max(0px, calc((100vw - min(100vw, 1710px)) / 2))'; return ( {/* Viewport → shell: edge colors (desktop only; mobile uses column gradient below) */} {/* Full-bleed within 1710px frame (Figma has no side padding on this artboard) */} {imageData ? ( ) : null} {/* Readability: scrim over the left half of the shell */} {/* Copy — lg+: left 206px, w 637px; vertically centered in 978px frame */} {cms.eyebrow} {cms.headlineLine1Prefix} {cms.headlineLine1Italic} {cms.headlineLine2Prefix} {cms.headlineLine2Accent} {cms.body} {cms.primaryCtaLabel} {cms.secondaryCtaLabel} {/* Marquee — full width */} {[0, 1].map((i) => ( {cms.marqueeText} ))} ); } export type {AbiirHomeHeroCms} from '~/lib/homeHero';
{cms.body}
{cms.marqueeText}