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
@@ -13,6 +13,9 @@
|
||||
$tag = \App\Domain\Cms\Widgets\Support\PremiumFields::headingTag($settings, ! empty($first));
|
||||
$hasCopy = $hasCopy ?? true;
|
||||
$imageShare = $imageShare ?? null;
|
||||
// Zoom (ADR-70): Bild und Video liegen dann in einem Rahmen, der den vergrößerten Ausschnitt abschneidet.
|
||||
$zoomPercent = (int) ($zoom ?? 100);
|
||||
$zoomed = $zoomPercent > 100;
|
||||
$clipUrl = $imageUrl ? ($video['url'] ?? null) : null;
|
||||
$clipTitle = (string) ($video['title'] ?? '');
|
||||
@endphp
|
||||
@@ -27,7 +30,7 @@
|
||||
'lf-bt--without-text' => ! $hasCopy,
|
||||
'lf-bt--shared' => $imageShare !== null && $imageUrl && $hasCopy,
|
||||
'lf-bt--share-'.$imageShare => $imageShare !== null && $imageUrl && $hasCopy,
|
||||
]) style="--bt-focus-x: {{ $focus['x'] }}%; --bt-focus-y: {{ $focus['y'] }}%">
|
||||
]) style="--bt-focus-x: {{ $focus['x'] }}%; --bt-focus-y: {{ $focus['y'] }}%@if ($zoomed); --bt-zoom: {{ $zoomPercent / 100 }}@endif">
|
||||
@if ($hasCopy)
|
||||
<div class="lf-bt__copy">
|
||||
@php($lead = \App\Domain\Cms\Widgets\Support\HeadingAccent::lead($settings))
|
||||
@@ -56,8 +59,10 @@
|
||||
@endif
|
||||
@if ($imageUrl)
|
||||
<div class="lf-bt__media" @if ($clipUrl !== null) data-card-clip data-clip-src="{{ $clipUrl }}" data-clip-title="{{ $clipTitle }}" @endif>
|
||||
<img class="lf-bt__image" src="{{ $imageUrl }}" @if (! empty($imageSrcset)) srcset="{{ $imageSrcset }}" sizes="100vw" @endif alt="{{ $imageAlt ?? '' }}" @if (! empty($first)) loading="eager" fetchpriority="high" @else loading="lazy" @endif decoding="async">
|
||||
@if ($zoomed)<div class="lf-bt__frame">@endif
|
||||
<img class="lf-bt__image" src="{{ $imageUrl }}" @if (! empty($imageSrcset)) srcset="{{ $imageSrcset }}" sizes="{{ \App\Domain\Cms\Widgets\Support\ImageFraming::sizes('100vw', $zoomPercent) }}" @endif alt="{{ $imageAlt ?? '' }}" @if (! empty($first)) loading="eager" fetchpriority="high" @else loading="lazy" @endif decoding="async">
|
||||
@include('widgets.partials.card-clip', ['clipFullscreen' => $clipUrl !== null && ! empty($videoFullscreen)])
|
||||
@if ($zoomed)</div>@endif
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user