24 lines
523 B
TypeScript
24 lines
523 B
TypeScript
"use client";
|
|
|
|
import { motion } from "framer-motion";
|
|
|
|
interface FadeInProps {
|
|
children: React.ReactNode;
|
|
className?: string;
|
|
delay?: number;
|
|
}
|
|
|
|
export function FadeIn({ children, className = "", delay = 0 }: FadeInProps) {
|
|
return (
|
|
<motion.div
|
|
initial={{ opacity: 0, y: 20 }}
|
|
whileInView={{ opacity: 1, y: 0 }}
|
|
viewport={{ once: true, margin: "-50px" }}
|
|
transition={{ duration: 0.5, delay, ease: "easeOut" }}
|
|
className={className}
|
|
>
|
|
{children}
|
|
</motion.div>
|
|
);
|
|
}
|