Wire homepage hero to featured thumbnail family; add featured-picture component
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
@props([
|
||||
'image' => [],
|
||||
'fetchpriority' => 'auto',
|
||||
'loading' => 'lazy',
|
||||
'decoding' => 'async',
|
||||
])
|
||||
|
||||
@php
|
||||
$sources = is_array($image['sources'] ?? null) ? $image['sources'] : [];
|
||||
$src = $image['img_src'] ?? 'https://files.skinbase.org/default/missing_xl.webp';
|
||||
$srcset = $image['img_srcset'] ?? null;
|
||||
$sizes = $image['img_sizes'] ?? '100vw';
|
||||
$alt = $image['alt'] ?? 'Featured artwork';
|
||||
@endphp
|
||||
|
||||
<picture>
|
||||
@foreach ($sources as $source)
|
||||
<source
|
||||
media="{{ $source['media'] ?? '' }}"
|
||||
srcset="{{ $source['srcset'] ?? '' }}"
|
||||
sizes="{{ $source['sizes'] ?? '100vw' }}"
|
||||
type="image/webp"
|
||||
>
|
||||
@endforeach
|
||||
<img
|
||||
src="{{ $src }}"
|
||||
@if($srcset) srcset="{{ $srcset }}" sizes="{{ $sizes }}" @endif
|
||||
alt="{{ $alt }}"
|
||||
{{ $attributes }}
|
||||
fetchpriority="{{ $fetchpriority }}"
|
||||
loading="{{ $loading }}"
|
||||
decoding="{{ $decoding }}"
|
||||
>
|
||||
</picture>
|
||||
Reference in New Issue
Block a user