34 lines
1.0 KiB
PHP
34 lines
1.0 KiB
PHP
@props([
|
|
'hero' => null,
|
|
'alt' => '',
|
|
])
|
|
|
|
@if($hero)
|
|
@if(!empty($hero['from_upload']))
|
|
<img
|
|
{{ $attributes->merge(['class' => 'w-full max-w-full !h-auto']) }}
|
|
src="{{ $hero['image'] }}"
|
|
alt="{{ $alt }}"
|
|
@if(!empty($hero['width'])) width="{{ $hero['width'] }}" @endif
|
|
@if(!empty($hero['height'])) height="{{ $hero['height'] }}" @endif
|
|
fetchpriority="high"
|
|
decoding="async"
|
|
>
|
|
@else
|
|
<picture>
|
|
@if(!empty($hero['webp']))
|
|
<source srcset="{{ asset($hero['webp']) }}" type="image/webp">
|
|
@endif
|
|
<img
|
|
{{ $attributes->merge(['class' => 'w-full max-w-full !h-auto']) }}
|
|
src="{{ asset($hero['image']) }}"
|
|
alt="{{ $alt }}"
|
|
width="{{ $hero['width'] ?? 735 }}"
|
|
height="{{ $hero['height'] ?? 735 }}"
|
|
fetchpriority="high"
|
|
decoding="async"
|
|
>
|
|
</picture>
|
|
@endif
|
|
@endif
|