From 972faa7e32697259feb52726c3ebd62b8aa4552c Mon Sep 17 00:00:00 2001 From: isUnknown Date: Thu, 5 Sep 2024 12:37:46 +0200 Subject: [PATCH] add images covers --- assets/css/src/generic.css | 14 ++++++++++++++ site/snippets/event-card.php | 7 ++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/assets/css/src/generic.css b/assets/css/src/generic.css index 19371dc..d4fc7f3 100644 --- a/assets/css/src/generic.css +++ b/assets/css/src/generic.css @@ -172,3 +172,17 @@ .shift-small { margin-left: var(--shift-small); } + +.image-wrapper { + position: relative; +} + +.image-wrapper .image-cover { + position: absolute; + z-index: 2; + opacity: 1; + transition: opacity 0.2s ease-in-out; +} +.event-card:hover .image-cover { + opacity: 0; +} diff --git a/site/snippets/event-card.php b/site/snippets/event-card.php index 807c7ab..30bf089 100644 --- a/site/snippets/event-card.php +++ b/site/snippets/event-card.php @@ -1,6 +1,11 @@
- $event->gallery()->toFiles()->first()]) ?> +
+ gallery()->toFiles()->count() > 1): ?> + + + $event->gallery()->toFiles()->count() > 1 ? $event->gallery()->toFiles()->nth(2) : $event->gallery()->toFiles()->first()]) ?> +
title() ?>