23 lines
654 B
TypeScript
23 lines
654 B
TypeScript
import { type HTMLAttributes, type ReactNode } from "react";
|
|
import AnimatedDiv from "./AnimatedDiv";
|
|
import { cn } from "~/lib/utils";
|
|
const AnimatePopUp = ({
|
|
children,
|
|
position,
|
|
className,
|
|
duration=1,
|
|
ease='elastic'
|
|
}:{
|
|
children:ReactNode
|
|
position:gsap.Position,
|
|
className?:HTMLAttributes<HTMLDivElement>['className']
|
|
duration?:number,
|
|
ease?:gsap.EaseString|gsap.EaseFunction
|
|
}) => {
|
|
return (
|
|
<AnimatedDiv children={children} position={position} className={cn(className,'h-0 translate-y-[50] overflow-hidden')} height='auto' y={0} overflow='' ease={ease} duration={duration} />
|
|
)
|
|
}
|
|
|
|
export default AnimatePopUp;
|