Files
laraundfelix/resources/views/widgets/hero.blade.php
T
LarsandClaude Sonnet 5.5 73126fec0c
CI Feature / test (push) Successful in 2m17s
Deploy Test / test (push) Successful in 2m4s
Deploy Test / deploy (push) Successful in 33s
Spiele im Einstieg ein freigegebenes Video stumm auf der Fläche des Fotos ab
Neue optionale Auswahl refs.video am Hero (Variante Foto mit Textfläche). Gespielt wird der
für die Website freigegebene Clip nach der Regel der Karte (Trailer, Vorschauclip, Website-Datei
des Films); nie der vollständige Film. Start nach dem Laden, Schaltfläche zum Anhalten, Foto als
Rückfall, kein Selbststart bei reduzierter Bewegung, Datensparmodus und 2G. Keine Migration.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 07:24:03 +01:00

64 lines
3.9 KiB
PHP

{{--
Premium-Einstieg (Brand-UI-Kit v1.6, Komponente lf-hero), angepasst an die Widget-Hülle der Registry.
Varianten: photo_split (Foto mit heller Textfläche), editorial_solid (Navy-Markenfläche ohne Foto).
Höhen compact/normal/large sind Mindesthöhen ab 860 px Containerbreite; darunter Sicherheitsumbruch.
Das Bild des ersten Widgets der Seite wird sofort geladen, alle anderen verzögert.
Video (nur photo_split): stummer, freigegebener Clip auf der Fläche des Fotos (HeroVideo). Das <video> bekommt seine
Quelle erst nach dem Laden der Seite (resources/js/hero-video.js, preload="none"); das Foto bleibt Rückfall.
Der Clip ist Beiwerk; Überschrift und Text stehen daneben, das Video ist für Hilfstechnik verborgen und die
Schaltfläche trägt die Bedeutung.
--}}
@php
$layout = $variant === 'editorial_solid' ? 'editorial-solid' : 'photo-split';
$heightClass = in_array($height, ['compact', 'normal', 'large'], true) ? $height : 'normal';
$tag = \App\Domain\Cms\Widgets\Support\PremiumFields::headingTag($settings, ! empty($first));
$loading = ! empty($first) ? 'loading="eager" fetchpriority="high"' : 'loading="lazy"';
$videoUrl = $layout === 'photo-split' ? ($video['url'] ?? null) : null;
$videoTitle = $video['title'] ?? '';
@endphp
<div class="lf-hero-host">
<div class="lf-hero lf-hero--{{ $layout }} lf-hero--height-{{ $heightClass }} lf-hero--accent-{{ $accent }}"
style="--lf-hero-focus-x: {{ $focus['x'] }}%; --lf-hero-focus-y: {{ $focus['y'] }}%"
@if ($videoUrl !== null) data-hero-video data-clip-src="{{ $videoUrl }}" data-clip-title="{{ $videoTitle }}" @endif>
@if ($layout === 'photo-split' && $imageUrl)
<img class="lf-hero__photo" src="{{ $imageUrl }}" alt="{{ $imageAlt ?? '' }}" {!! $loading !!} decoding="async">
@endif
@if ($videoUrl !== null)
<video class="lf-hero__video" muted loop playsinline preload="none" disablepictureinpicture disableremoteplayback tabindex="-1" aria-hidden="true"></video>
<button type="button" class="lf-hero__video-toggle" aria-pressed="false" data-hero-toggle aria-label="Video abspielen: {{ $videoTitle }}" hidden>
<svg class="lf-hero__video-icon" viewBox="0 0 24 24" focusable="false" aria-hidden="true"><path class="lf-hero__video-play" d="M8 5.5v13l11-6.5z" fill="currentColor"/><path class="lf-hero__video-pause" d="M7 5h4v14H7zM13 5h4v14h-4z" fill="currentColor"/></svg>
<span aria-hidden="true">Video</span>
</button>
@endif
<div class="lf-hero__inner">
<div class="lf-hero__copy">
@if ($accent === 'rays')
<x-brand.rays class="lf-hero__rays" />
@endif
@if (filled($data['eyebrow'] ?? null))
<p class="lf-hero__eyebrow">{{ $data['eyebrow'] }}</p>
@endif
<{{ $tag }} class="lf-hero__title">{{ $data['heading'] ?? '' }}</{{ $tag }}>
@if ($accent !== 'none')
<span class="lf-hero__title-accent" aria-hidden="true"></span>
@endif
@if (filled($data['text'] ?? null))
<p class="lf-hero__description">{{ $data['text'] }}</p>
@endif
@if ($actions !== [])
<div class="lf-hero__actions">
@foreach ($actions as $index => $item)
<a @class(['lf-hero__button', 'lf-hero__button--primary' => $index === 0, 'lf-hero__button--secondary' => $index > 0]) href="{{ $item['url'] }}">{{ $item['label'] }}</a>
@endforeach
</div>
@endif
</div>
</div>
<span class="lf-hero__bottom" aria-hidden="true"></span>
</div>
</div>
@include('widgets.partials.image-notice')
@if ($context->preview && ! empty($video['notice']))
<p class="preview-note">{{ $video['notice'] }}</p>
@endif