feat(assets): connect static images as fallbacks; fix location slug mapping
- 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:
parent
ef693589bc
commit
f317de7b0f
4 changed files with 33 additions and 38 deletions
|
|
@ -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']
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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[] = [
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue