Files
webshop/shop/components/ScrollIndicator.tsx

25 lines
650 B
TypeScript

'use client'
import React from 'react'
import { motion, useScroll, useSpring } from 'framer-motion'
export function ScrollIndicator() {
const { scrollYProgress } = useScroll()
const scaleX = useSpring(scrollYProgress, {
stiffness: 100,
damping: 30,
restDelta: 0.001
})
return (
<motion.div
className="fixed top-0 left-0 right-0 h-[3px] origin-left z-50 pointer-events-none"
style={{
scaleX,
background: 'linear-gradient(90deg, var(--primary-custom, #2563eb) 0%, var(--accent-custom, #38bdf8) 100%)',
boxShadow: '0 0 12px var(--primary-custom, rgba(37,99,235,0.8))'
}}
/>
)
}