hero image cover hidden on hover

This commit is contained in:
isUnknown 2024-09-20 14:57:29 +02:00
parent 67fefa1125
commit b1bf757aa4
5 changed files with 50 additions and 6 deletions

View file

@ -76,7 +76,7 @@ tabs:
label: Image
type: files
min: 1
max: 1
max: 2
layout: cards
size: full
image:

View file

@ -8,12 +8,18 @@
</div>
<div class="hero__image" style="--color: var(--color-season)">
<?php if ($site->heroLinkUrl()->isNotEmpty() == 'true'): ?>
<a href="<?= $site->heroLinkUrl()->toUrl() ?>" title="en savoir plus">
<?php snippet('picture', ['file' => $site->heroImage()->toFile(), 'lazy' => false, 'size' => 60]) ?>
</a>
<?php else: ?>
<?php snippet('picture', ['file' => $site->heroImage()->toFile(), 'lazy' => false, 'size' => 60]) ?>
<a href="<?= $site->heroLinkUrl()->toUrl() ?>" title="en savoir plus"></a>
<?php endif ?>
<div class="image-wrapper">
<?php if ($site->heroImage()->toFiles()->count() > 1): ?>
<?php snippet('picture', [
'file' => $site->heroImage()->toFiles()->first(),
'class' => 'image-cover',
'size' => 60
]) ?>
<?php endif ?>
<?php snippet('picture', ['file' => $site->heroImage()->toFiles()->count() > 1 ? $site->heroImage()->toFiles()->nth(1) : $site->heroImage()->toFiles()->first(), 'lazy' => false, 'size' => 60]) ?>
</div>
</div>
</section>