From c54db8cc077b13201d7856f80b574f7fe81d405b Mon Sep 17 00:00:00 2001 From: ankitkr104 Date: Wed, 18 Mar 2026 17:41:43 +0530 Subject: [PATCH] feat: add scroll-driven animation to About page Timeline section - Add useScroll + useTransform to track scroll progress through timeline - Animated yellow vertical line grows/shrinks as user scrolls up/down - Travelling yellow dot moves along the line in sync with scroll - Dual pulsing rings on the travelling dot for visual depth - Background track line added as static reference - Pass index prop to TimelineElement for alternating card animations - Heading entrance animation updated with scale effect Closes #690 --- src/components/about/Timeline.jsx | 132 +++++++++++++++++++----------- 1 file changed, 83 insertions(+), 49 deletions(-) diff --git a/src/components/about/Timeline.jsx b/src/components/about/Timeline.jsx index f4e1fce2..053ef59d 100644 --- a/src/components/about/Timeline.jsx +++ b/src/components/about/Timeline.jsx @@ -1,59 +1,93 @@ 'use client' +import { useRef } from 'react' import { TimelineElement } from './TimelineElement' -import { motion } from 'framer-motion' +import { motion, useScroll, useTransform } from 'framer-motion' export function Timeline() { + const containerRef = useRef(null) + const { scrollYProgress } = useScroll({ + target: containerRef, + offset: ["start 80%", "end 20%"] + }) + + const lineHeight = useTransform(scrollYProgress, [0, 1], ["0%", "100%"]) + const glowY = useTransform(scrollYProgress, [0, 1], ["0%", "100%"]) + const lineOpacity = useTransform(scrollYProgress, [0, 0.05, 0.95, 1], [0, 1, 1, 0]) + return (
- - Our Journey - -
-
    - - - - - - - -
-
+ + Our Journey + + +
+
    + + {/* background track line */} +
    + + {/* highlighted animated line */} + + + {/* travelling dot */} + + {/* pulsing ring 1 */} + + {/* pulsing ring 2 — offset */} + + + + + + + + + + +
+
) }