FEATURE Adding a cover variant for the card
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Antoine M 2025-09-25 15:20:06 +02:00
parent 4f4ae81043
commit bb5d011d3b
2 changed files with 18 additions and 3 deletions

View File

@ -38,6 +38,14 @@
&__tags { &__tags {
@apply flex flex-wrap gap-4 pt-4; @apply flex flex-wrap gap-4 pt-4;
} }
&__cover {
@apply w-48 h-48 absolute border-primary border bottom-12 right-12 hidden lg:block;
transform: rotate(-3deg);
img {
@apply w-full h-full object-cover;
}
}
.cta--go { .cta--go {
@apply text-primary; @apply text-primary;
} }

View File

@ -1,7 +1,8 @@
<?php <?php
$articleID = $args['ID']; $articleID = $args['ID'];
$isSwiperSlide = $args['isSwiperSlide']; $isSwiperSlide = $args['isSwiperSlide'] ?? false;
$showCover = $args['showCover'] ?? false;
$cover = get_the_post_thumbnail_url($articleID);
?> ?>
<div class="article-card <?php echo $isSwiperSlide ? 'swiper-slide' : ''; ?>"> <div class="article-card <?php echo $isSwiperSlide ? 'swiper-slide' : ''; ?>">
@ -25,9 +26,15 @@ $isSwiperSlide = $args['isSwiperSlide'];
</ul> </ul>
<?php if ($showCover && isset($cover) && $cover) : ?>
<div class="article-card__cover">
<img src="<?php echo $cover; ?>" alt="<?php echo get_the_title($articleID); ?>">
</div>
<?php endif; ?>
<?php get_template_part('template-parts/components/cta--go', null, array( <?php get_template_part('template-parts/components/cta--go', null, array(
'url' => get_the_permalink($articleID), 'url' => get_the_permalink($articleID),
'label' => 'Lire la revue lol', 'label' => 'Lire la revue',
'target' => '_self', 'target' => '_self',
)); ?> )); ?>