| "use client"; | |
| import { motion, useScroll, useSpring } from "framer-motion"; | |
| export function ScrollProgress() { | |
| const { scrollYProgress } = useScroll(); | |
| const scaleX = useSpring(scrollYProgress, { | |
| stiffness: 120, | |
| damping: 20, | |
| restDelta: 0.001, | |
| }); | |
| return ( | |
| <motion.div | |
| style={{ scaleX }} | |
| className="fixed left-0 right-0 top-0 h-0.5 origin-left z-[60] bg-gradient-to-r from-teal-500 to-amber" | |
| /> | |
| ); | |
| } | |