Files
tsv08kulmbach-website/app/components/hero.php

28 lines
1.1 KiB
PHP
Raw Normal View History

<?php
declare(strict_types=1);
/**
* Vollflächiger Hero mit Hintergrundbild, Titel, Intro und CTAs.
* Props: $hero (array aus home.json: title, text, image, ctas)
*/
?>
<section class="hero">
<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'])): ?>
<?php /* Bild bleibt Poster/Fallback; reduced-motion blendet das Video per CSS aus */ ?>
<video class="hero__video" src="<?= e(asset($hero['video'])) ?>" autoplay muted loop playsinline preload="none" tabindex="-1"></video>
<?php endif; ?>
</div>
<div class="container hero__content">
<h1 class="hero__title"><?= e($hero['title']) ?></h1>
<p class="hero__text"><?= e($hero['text']) ?></p>
<div class="hero__actions">
<?php foreach ($hero['ctas'] as $cta): ?>
<?php component('cta', ['cta' => $cta]); ?>
<?php endforeach; ?>
</div>
</div>
</section>