"use client"; import React from "react"; import { motion, type Variants } from "framer-motion"; import { cn } from "@/lib/utils"; interface ScrollRevealProps { children: React.ReactNode; className?: string; delay?: number; direction?: "up" | "down" | "left" | "right" | "none"; duration?: number; once?: boolean; } export function ScrollReveal({ children, className, delay = 0, direction = "up", duration = 0.7, once = true, }: ScrollRevealProps) { const directionOffset = { up: { y: 40, x: 0 }, down: { y: -40, x: 0 }, left: { x: 40, y: 0 }, right: { x: -40, y: 0 }, none: { x: 0, y: 0 }, }; const variants: Variants = { hidden: { opacity: 0, ...directionOffset[direction], }, visible: { opacity: 1, x: 0, y: 0, transition: { duration, delay, ease: [0.22, 1, 0.36, 1], }, }, }; return ( {children} ); }