@props([ 'image' => null, 'video' => null, 'poster' => null, 'title' => '', 'eyebrow' => null, 'subtitle' => '', 'textColor' => 'text-white', 'bgColor' => '#000', 'overlayColor' => '#2563eb60', 'class' => 'animated-hero-loader', 'animated' => false, 'titleWidth' => 'lg:max-w-4xl', ]) @php $textClass = $textColor === 'text-black' ? 'text-black' : 'text-white'; // The still image is the LCP element: the poster for video heroes, the image otherwise. // Responsive WebP variants come from scripts/optimize-images.py. // `image` is a file name in images/heros/, or a full public path when it contains a "/". $heroImage = $video ? $poster : ($image ? (str_contains($image, '/') ? $image : 'images/heros/' . $image) : null); $media = $heroImage ? responsive_image($heroImage) : null; @endphp @if($media) @push('styles') @endpush @endif
{{-- Image / Video container (gets its own border-radius animation) --}}
@if($media) {{ $video ? '' : strip_tags($title) }} @endif @if($video) {{-- Attached by JS after page load on large screens only (initHeroVideo): phones and Save-Data users keep the lightweight poster --}} @endif
{{-- Flat blue overlay (inside image container so it follows border-radius) --}}
{{-- Text overlay. With a `footer` slot, the text is centred in the space left above the footer, which sits at the bottom in flow so the two can never overlap. --}}
@isset($footer)
@endisset

{{-- Eyebrow (e.g. product name) is part of the H1 so the heading names the page topic --}} @if($eyebrow) {{ $eyebrow }} @endif {!! $title !!}

@if($subtitle)

{!! $subtitle !!}

@endif {{ $slot }} @isset($footer)
{{ $footer }}
@endisset
{{-- Opt-in hero animation (homepage only): only animate if user is at the top of the page. Uses requestAnimationFrame to wait for browser scroll restoration. --}} @if($animated) @endif