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:
LarsandClaude Sonnet 5.5 committed 2026-12-01 12:15:38 +01:00
1 parent 7f9534d289
commit 9353e2e38a
29 files changed
+641 -40

No files matched your search

@@ -24,6 +24,9 @@
@elseif ($subject->public || $context->preview)
@php
$libraryImage = $imageUrl === null && $context->preview ? $subject->previewImage : null;
// Zoom (ADR-70) wirkt nur auf den Ausschnitt; „Ganzes Bild“ zeigt das Bild vollständig und wird nicht vergrößert.
$zoomPercent = ($fit ?? 'cover') === 'contain' ? 100 : (int) ($zoom ?? 100);
$zoomed = $zoomPercent > 100;
$panel = $imageUrl === null && $libraryImage === null ? $subject->visual : null;
$action = $show['action'] && $subject->url !== null ? ['url' => $subject->url, 'label' => $actionLabel] : null;
$meta = $show['meta'] ? $subject->meta : [];
@@ -49,10 +52,11 @@
'lf-pc--bare' => ! empty($bare),
'lf-pc--without-visual' => $imageUrl === null && $libraryImage === null && $panel === null,
'lf-pc--internal' => ! $subject->public,
]) style="--pc-focus-x: {{ $focus['x'] }}%; --pc-focus-y: {{ $focus['y'] }}%">
'lf-pc--zoom' => $zoomed,
]) style="--pc-focus-x: {{ $focus['x'] }}%; --pc-focus-y: {{ $focus['y'] }}%@if ($zoomed); --pc-zoom: {{ $zoomPercent / 100 }}@endif">
@if ($imageUrl !== null || $libraryImage !== null)
<div class="lf-pc__visual" @if ($clipUrl !== null) data-card-clip data-clip-src="{{ $clipUrl }}" data-clip-title="{{ $clipTitle }}" @endif>
<img class="lf-pc__image" src="{{ $imageUrl ?? $libraryImage }}" @if ($imageUrl !== null && ! empty($imageSrcset)) srcset="{{ $imageSrcset }}" sizes="(min-width: 900px) 50vw, 100vw" @endif alt="{{ $imageUrl !== null ? $alt : '' }}" loading="lazy" decoding="async">
<img class="lf-pc__image" src="{{ $imageUrl ?? $libraryImage }}" @if ($imageUrl !== null && ! empty($imageSrcset)) srcset="{{ $imageSrcset }}" sizes="{{ \App\Domain\Cms\Widgets\Support\ImageFraming::sizes('(min-width: 900px) 50vw, 100vw', $zoomPercent) }}" @endif alt="{{ $imageUrl !== null ? $alt : '' }}" loading="lazy" decoding="async">
@include('widgets.partials.card-clip')
@if ($show['kind'] && $subject->badge !== null && empty($bare))
<span class="lf-pc__badge">{{ $subject->badge }}</span>