feat: implement page template hero functionality with dynamic image handling and localization support for enhanced visual presentation
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
@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
|
||||
Reference in New Issue
Block a user