Biete in Bild und Text einen Bildanteil, Bild ohne Text und ein Video auf dem Bild an
Neue Einstellung "Bildanteil" (Bild zu Text von 1:2 bis 2:1, nur im zweispaltigen Stand ab 900 px; ohne Wert bleibt die bisherige Verteilung). Der Text ist nur noch Pflicht, solange kein Bild gewählt ist; ein Bild darf allein über die ganze Breite stehen. Optional ein Video (refs.video, ein Film aus dem Medienmanager, gewählt über den gemeinsamen Picker): Der für die Website freigegebene Clip spielt auf dem Bild beim Überfahren stumm und per Klick mit Ton wie auf der Medienkarte (CardClip, card-clip.js). Ohne Versionssprung; gespeicherte Seiten bleiben unverändert. Die Pflichtregel für den Text wird bewusst gelockert: "Bitte einen Text eingeben" gilt nur noch ohne Bild. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3cf3e822b8
commit
5233b96c42
15 files changed
+603
-19
No files matched your search
@@ -182,6 +182,28 @@ .lf-bt--height-compact .lf-bt__image { aspect-ratio: 16 / 9; }
|
||||
.lf-bt--height-spacious .lf-bt__image { aspect-ratio: 4 / 3; }
|
||||
.lf-bt--without-image { grid-template-columns: minmax(0, 1fr); }
|
||||
|
||||
/*
|
||||
* Bildanteil (Einstellung „Bildanteil“): Verhältnis der Bild- zur Textspalte, nur im zweispaltigen Stand (ab 900 px, siehe
|
||||
* unten). Ohne Einstellung bleibt die bisherige Verteilung. Die Klassen erscheinen nur mit Bild und Text.
|
||||
*/
|
||||
.lf-bt--share-third { --bt-img: 1fr; --bt-txt: 2fr; }
|
||||
.lf-bt--share-two_fifths { --bt-img: 2fr; --bt-txt: 3fr; }
|
||||
.lf-bt--share-half { --bt-img: 1fr; --bt-txt: 1fr; }
|
||||
.lf-bt--share-three_fifths { --bt-img: 3fr; --bt-txt: 2fr; }
|
||||
.lf-bt--share-two_thirds { --bt-img: 2fr; --bt-txt: 1fr; }
|
||||
|
||||
/* Ohne Text steht das Bild allein über die ganze Breite (Bildanteil entfällt). */
|
||||
.lf-bt--without-text { grid-template-columns: minmax(0, 1fr); }
|
||||
|
||||
/*
|
||||
* Video auf dem Bild (CardClip, resources/js/card-clip.js, Bausteine der Premium-Karte): Der Clip liegt über dem Bild, mit
|
||||
* demselben Ausschnitt und denselben Ecken, und blendet erst mit dem ersten Bild ein; bis dahin bleibt das Bild stehen.
|
||||
*/
|
||||
.lf-bt__media > .lf-pc__clip {
|
||||
object-position: var(--bt-focus-x) var(--bt-focus-y);
|
||||
border-radius: clamp(0.78rem, 1.8cqi, 1.3rem);
|
||||
}
|
||||
|
||||
/* Schmale Plätze: vollständiger Text und Links, keine erzwungene Höhe. */
|
||||
@container lf-bt (max-width: 539.99px) {
|
||||
.lf-bt__actions { display: grid; grid-template-columns: minmax(0, 1fr); }
|
||||
@@ -218,6 +240,20 @@ @container lf-bt (min-width: 900px) {
|
||||
.lf-bt--image-left .lf-bt__media { order: -1; }
|
||||
.lf-bt__image { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; max-block-size: none; aspect-ratio: auto; }
|
||||
.lf-bt--without-image { grid-template-columns: minmax(0, 1fr); }
|
||||
|
||||
/* Bildanteil: erste Spur ist die linke; bei „Bild links“ ist das die Bildspalte, sonst die Textspalte. */
|
||||
.lf-bt--shared.lf-bt--image-left { grid-template-columns: minmax(0, var(--bt-img)) minmax(0, var(--bt-txt)); }
|
||||
.lf-bt--shared.lf-bt--image-right { grid-template-columns: minmax(0, var(--bt-txt)) minmax(0, var(--bt-img)); }
|
||||
|
||||
/*
|
||||
* Bild ohne Text: Eine Spalte über die volle Breite. Das Bild bestimmt hier seine Höhe selbst (Seitenverhältnis nach
|
||||
* der Höhen-Einstellung), statt eine Fläche neben dem Text zu füllen.
|
||||
*/
|
||||
.lf-bt--without-text { grid-template-columns: minmax(0, 1fr); }
|
||||
.lf-bt--without-text .lf-bt__media { min-block-size: 0; }
|
||||
.lf-bt--without-text .lf-bt__image { position: static; inset: auto; block-size: auto; max-block-size: none; aspect-ratio: 21 / 9; }
|
||||
.lf-bt--without-text.lf-bt--height-compact .lf-bt__image { aspect-ratio: 3 / 1; }
|
||||
.lf-bt--without-text.lf-bt--height-spacious .lf-bt__image { aspect-ratio: 16 / 9; }
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{-- Gemeinsamer Picker für Website-Bilder im CMS (ChoosesWebsiteImages). --}}
|
||||
@if ($this->pickerOpen && $this->pickerPurpose === 'website-bild')
|
||||
{{-- Gemeinsamer Picker für Website-Bilder und Videos im CMS (ChoosesWebsiteImages). --}}
|
||||
@if ($this->pickerOpen && in_array($this->pickerPurpose, ['website-bild', 'website-video'], true))
|
||||
@include('filament.verwaltung.picker')
|
||||
@endif
|
||||
@@ -0,0 +1,26 @@
|
||||
{{-- Videofeld im CMS (Bild und Text): Auswahl eines Films über den gemeinsamen Picker (ChoosesWebsiteImages::openWebsiteVideoPicker). Gespeichert wird die Kennung des Films; abgespielt wird nur ein für die Website freigegebener Clip (HeroVideo, CardClip). --}}
|
||||
@php
|
||||
$wert = $getState();
|
||||
$pfad = $getStatePath();
|
||||
$mitPicker = method_exists($getLivewire(), 'openWebsiteVideoPicker');
|
||||
$titel = filled($wert) ? app(\App\Domain\Cms\Widgets\Support\HeroVideo::class)->labelFor($wert) : null;
|
||||
@endphp
|
||||
<x-dynamic-component :component="$getFieldWrapperView()" :field="$field">
|
||||
<div class="luf-bild-feld">
|
||||
@if (blank($wert))
|
||||
<span class="luf-bild-feld-leer">Kein Video gewählt.</span>
|
||||
@else
|
||||
<span class="luf-bild-feld-leer" data-video-status>{{ $titel ?? 'Dieses Medium gibt es nicht mehr.' }}</span>
|
||||
@endif
|
||||
@if ($mitPicker)
|
||||
<x-filament::button color="gray" size="sm" icon="heroicon-o-film" wire:click="openWebsiteVideoPicker({{ \Illuminate\Support\Js::from($pfad) }})">
|
||||
{{ blank($wert) ? 'Video auswählen' : 'Anderes Video wählen' }}
|
||||
</x-filament::button>
|
||||
@endif
|
||||
@if (filled($wert))
|
||||
<x-filament::button color="gray" size="sm" outlined wire:click="$set({{ \Illuminate\Support\Js::from($pfad) }}, null)">
|
||||
Video entfernen
|
||||
</x-filament::button>
|
||||
@endif
|
||||
</div>
|
||||
</x-dynamic-component>
|
||||
@@ -243,6 +243,8 @@
|
||||
{{ $zweck === 'praesentation' ? 'Diese Rolle hat nur ein Medium. ' : '' }}Erst „Austauschen“ ersetzt die Zuordnung an derselben Stelle. Abbrechen lässt sie unverändert.
|
||||
@elseif ($zweck === 'website-bild')
|
||||
Das gewählte Bild wird in diesen Platz des Seitenentwurfs übernommen. Öffentlich erscheint es nur mit Website-Freigabe; die Auswahl gibt es nicht frei.
|
||||
@elseif ($zweck === 'website-video')
|
||||
Der gewählte Film wird als Video in diesen Platz des Seitenentwurfs übernommen. Öffentlich spielt nur ein für die Website freigegebener Clip (Trailer, Vorschauclip oder Website-Datei); die Auswahl gibt nichts frei.
|
||||
@elseif ($zweck === 'vorschaubild')
|
||||
Das gewählte Bild wird als Vorschaubild übernommen. Es wird dadurch nicht für die Website freigegeben.
|
||||
@elseif ($zweck === 'aufbau')
|
||||
|
||||
@@ -3,12 +3,20 @@
|
||||
Darstellung nach tatsächlicher Containerbreite: unter 540 px gestapelt, 540–899 px flacher Bildstreifen,
|
||||
ab 900 px zweispaltig mit Bild links oder rechts (Variante). Die Höhe ändert Bildproportion und Abstände,
|
||||
nie die zulässige Textmenge. Der Text ist bereits bereinigter formatierter Text (RichText::sanitize).
|
||||
Der Bildanteil (imageShare) gilt nur im zweispaltigen Stand. Ohne Text, Überschrift, Label und Schaltflächen
|
||||
(hasCopy) steht das Bild allein über die ganze Breite. Ein freigegebenes Video (video.url, CardClip) liegt über dem
|
||||
Bild und spielt dort wie auf der Medienkarte (resources/js/card-clip.js); ohne freigegebenen Clip bleibt es beim Bild.
|
||||
--}}
|
||||
@php
|
||||
$side = $variant === 'image_left' ? 'left' : 'right';
|
||||
$heightClass = in_array($height, ['compact', 'normal', 'spacious'], true) ? $height : 'normal';
|
||||
$tag = \App\Domain\Cms\Widgets\Support\PremiumFields::headingTag($settings, ! empty($first));
|
||||
$hasCopy = $hasCopy ?? true;
|
||||
$imageShare = $imageShare ?? null;
|
||||
$clipUrl = $imageUrl ? ($video['url'] ?? null) : null;
|
||||
$clipTitle = (string) ($video['title'] ?? '');
|
||||
@endphp
|
||||
@if ($imageUrl || $hasCopy)
|
||||
<div class="lf-bt-host">
|
||||
<div @class([
|
||||
'lf-bt',
|
||||
@@ -16,7 +24,11 @@
|
||||
'lf-bt--image-'.$side,
|
||||
'lf-bt--height-'.$heightClass,
|
||||
'lf-bt--without-image' => ! $imageUrl,
|
||||
'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'] }}%">
|
||||
@if ($hasCopy)
|
||||
<div class="lf-bt__copy">
|
||||
@php($lead = \App\Domain\Cms\Widgets\Support\HeadingAccent::lead($settings))
|
||||
@if ($lead['side'] !== null)<div class="lf-lead lf-lead--{{ $lead['side'] }} lf-lead--{{ $lead['align'] }}"><x-brand.symbol :name="$lead['symbol']" class="lf-lead__symbol" /><div class="lf-lead__body">@endif
|
||||
@@ -41,11 +53,17 @@
|
||||
@endif
|
||||
@if ($lead['side'] !== null)</div></div>@endif
|
||||
</div>
|
||||
@endif
|
||||
@if ($imageUrl)
|
||||
<div class="lf-bt__media">
|
||||
<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 }}" alt="{{ $imageAlt ?? '' }}" @if (! empty($first)) loading="eager" fetchpriority="high" @else loading="lazy" @endif decoding="async">
|
||||
@include('widgets.partials.card-clip')
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@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