webp
This commit is contained in:
parent
068492e495
commit
53a2ed8b0f
11 changed files with 29 additions and 21 deletions
|
|
@ -3,14 +3,14 @@
|
|||
<div class="image-wrapper">
|
||||
<?php if ($event->gallery()->toFiles()->count() > 1): ?>
|
||||
<?php snippet('picture', [
|
||||
'file' => $event->gallery()->toFiles()->first()->thumb('grid'),
|
||||
'file' => $event->gallery()->toFiles()->first()->thumb(),
|
||||
'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, 'size' => (100 / (12 / $span) - 10), 'alt' => null]);
|
||||
snippet('picture', ["file" => $file->thumb(), 'size' => (100 / (12 / $span) - 10), 'alt' => null]);
|
||||
?>
|
||||
</div>
|
||||
<div class="event-card__infos">
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@
|
|||
$alt = $alt ?? $file->alt();
|
||||
$crop = $crop ?? false;
|
||||
|
||||
$webPSrcset = $crop === 'banner' ? $file->crop(1600, 800)->srcset('webp') : $file->srcset('webp');
|
||||
$srcset = $crop === 'banner' ? $file->crop(1600, 800)->srcset() : $file->srcset();
|
||||
$src = $crop === 'banner' ? $file->crop(1600, 800)->url() : $file->url();
|
||||
$width = $crop === 'banner' ? $file->crop(1600, 800)->width() : $file->resize(1800)->width();
|
||||
$height = $crop === 'banner' ? $file->crop(1600, 800)->height() : $file->resize(1800)->height();
|
||||
$webPSrcset = $file->srcset('webp');
|
||||
$srcset = $file->srcset();
|
||||
$src = $file->url();
|
||||
$width = $file->resize(1800)->width();
|
||||
$height = $file->resize(1800)->height();
|
||||
$class = isset($class) ? 'class="' . $class . '"': '';
|
||||
$lazy = $lazy ?? true;
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue