Initial commit
This commit is contained in:
15
src_frontend_orig/components/PageTransition.jsx
Normal file
15
src_frontend_orig/components/PageTransition.jsx
Normal file
@@ -0,0 +1,15 @@
|
||||
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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user