16 lines
430 B
JavaScript
16 lines
430 B
JavaScript
import { motion, useReducedMotion } from 'framer-motion';
|
|
|
|
export function PageTransition({ children }) {
|
|
const reduce = useReducedMotion();
|
|
return (
|
|
<motion.div
|
|
initial={reduce ? { opacity: 1 } : { opacity: 0, y: 8 }}
|
|
animate={{ opacity: 1, y: 0 }}
|
|
exit={reduce ? { opacity: 1 } : { opacity: 0, y: -8 }}
|
|
transition={{ duration: reduce ? 0 : 0.28 }}
|
|
>
|
|
{children}
|
|
</motion.div>
|
|
);
|
|
}
|