25 lines
534 B
TypeScript
25 lines
534 B
TypeScript
"use client";
|
|
|
|
import { motion } from "motion/react";
|
|
import type { ReactNode } from "react";
|
|
|
|
interface RevealProps {
|
|
children: ReactNode;
|
|
className?: string;
|
|
delay?: number;
|
|
}
|
|
|
|
export function Reveal({ children, className, delay = 0 }: RevealProps) {
|
|
return (
|
|
<motion.div
|
|
className={className}
|
|
initial={{ opacity: 0, y: 24 }}
|
|
whileInView={{ opacity: 1, y: 0 }}
|
|
viewport={{ once: true, margin: "-50px" }}
|
|
transition={{ duration: 0.45, delay, ease: [0.25, 0.1, 0.25, 1] }}
|
|
>
|
|
{children}
|
|
</motion.div>
|
|
);
|
|
}
|