Hero: Ausrichtungs-Varianten (align: center | bottom-left), Startseite zentriert

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-11 21:24:45 +02:00
parent fcb2c3f75f
commit 01580453d4
3 changed files with 20 additions and 3 deletions

View File

@@ -3,11 +3,13 @@
declare(strict_types=1);
/**
* Vollflächiger Hero mit Hintergrundbild, Titel, Intro und CTAs.
* Props: $hero (array aus home.json: title, text, image, ctas)
* Vollflächiger Hero mit Hintergrundbild/-video, Titel, Intro und CTAs.
* Props: $hero (array aus home.json: title, text, image, video?, ctas, align?)
* align-Varianten: 'center' (mittig zentriert), 'bottom-left' (Default).
*/
$align = in_array($hero['align'] ?? '', ['center', 'bottom-left'], true) ? $hero['align'] : 'bottom-left';
?>
<section class="hero">
<section class="hero<?= $align === 'center' ? ' hero--center' : '' ?>">
<div class="hero__media" aria-hidden="true">
<?php component('img', ['image' => $hero['image'], 'sizes' => '100vw', 'eager' => true, 'class' => 'hero__img']); ?>
<?php if (!empty($hero['video'])): ?>