"use client";
import { useScroll, useVelocity, useTransform, useSpring } from "framer-motion";

export function useScrollVelocity() {
  const { scrollY } = useScroll();
  const velocity    = useVelocity(scrollY);
  const smooth      = useSpring(velocity, { stiffness: 50, damping: 15 });
  const factor      = useTransform(smooth, [-3000, 0, 3000], [-1, 0, 1]);
  return { scrollY, velocity: smooth, factor };
}
