optimize image

This commit is contained in:
isUnknown 2024-09-19 10:21:26 +02:00
parent 3f81882bcd
commit 038f28c191
5 changed files with 24 additions and 35 deletions

View file

@ -3,20 +3,21 @@
<div class="image-wrapper">
<?php if ($event->gallery()->toFiles()->count() > 1): ?>
<?php snippet('picture', [
'file' => $event->gallery()->toFiles()->first(),
'class' => 'image-cover'
'file' => $event->gallery()->toFiles()->first()->thumb('grid'),
'class' => 'image-cover',
'size' => (100 / (12 / $span) - 10)
]) ?>
<?php endif ?>
<?php
$file = $event->gallery()->toFiles()->count() > 1 ? $event->gallery()->toFiles()->nth(1) : $event->gallery()->toFiles()->first();
snippet('picture', ["file" => $file]);
snippet('picture', ["file" => $file, 'size' => (100 / (12 / $span) - 10)]);
?>
</div>
<div class="event-card__infos">
<div>
<h5><?= $event->title() ?></h5>
<?php if ($event->isMapadoEvent() == 'true'): ?>
<?php snippet('ticket', ['link' => option('ticketingUrl') . 'event/' . $event->mapadoSlug()]) ?>
<?php snippet('ticket', ['link' => option('ticketingUrl') . 'event/' . $event->mapadoSlug(), 'size' => (100 / (12 / $span) - 10)]) ?>
<?php endif ?>
</div>
<div>