27 lines
598 B
TypeScript
27 lines
598 B
TypeScript
"use client";
|
|
|
|
import { motion } from "framer-motion";
|
|
import type { ReactNode } from "react";
|
|
|
|
import { cn } from "@/lib/utils";
|
|
|
|
type MotionFadeProps = {
|
|
children: ReactNode;
|
|
className?: string;
|
|
delay?: number;
|
|
};
|
|
|
|
export function MotionFade({ children, className, delay = 0 }: MotionFadeProps) {
|
|
return (
|
|
<motion.div
|
|
initial={{ opacity: 0, y: 20 }}
|
|
whileInView={{ opacity: 1, y: 0 }}
|
|
viewport={{ once: true, amount: 0.2 }}
|
|
transition={{ duration: 0.45, delay, ease: "easeOut" }}
|
|
className={cn(className)}
|
|
>
|
|
{children}
|
|
</motion.div>
|
|
);
|
|
}
|