diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/Layout.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/components/Layout.js b/src/components/Layout.js new file mode 100644 index 00000000..eb4e8923 --- /dev/null +++ b/src/components/Layout.js @@ -0,0 +1,26 @@ +import { motion } from 'framer-motion'; + +export default function Layout({ children, pageProps }) { + const variants = { + hidden: { opacity: 0, x: -75, y: 0 }, + enter: { opacity: 1, x: 0, y: 0 }, + exit: { opacity: 0, x: 0, y: -50 }, + }; + + const transition = { + ease: 'linear', + duration: 0.2 + }; + + return children && ( + <motion.main + initial={{ opacity: 0, x: -75, y: 0 }} + animate={{ opacity: 1, x: 0, y: 0 }} + exit={{ opacity: 0, x: 0, y: -50 }} + transition={transition} + {...pageProps} + > + {children} + </motion.main> + ); +}
\ No newline at end of file |
