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 (