Hero-Video eingebaut: komprimiert 11→2,9 MB, Bild bleibt Poster/Fallback, reduced-motion zeigt nur Bild

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-11 21:23:29 +02:00
parent 0f19729a88
commit fcb2c3f75f
4 changed files with 19 additions and 0 deletions

View File

@@ -10,6 +10,10 @@ declare(strict_types=1);
<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>