"use client"; import { motion, useMotionValue, useTransform, useSpring } from "framer-motion"; import { useEffect, useState } from "react"; export const BackgroundBlobs = () => { const mouseX = useMotionValue(0); const mouseY = useMotionValue(0); const springConfig = { damping: 50, stiffness: 50, mass: 2 }; const springX = useSpring(mouseX, springConfig); const springY = useSpring(mouseY, springConfig); // Very subtle parallax offsets const x1 = useTransform(springX, (value) => value / 30); const y1 = useTransform(springY, (value) => value / 30); const x2 = useTransform(springX, (value) => value / -25); const y2 = useTransform(springY, (value) => value / -25); const x3 = useTransform(springX, (value) => value / 20); const y3 = useTransform(springY, (value) => value / 20); const x4 = useTransform(springX, (value) => value / -35); const y4 = useTransform(springY, (value) => value / -35); const x5 = useTransform(springX, (value) => value / 15); const y5 = useTransform(springY, (value) => value / 15); useEffect(() => { const handleMouseMove = (e: MouseEvent) => { const x = e.clientX - window.innerWidth / 2; const y = e.clientY - window.innerHeight / 2; mouseX.set(x); mouseY.set(y); }; window.addEventListener("mousemove", handleMouseMove); return () => window.removeEventListener("mousemove", handleMouseMove); }, [mouseX, mouseY]); // Prevent hydration mismatch const [mounted, setMounted] = useState(false); useEffect(() => { setMounted(true); }, []); if (!mounted) return null; return (