29 lines
550 B
TypeScript
29 lines
550 B
TypeScript
|
|
'use client';
|
||
|
|
|
||
|
|
import { motion } from 'framer-motion';
|
||
|
|
import { ReactNode } from 'react';
|
||
|
|
|
||
|
|
export function ScrollReveal({
|
||
|
|
children,
|
||
|
|
delay = 0,
|
||
|
|
y = 28,
|
||
|
|
className = '',
|
||
|
|
}: {
|
||
|
|
children: ReactNode;
|
||
|
|
delay?: number;
|
||
|
|
y?: number;
|
||
|
|
className?: string;
|
||
|
|
}) {
|
||
|
|
return (
|
||
|
|
<motion.div
|
||
|
|
initial={{ opacity: 0, y }}
|
||
|
|
whileInView={{ opacity: 1, y: 0 }}
|
||
|
|
viewport={{ once: true, margin: '-60px' }}
|
||
|
|
transition={{ duration: 0.6, delay, ease: 'easeOut' }}
|
||
|
|
className={className}
|
||
|
|
>
|
||
|
|
{children}
|
||
|
|
</motion.div>
|
||
|
|
);
|
||
|
|
}
|