@props([ 'images', 'title' => 'Gallery', 'columns' => 'grid-cols-2 md:grid-cols-4', 'class' => 'mt-20', 'itemName' => null, ]) @php $imageCount = $images ? count($images) : 0; $rotations = ['-rotate-1', 'rotate-[1.5deg]', '-rotate-[1.5deg]', 'rotate-1']; $galleryJsonData = $images ? $images->values()->map(function($img, $idx) use ($itemName, $title) { $url = $img->file ? \Illuminate\Support\Facades\Storage::url($img->file) : $img->thumbnail(1200, 800); $name = $itemName ?: $title; $alt = $img->altText($name, $idx + 1); return [ 'src' => $url, 'alt' => $alt, ]; }) : collect(); @endphp @if ($images && $imageCount > 0)