'use client' import { motion, useScroll, useTransform } from 'framer-motion' import { useRef } from 'react' export default function ScrollReveal() { const containerRef = useRef(null) const { scrollYProgress } = useScroll({ target: containerRef, offset: ["start start", "end end"] }) // Text Animations - Sharp movement const topTextY = useTransform(scrollYProgress, [0.1, 0.5], [0, -400]) const bottomTextY = useTransform(scrollYProgress, [0.1, 0.5], [0, 400]) // Video Animations - Sharp appearing. // We use opacity as a "switch" at 0.1 to keep it hidden until then. const videoVisible = useTransform(scrollYProgress, [0, 1], [0, 1]) const videoScale = useTransform(scrollYProgress, [0, 0.8], [0, 1]) const videoWidth = useTransform(scrollYProgress, [0, 0.8], ["20vw", "100vw"]) const videoHeight = useTransform(scrollYProgress, [0, 0.8], ["10vh", "100vh"]) const videoBorderRadius = useTransform(scrollYProgress, [0.6, 0.9], ["40px", "0px"]) return (
{/* TEXT MASK CONTAINER */}
Stay bliss Enjoy more
{/* EXPANDING VIDEO CONTAINER */}