Files
laraundfelix/resources/views/widgets/hero.blade.php
T
LarsandClaude Sonnet 5.5 390d61feaa
Deploy Test / test (push) Successful in 3m31s
CI Feature / test (push) Successful in 2m49s
Deploy Test / deploy (push) Successful in 32s
Gib allen Widgets mit Überschrift dieselben Symbolmöglichkeiten
Nach der fünften Sichtung auf luf-test:

- Einheitliche Größenstufen (small, medium, large, xlarge = 2,5 / 3,5 / 5 / 7 rem)
  als Tokens --lf-symbol-* und als HeadingAccent::STEPS. Überschrift,
  Einstieg, Bild und Text, Handlungsaufruf, Fließtext und Merkmalszeile
  verwenden dieselben Schlüssel und Werte. Die früheren Stufen Groß und Sehr
  groß neben dem Absatz waren zur Breite skaliert (bis 7 und 10 rem) und sind
  jetzt fest 5 und 7 rem; neu ist Klein.
- Einstieg und Bild und Text: Größe (symbol_size) und senkrechte Ausrichtung
  (symbol_align) neben dem ganzen Textblock, auch auf Navy und auf dem
  Navy-Einstieg (weiße Scheibe).
- Fließtext: Symbol neben dem Text, Vorgabe Mittel.
- Handlungsaufruf: zusätzlich der Pinselstrich unter der Überschrift.
- Ausrichtung "Oben": die Korrektur der Oberkante rechnet mit der tatsächlichen
  Zeilenhöhe je Widget (Einstieg 1,06, Bild und Text 1,14, Fließtext Source
  Sans 3). Am gerenderten Bild gemessen liegen Symbol und Schrift bei allen
  Widgets auf etwa einen Pixel genau auf einer Linie.
- HeadingAccent::lead() bündelt, was eine Ansicht für Symbol und Absatz braucht.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-24 09:20:58 +01:00

67 lines
4.4 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
@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
@if (filled($data['eyebrow'] ?? null))
<p class="lf-hero__eyebrow">{{ $data['eyebrow'] }}</p>
@endif
<{{ $tag }} class="lf-hero__title"><x-brand.heading-symbol :settings="$lead['inline']" />{{ $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
@if ($lead['side'] !== null)</div></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