Triviaverse / src /components /layout /PageTransition.tsx
Simeon Garratt
feat: polish — page transitions, sound integration, screen shake, remaining files
6229f9b
Raw
History Blame Contribute Delete
618 Bytes
"use client";
import { motion } from "framer-motion";
/**
* Page transition wrapper that applies a subtle fade + slide
* animation when the component mounts or unmounts.
* Wrap the outermost content of each route page with this component.
*/
interface PageTransitionProps {
children: React.ReactNode;
}
export function PageTransition({ children }: PageTransitionProps) {
return (
<motion.div
initial={{ opacity: 0, y: 8 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: -8 }}
transition={{ duration: 0.2, ease: "easeOut" }}
>
{children}
</motion.div>
);
}