picture - bg color before loading = event color or season color

This commit is contained in:
isUnknown 2024-09-17 15:49:48 +02:00
parent c49aca969e
commit cb65669ccc
6 changed files with 7 additions and 5 deletions

View file

@ -1,6 +1,6 @@
<div class="event-card grid__item" style="--span: <?= $span ?>">
<a class="event-card__link" href="<?= $event->url() ?>"></a>
<div class="image-wrapper">
<div class="image-wrapper" style="--color: <?= $event->color()->isNotEmpty() ? $event->color() : 'var(--color-season)' ?>">
<?php if ($event->gallery()->toFiles()->count() > 1): ?>
<?php snippet('picture', [
'file' => $event->gallery()->toFiles()->first(),

View file

@ -14,7 +14,7 @@
$span = 3;
}
}
snippet('event-card', ["event" => $event, "span" => $span])
snippet('event-card', ["event" => $event, "span" => $span, "color" => $event->color()->isNotEmpty() == 'true' ? $event->color() : null])
?>
<?php endforeach ?>
</div>