29 lines
549 B
TypeScript
29 lines
549 B
TypeScript
"use client";
|
|
|
|
import { motion } from "framer-motion";
|
|
import type { ReactNode } from "react";
|
|
|
|
export function Reveal({
|
|
children,
|
|
delay = 0,
|
|
y = 22,
|
|
className,
|
|
}: {
|
|
children: ReactNode;
|
|
delay?: number;
|
|
y?: number;
|
|
className?: string;
|
|
}) {
|
|
return (
|
|
<motion.div
|
|
initial={{ opacity: 0, y }}
|
|
whileInView={{ opacity: 1, y: 0 }}
|
|
viewport={{ once: true, amount: 0.2 }}
|
|
transition={{ duration: 0.5, ease: [0.22, 1, 0.36, 1], delay }}
|
|
className={className}
|
|
>
|
|
{children}
|
|
</motion.div>
|
|
);
|
|
}
|