From 40bab7be1e0025c7c089e1eac17451ef155a989a Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Sat, 19 Nov 2022 13:55:00 +0700 Subject: Add page transition --- src/components/Layout.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/components/Layout.js (limited to 'src/components') 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 && ( + + {children} + + ); +} \ No newline at end of file -- cgit v1.2.3