Files
laraundfelix/resources/views/widgets/hero.blade.php
T
LarsandClaude Sonnet 5.5 cf8189623c
CI Feature / test (push) Successful in 2m40s
Füge Symbol vor Überschriften, Pinselstrich und Merkmalszeile ins CMS ein
Die Kleingrafiken des Brand-Kits sind jetzt im Redaktionsinhalt wählbar, nicht nur
an Medienkarten:

- Einstellung "Symbol vor der Überschrift" (settings.symbol) an Überschrift,
  Einstieg, Bild und Text und Handlungsaufruf. Feste Auswahl von 14 Symbolen
  (HeadingAccent::SYMBOLS), ein unbekannter Name wird beim Speichern abgewiesen.
- Einstellung "Pinselstrich" (settings.accent = brush) am Widget Überschrift.
- Neues Widget "Merkmalszeile" (features): zwei bis vier Merkmale mit Symbol,
  Kurztitel und Satz; die Anzahl bestimmt die Spalten.
- Auf dunklen Flächen stehen die Symbole auf einer weißen Scheibe, weil sie
  feste Markenfarben mit viel Navy haben.
- brand/symbol erzeugt keine Zeilenumbrüche mehr um das SVG, damit es im
  Fließtext und in Überschriften keine zusätzliche Lücke gibt.

Der Test der Widget-Reihenfolge kennt das neue Widget bewusst (features nach cards).
Stufe 3b (Symbole mitten im Fließtext) bleibt zurückgestellt.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 19:11:43 +01:00

64 lines
4.0 KiB
PHP

{{--
Premium-Einstieg (Brand-UI-Kit v1.6, Komponente lf-hero), angepasst an die Widget-Hülle der Registry.
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'] }}%"
@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')
<x-brand.rays class="lf-hero__rays" />
@endif
@if (filled($data['eyebrow'] ?? null))
<p class="lf-hero__eyebrow">{{ $data['eyebrow'] }}</p>
@endif
<{{ $tag }} class="lf-hero__title"><x-brand.heading-symbol :settings="$settings" />{{ $data['heading'] ?? '' }}</{{ $tag }}>
@if ($accent !== 'none')
<span class="lf-hero__title-accent" aria-hidden="true"></span>
@endif
@if (filled($data['text'] ?? null))
<p class="lf-hero__description">{{ $data['text'] }}</p>
@endif
@if ($actions !== [])
<div class="lf-hero__actions">
@foreach ($actions as $index => $item)
<a @class(['lf-hero__button', 'lf-hero__button--primary' => $index === 0, 'lf-hero__button--secondary' => $index > 0]) href="{{ $item['url'] }}">{{ $item['label'] }}</a>
@endforeach
</div>
@endif
</div>
</div>
<span class="lf-hero__bottom" aria-hidden="true"></span>
</div>
</div>
@include('widgets.partials.image-notice')
@if ($context->preview && ! empty($video['notice']))
<p class="preview-note">{{ $video['notice'] }}</p>
@endif