AutoLoop / components /page-transition.tsx
shubhjn's picture
Deploy Clean V1
8dd52b2
"use client";
import { useEffect } from "react";
import { usePathname } from "next/navigation";
import { gsap } from "gsap";
export function PageTransition({ children }: { children: React.ReactNode }) {
const pathname = usePathname();
useEffect(() => {
// Page enter animation
gsap.fromTo(
".page-content",
{
opacity: 0,
y: 20,
},
{
opacity: 1,
y: 0,
duration: 0.5,
ease: "power2.out",
}
);
}, [pathname]);
return <div className="page-content">{children}</div>;
}