@php $presentation = $moto->presentation; $patternRight = '/transform="translate\(1600, 0\) scale\(-/'; $patternLeft = '/transform="translate\(0, 0\) scale\(1/'; @endphp

{{ $presentation->title }} {{ $presentation->subtitle }}

@foreach($presentation->images as $index => $image) @php $svg = ''; if(Str::startsWith($image->image, ['http://', 'https://', '/'])) { $svgPath = public_path(str_replace(url('/'), '', $image->image)); if(file_exists($svgPath)) { $svg = file_get_contents($svgPath); } } $type = 'center'; if ($svg && preg_match($patternRight, $svg)) { $type = 'right'; } elseif ($svg && preg_match($patternLeft, $svg)) { $type = 'left'; } $class = match($type) { 'right' => 'scale-140 origin-top-left md:scale-100', 'left' => 'scale-140 origin-top-right md:scale-100', default => 'scale-140 md:scale-100', }; @endphp
@if($type !== 'center') @endif {!! $svg !!} @if($type !== 'center') @endif
@endforeach