Biete Bildausschnitt und Zoom für Bilder und Videos in Widgets an (ADR-70)
Redaktionelle Karten erhalten je Karte Fokus und Zoom, Einstieg, Bild und Text sowie Premium-Karten zusätzlich einen Zoom (100 bis 250 Prozent, darunter entstünden leere Ränder). Die Darstellung ist reines CSS um den Fokuspunkt; Video und Clip folgen dem Ausschnitt. Die Regler zeigen beim Laden die Vorgabe statt 0 (FramingSlider). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7f9534d289
commit
9353e2e38a
29 files changed
+641
-40
No files matched your search
@@ -15,16 +15,23 @@
|
||||
$loading = ! empty($first) ? 'loading="eager" fetchpriority="high"' : 'loading="lazy"';
|
||||
$videoUrl = $layout === 'photo-split' ? ($video['url'] ?? null) : null;
|
||||
$videoTitle = $video['title'] ?? '';
|
||||
// Zoom (ADR-70): Foto und Video liegen dann in einem Rahmen, der den vergrößerten Ausschnitt abschneidet.
|
||||
$zoomPercent = (int) ($zoom ?? 100);
|
||||
$zoomed = $zoomPercent > 100 && $layout === 'photo-split' && ($imageUrl || $videoUrl !== null);
|
||||
@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 ($zoomed); --lf-hero-zoom: {{ $zoomPercent / 100 }}@endif"
|
||||
@if ($videoUrl !== null) data-hero-video data-clip-src="{{ $videoUrl }}" data-clip-title="{{ $videoTitle }}" @endif>
|
||||
@if ($zoomed)<div class="lf-hero__frame">@endif
|
||||
@if ($layout === 'photo-split' && $imageUrl)
|
||||
<img class="lf-hero__photo" src="{{ $imageUrl }}" @if (! empty($imageSrcset)) srcset="{{ $imageSrcset }}" sizes="100vw"@endif alt="{{ $imageAlt ?? '' }}" {!! $loading !!} decoding="async">
|
||||
<img class="lf-hero__photo" src="{{ $imageUrl }}" @if (! empty($imageSrcset)) srcset="{{ $imageSrcset }}" sizes="{{ \App\Domain\Cms\Widgets\Support\ImageFraming::sizes('100vw', $zoomPercent) }}"@endif 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>
|
||||
@endif
|
||||
@if ($zoomed)</div>@endif
|
||||
@if ($videoUrl !== null)
|
||||
<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 class="lf-hero__video-label" aria-hidden="true">Video</span>
|
||||
|
||||
Reference in new issue
Block a user