39246-vm/frontend/components/PageTransition.tsx
Flatlogic Bot 9df3e44fd0 V0.1
2026-03-20 06:34:08 +00:00

23 lines
646 B
TypeScript

"use client";
import { motion } from "framer-motion";
import { usePathname } from "next/navigation";
import { ReactNode } from "react";
export default function PageTransition({ children }: { children: ReactNode }) {
const pathname = usePathname();
return (
<motion.div
key={pathname}
initial={{ opacity: 0, y: 20, filter: 'blur(10px)' }}
animate={{ opacity: 1, y: 0, filter: 'blur(0px)' }}
exit={{ opacity: 0, y: -20, filter: 'blur(10px)' }}
transition={{ duration: 0.4, type: "spring" as const, bounce: 0.2 }}
className="flex-1 w-full flex flex-col"
>
{children}
</motion.div>
);
}