feat(assets): connect static images as fallbacks; fix location slug mapping
Some checks failed
CI / Type Check (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
Deploy / Build & Push Image (push) Has been cancelled
Deploy / Deploy to VPS (push) Has been cancelled

- DinoGallery: add real park photos as static fallback (T-Rex, aerial, arch)
- DinoHero: use T-Rex PNG as fallback when no CMS heroImage uploaded
- Locations/lokatsii: add DB slug aliases (dzerkalnyi-labiryt→maze, tyr→tir,
  maiydanchyk→playground) so all 5 locations get correct images

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vadym Samoilenko 2026-05-28 17:04:57 +01:00
parent ef693589bc
commit f317de7b0f
4 changed files with 33 additions and 38 deletions

View file

@ -36,8 +36,11 @@ const FALLBACK_IMAGES: Record<string, string> = {
dynopark: '/images/figma/loc-dinopark.webp',
dyvolis: '/images/figma/loc-divo-lis.webp',
maze: '/images/figma/loc-maze.webp',
'dzerkalnyi-labiryt': '/images/figma/loc-maze.webp',
tir: '/images/figma/loc-tir.webp',
tyr: '/images/figma/loc-tir.webp',
playground: '/images/figma/loc-playground.webp',
maiydanchyk: '/images/figma/loc-playground.webp',
}
const COLORS = ['#396817', '#2d5414', '#1a3009', '#2a5a12', '#1d4710']

View file

@ -7,8 +7,14 @@ interface DinoGalleryProps {
images?: string[]
}
const FALLBACK_GALLERY = [
'/images/figma/2c6a3e5e-7346-4c3e-b8a0-fae1facb87ad.jpg',
'/images/figma/2936ec5e-4f99-441e-9bf2-34f23c283170.jpg',
'/images/figma/7a2627b2-b6ce-4325-a0b1-fbc3393aca4c.png',
]
export function DinoGallery({ images }: DinoGalleryProps) {
const photos = images && images.length > 0 ? images : []
const photos = images && images.length > 0 ? images : FALLBACK_GALLERY
const [active, setActive] = useState(0)
const n = photos.length

View file

@ -118,36 +118,20 @@ export function DinoHero({
}}
/>
{/* Hero dino image */}
{heroImageUrl && (
<img
src={heroImageUrl}
alt="Динозавр динопарку"
className="absolute"
style={{
left: '5%',
top: '-15%',
width: '115%',
height: 'auto',
objectFit: 'contain',
objectPosition: 'bottom',
}}
loading="eager"
/>
)}
{/* Placeholder when no image uploaded yet */}
{!heroImageUrl && (
<div
className="absolute flex items-center justify-center"
style={{ left: '10%', top: '10%', width: '80%', height: '80%' }}
>
<span
style={{ fontSize: 'clamp(120px, 18vw, 260px)', lineHeight: 1, userSelect: 'none' }}
aria-hidden="true"
>
🦖
</span>
</div>
)}
<img
src={heroImageUrl ?? '/images/figma/081e52b5-d35a-41d2-b506-a9d751b0b563.png'}
alt="Динозавр динопарку"
className="absolute"
style={{
left: '5%',
top: '-15%',
width: '115%',
height: 'auto',
objectFit: 'contain',
objectPosition: 'bottom',
}}
loading="eager"
/>
</div>
{/* Mobile hero */}
@ -156,13 +140,12 @@ export function DinoHero({
className="mx-auto flex aspect-square items-center justify-center rounded-full"
style={{ background: 'radial-gradient(circle at 40% 40%, #f7d060 0%, #f0b429 70%)' }}
>
{heroImageUrl ? (
<img src={heroImageUrl} alt="" className="w-full object-contain" loading="eager" />
) : (
<span style={{ fontSize: 100 }} aria-hidden="true">
🦖
</span>
)}
<img
src={heroImageUrl ?? '/images/figma/081e52b5-d35a-41d2-b506-a9d751b0b563.png'}
alt=""
className="w-full object-contain"
loading="eager"
/>
</div>
</div>
</section>

View file

@ -12,8 +12,11 @@ const FALLBACK_IMAGES: Record<string, string> = {
dynopark: '/images/figma/loc-dinopark-v2.webp',
dyvolis: '/images/figma/loc-divo-lis-v2.webp',
maze: '/images/figma/loc-maze-v2.webp',
'dzerkalnyi-labiryt': '/images/figma/loc-maze-v2.webp',
tir: '/images/figma/loc-tir-v2.webp',
tyr: '/images/figma/loc-tir-v2.webp',
playground: '/images/figma/loc-playground-v2.webp',
maiydanchyk: '/images/figma/loc-playground-v2.webp',
}
const STATIC_LOCATIONS: LocationData[] = [