_car_gallery.blade.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. {{--
  2. Partial: галерея фотографий + теги автомобиля (публичная страница авто)
  3. Переменные из родителя: $car, $carName, $photos, $fuelLabels, $countryFlags
  4. --}}
  5. {{-- Галерея --}}
  6. <div class="gallery" style="margin-bottom:28px">
  7. <div class="gallery-main" id="gMain">
  8. @if(count($photos) > 0)
  9. <img src="{{ $photos[0] }}" alt="{{ $carName }}" id="mainImg"
  10. style="width:100%;height:100%;object-fit:cover"/>
  11. @else
  12. <div style="width:100%;height:100%;background:var(--bg2);display:flex;align-items:center;justify-content:center;font-size:72px">🚗</div>
  13. @endif
  14. </div>
  15. @if(count($photos) > 1)
  16. <div class="gallery-thumbs" id="gThumbs">
  17. @foreach($photos as $i => $photo)
  18. <div class="thumb {{ $i === 0 ? 'active' : '' }}" onclick="setThumb({{ $i }}, '{{ $photo }}')">
  19. <img src="{{ $photo }}" alt="Фото {{ $i + 1 }}" loading="lazy"/>
  20. </div>
  21. @endforeach
  22. </div>
  23. @endif
  24. </div>
  25. {{-- Заголовок + теги --}}
  26. <h1 style="font-family:var(--fh);font-size:clamp(24px,4vw,42px);font-weight:900;letter-spacing:-.02em;margin-bottom:12px">
  27. {{ $carName }}
  28. </h1>
  29. <div style="display:flex;gap:8px;flex-wrap:wrap;margin-bottom:28px">
  30. @if($car->country_origin)
  31. <span class="chip chip-dark">{{ $countryFlags[$car->country_origin] ?? '🌍' }} {{ $car->country_origin }}</span>
  32. @endif
  33. @if($car->condition === 'new')
  34. <span class="chip chip-red">Новый</span>
  35. @elseif($car->condition === 'used')
  36. <span class="chip chip-outline">С пробегом</span>
  37. @endif
  38. @if($car->engine_type)
  39. <span class="chip chip-outline">{{ $fuelLabels[$car->engine_type] ?? $car->engine_type }}</span>
  40. @endif
  41. @if($car->customs_cleared)
  42. <span class="chip chip-outline">Растаможен</span>
  43. @endif
  44. @if($car->accident_free)
  45. <span class="chip chip-outline">Без ДТП</span>
  46. @endif
  47. </div>