feat: implement page template hero functionality with dynamic image handling and localization support for enhanced visual presentation

This commit is contained in:
Ümit Tunç
2026-05-22 07:36:24 +03:00
parent ead0077fde
commit 11cb89c944
11 changed files with 232 additions and 34 deletions
@@ -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