Files
amare/resources/views/components/public/photo-hero.blade.php

82 lines
4.0 KiB
PHP

@props([
'imagePath' => null,
'imageAlt' => null,
'eyebrow' => null,
'title',
'summary' => null,
'metadata' => null,
'headingId' => 'hero-heading',
'brandMark' => false,
'fullHeightFallback' => false,
])
<section aria-labelledby="{{ $headingId }}" {{ $attributes->class(['border-b border-amare-border bg-amare-bg']) }} data-motion="page-open">
@if (filled($imagePath))
<div class="grid min-h-[calc(100dvh-5rem)] lg:h-[calc(100dvh-5rem)] lg:min-h-0 lg:grid-cols-12" data-photo-hero>
<div class="flex min-w-0 items-center bg-amare-bg px-6 py-16 lg:col-span-5 lg:px-[clamp(3rem,6vw,7rem)]" data-hero-content data-reveal-group>
<div class="w-full max-w-[470px] space-y-7">
@if ($brandMark || filled($eyebrow))
<div class="flex items-center gap-4" data-motion-beat="seal">
@if ($brandMark)
<x-brand.logo mark variant="on-light" class="h-8 w-auto" alt="" />
@endif
@if (filled($eyebrow))
<p class="text-sm font-medium uppercase tracking-[0.18em] text-amare-accent">{{ $eyebrow }}</p>
@endif
</div>
@endif
<h1 id="{{ $headingId }}" data-motion-beat="title" class="max-w-[470px] whitespace-normal break-normal text-hero-spread font-medium text-amare-text">{{ $title }}</h1>
@if (filled($summary))
<p class="max-w-[470px] text-lg text-amare-text-muted">{{ $summary }}</p>
@endif
@if (filled($metadata))
<p class="max-w-[470px] text-sm break-words text-amare-text-muted">{{ $metadata }}</p>
@endif
@if (trim((string) $slot) !== '')
<div data-motion-beat="cta">{{ $slot }}</div>
@endif
</div>
</div>
<div data-split-hero data-motion-beat="media" class="min-h-[56dvh] overflow-hidden bg-amare-bg-deep max-lg:aspect-[4/5] lg:col-span-7 lg:min-h-0" data-reveal-media>
<x-media.image
:path="$imagePath"
:alt="$imageAlt ?: $title"
loading="eager"
fetchpriority="high"
sizes="(max-width: 1023px) 100vw, 58vw"
class="img-editorial h-full w-full object-cover"
/>
</div>
</div>
@else
<div @class([
'container-amare py-16 md:py-24',
'min-h-[100dvh]' => $fullHeightFallback,
]) data-tonal-hero>
<div class="max-w-[470px] space-y-4" data-motion-beat="heading">
@if ($brandMark || filled($eyebrow))
<div class="flex items-center gap-4" data-motion-beat="seal">
@if ($brandMark)
<x-brand.logo mark variant="on-light" class="h-8 w-auto" alt="" />
@endif
@if (filled($eyebrow))
<p class="text-sm font-medium uppercase tracking-[0.18em] text-amare-accent">{{ $eyebrow }}</p>
@endif
</div>
@endif
<h1 id="{{ $headingId }}" data-motion-beat="title" class="max-w-[470px] whitespace-normal break-normal text-headline font-medium tracking-tight text-amare-text">{{ $title }}</h1>
@if (filled($summary))
<p class="max-w-[470px] text-lg text-amare-muted">{{ $summary }}</p>
@endif
@if (filled($metadata))
<p class="max-w-[470px] text-sm break-words text-amare-muted">{{ $metadata }}</p>
@endif
@if (trim((string) $slot) !== '')
<div data-motion-beat="cta">{{ $slot }}</div>
@endif
</div>
</div>
@endif
</section>