diff --git a/src/components/AboutUs/RoadmapSection.tsx b/src/components/AboutUs/RoadmapSection.tsx index 1af1e7a3..85affb3a 100644 --- a/src/components/AboutUs/RoadmapSection.tsx +++ b/src/components/AboutUs/RoadmapSection.tsx @@ -1,10 +1,32 @@ -import React from 'react'; -import { motion } from 'framer-motion'; +import React, { useRef } from 'react'; +import { motion, useScroll, useTransform } from 'framer-motion'; import { roadmapItems, roadmapContent } from '@/constants/aboutUs/roadmap'; const RoadmapSection: React.FC = () => { + const sectionRef = useRef(null); + const timelineRef = useRef(null); + const mobileTimelineRef = useRef(null); + + const { scrollYProgress } = useScroll({ + target: sectionRef, + offset: ['start end', 'end start'], + }); + + const progressHeight = useTransform( + scrollYProgress, + [0, 0.8], + ['0%', '100%'], + ); + + const mobileProgressHeight = useTransform( + scrollYProgress, + [0, 0.8], + ['0%', '100%'], + ); + return (
@@ -45,13 +67,14 @@ const RoadmapSection: React.FC = () => { -
+
+
{/* Roadmap items */} @@ -102,18 +125,19 @@ const RoadmapSection: React.FC = () => {
{/* Mobile Timeline - Single Column */} -
+
- {/* Vertical connecting line */} - - + {roadmapItems.map((item, index) => (