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>
This commit is contained in:
1 parent
437bb394b2
commit
73126fec0c
11 files changed
+731
-5
No files matched your search
@@ -3,19 +3,33 @@
|
||||
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'] }}%">
|
||||
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')
|
||||
@@ -44,3 +58,6 @@
|
||||
</div>
|
||||
</div>
|
||||
@include('widgets.partials.image-notice')
|
||||
@if ($context->preview && ! empty($video['notice']))
|
||||
<p class="preview-note">{{ $video['notice'] }}</p>
|
||||
@endif
|
||||
Reference in new issue
Block a user