"use client"; import { useRef } from "react"; import { motion, useScroll, useTransform, useSpring } from "framer-motion"; export default function ScrollVideo() { const containerRef = useRef(null); // Use scroll progress within this section const { scrollYProgress } = useScroll({ target: containerRef, offset: ["start start", "end end"] }); // Smooth out the scroll value const smoothProgress = useSpring(scrollYProgress, { stiffness: 100, damping: 30, restDelta: 0.001 }); // Calculate the expansion: Starts at 25% circle, grows to 150% (to fully cover screen) const clipPathValue = useTransform(smoothProgress, [0, 1], ["circle(25% at 50% 50%)", "circle(100% at 50% 50%)"]); // Also fade the overlay const overlayOpacity = useTransform(smoothProgress, [0, 0.8], [0.3, 0]); return (
{/* YouTube Embed with Hardware Acceleration */}
{/* Subtle Overlay */}
); }