summaryrefslogtreecommitdiff
path: root/src/components/Layout.js
blob: eb4e89233dbe99ca1dcae9d91df6e148222ea5e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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>
  );
}