From bc234b44007a05ebd457f3de99e6283e9d9926d1 Mon Sep 17 00:00:00 2001 From: Mustafa Date: Thu, 30 Jul 2026 13:20:40 +0300 Subject: [PATCH] feat: hotspots with animated line+arrow+card, always visible on last frame --- components/sections/CloudRevealSection.tsx | 136 ++++++++++----------- 1 file changed, 66 insertions(+), 70 deletions(-) diff --git a/components/sections/CloudRevealSection.tsx b/components/sections/CloudRevealSection.tsx index 02ee716..4d5f501 100644 --- a/components/sections/CloudRevealSection.tsx +++ b/components/sections/CloudRevealSection.tsx @@ -242,36 +242,18 @@ export default function CloudRevealSection() { // ─── Hotspot bileşeni ──────────────────────────────────────────────────────── -const HOTSPOTS = [ - { - id: 'blok-a', - label: '2+1 Daire', - sub: 'Blok A · 89 m²', - // Ekranın yüzde konumu (sol-üst köşeden) - x: 34, - y: 22, - }, - { - id: 'blok-b', - label: '2+1 Daire', - sub: 'Blok B · 84 m²', - x: 70, - y: 19, - }, - { - id: 'blok-c', - label: '1+1 Daire', - sub: 'Blok C · 60 m²', - x: 50, - y: 55, - }, - { - id: 'blok-d', - label: '1+1 Daire', - sub: 'Blok D · 47 m²', - x: 20, - y: 65, - }, +const HOTSPOTS: { + id: string + label: string + sub: string + x: number // dot pozisyonu — ekranın % yatay + y: number // dot pozisyonu — ekranın % dikey + dir: 'left' | 'right' // kartın hangi tarafa uzayacağı +}[] = [ + { id: 'blok-a', label: '2+1 Daire', sub: 'Blok A · 89 m²', x: 34, y: 22, dir: 'left' }, + { id: 'blok-b', label: '2+1 Daire', sub: 'Blok B · 84 m²', x: 70, y: 19, dir: 'right' }, + { id: 'blok-c', label: '1+1 Daire', sub: 'Blok C · 60 m²', x: 50, y: 55, dir: 'right' }, + { id: 'blok-d', label: '1+1 Daire', sub: 'Blok D · 47 m²', x: 20, y: 65, dir: 'left' }, ] function UnitHotspots({ @@ -279,58 +261,72 @@ function UnitHotspots({ }: { scrollYProgress: ReturnType['scrollYProgress'] }) { - const opacity = useTransform(scrollYProgress, [0.92, 0.98], [0, 1]) + const containerOpacity = useTransform(scrollYProgress, [0.92, 0.98], [0, 1]) return ( {HOTSPOTS.map((spot, i) => ( - { - // İleride: daire içi frame animasyonunu tetikle - console.log('clicked:', spot.id) - }} > - {/* Pulsing dot */} - - - - + {/* Dot + çizgi + kart — yatay flex */} +
- {/* Label kartı — hover'da görünür, mobilde her zaman */} -
- {/* Animated ok çizgisi */} - + + + + + {/* Animated çizgi */} + + + {/* Ok ucu */} + - - -

{spot.label}

-

{spot.sub}

-
- Detaylar - - - -
+ {spot.dir === 'right' + ? + : + } +
+ + {/* Kart */} + { + // İleride: daire içi frame sekansını başlat + console.log('unit clicked:', spot.id) + }} + > +

{spot.label}

+

{spot.sub}

+
+ İncele + + + +
+
+
- +
))}
)