investigation → simplification du hero
All checks were successful
Deploy / Deploy to Production (push) Successful in 12s

This commit is contained in:
Julie Blanc 2026-02-19 15:25:44 +01:00
parent 65e8290edf
commit cc7c9f5dab
2 changed files with 25 additions and 41 deletions

View file

@ -29,27 +29,17 @@
<div class="page__content">
<?php if ($page->heroType()->value() == 'image'): ?>
<?php if ($heroImage = $page->heroImages()->toFile()): ?>
<!-- HERO IMAGE SIMPLE -->
<div id="investigation__hero">
<figure>
<img src="<?= $heroImage->url() ?>" alt="<?= $page->title()->esc() ?>">
</figure>
<?php if ($page->heroCaption()->isNotEmpty()): ?>
<figcaption><?= $page->heroCaption()->inline() ?></figcaption>
<?php elseif ($heroImage->caption()->isNotEmpty()): ?>
<figcaption><?= $heroImage->caption() ?></figcaption>
<?php endif ?>
</div>
<?php endif ?>
<?php
$videoPreview = $page->videoPreview()->toFile();
$hasVideo = $videoPreview || $page->videoUrl()->isNotEmpty();
?>
<?php elseif ($page->heroType()->value() == 'video'): ?>
<?php if ($hasVideo): ?>
<!-- HERO VIDEO -->
<div id="investigation__hero" class="hero-video">
<div class="player-container">
<?php if ($videoPreview = $page->videoPreview()->toFile()): ?>
<?php if ($videoPreview): ?>
<div class="extract">
<video class="vjs-tech" id="player-element_html5_api" tabindex="-1" loop="" muted="muted" playsinline="playsinline" autoplay="" src="<?= $videoPreview->url() ?>"></video>
<button id="hero-play-video"><span class="btn--bold"><?= svg('assets/icons/play.svg') ?> <span class="text">play video</span></button>
@ -67,6 +57,20 @@
<?php endif ?>
</div>
<?php elseif ($cover = $page->cover()->toFile()): ?>
<!-- HERO IMAGE (cover) -->
<div id="investigation__hero">
<figure>
<img src="<?= $cover->url() ?>" alt="<?= $page->title()->esc() ?>">
</figure>
<?php if ($page->heroCaption()->isNotEmpty()): ?>
<figcaption><?= $page->heroCaption()->inline() ?></figcaption>
<?php elseif ($cover->caption()->isNotEmpty()): ?>
<figcaption><?= $cover->caption() ?></figcaption>
<?php endif ?>
</div>
<?php endif ?>