Files
CVault/vault/components/page-transition.tsx
T
arsam 65b42a0683 Import source: vault/components/page-transition
Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
2026-09-18 23:17:46 +03:30

29 lines
655 B
TypeScript

"use client";
import { AnimatePresence, motion } from "framer-motion";
import { usePathname } from "next/navigation";
import { ReactNode } from "react";
export function PageTransition({ children }: { children: ReactNode }) {
const pathname = usePathname();
return (
<AnimatePresence mode="wait">
<motion.div
key={pathname}
initial={false}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: -12 }}
transition={{
type: "spring",
stiffness: 260,
damping: 25,
mass: 0.8,
}}
>
{children}
</motion.div>
</AnimatePresence>
);
}