Files
loyalyweb/src/components/GSAPReveal.tsx
2026-06-29 18:07:43 +05:30

29 lines
726 B
TypeScript

'use client';
import React from 'react';
import { useGSAPReveal, RevealAnimation } from '@/hooks/useGSAPReveal';
interface Props {
children: React.ReactNode;
delay?: number;
animation?: RevealAnimation;
duration?: number;
ease?: string;
start?: string;
className?: string;
style?: React.CSSProperties;
as?: keyof React.JSX.IntrinsicElements;
}
export default function GSAPReveal({
children, delay = 0, animation = 'fade-up',
duration = 1.0, ease, start, className, style,
}: Props) {
const ref = useGSAPReveal({ delay, animation, duration, ease, start });
return (
<div ref={ref} className={className} style={{ willChange: 'transform, opacity', ...style }}>
{children}
</div>
);
}