import { useRef } from "react"; import { motion, useScroll, useTransform } from "motion/react"; import ImageOrVideo from "@/components/ui/ImageOrVideo"; type FeaturesParallaxShowcaseProps = { title: string; leftImageSrc: string; rightImageSrc: string; } & ({ backgroundSrc: string; backgroundVideoSrc?: never } | { backgroundVideoSrc: string; backgroundSrc?: never }); const FeaturesParallaxShowcase = ({ title, backgroundSrc, backgroundVideoSrc, leftImageSrc, rightImageSrc, }: FeaturesParallaxShowcaseProps) => { const sectionRef = useRef(null); const { scrollYProgress } = useScroll({ target: sectionRef, offset: ["start end", "end start"], }); const leftY = useTransform(scrollYProgress, [0, 1], ["-10%", "20%"]); const leftRotate = useTransform(scrollYProgress, [0, 1], [-13, 8]); const rightY = useTransform(scrollYProgress, [0, 1], ["-5%", "25%"]); const rightRotate = useTransform(scrollYProgress, [0, 1], [6, -7]); return (

{title}

); }; export default FeaturesParallaxShowcase;