mirror of
https://github.com/timmypidashev/web.git
synced 2026-04-14 02:53:51 +00:00
Add page transitions
This commit is contained in:
@@ -6,6 +6,6 @@ import { HeroSection1, HeroSection2, HeroSection3 } from "@/components/hero";
|
||||
// Exports
|
||||
export default function Index() {
|
||||
return (
|
||||
<div></div>
|
||||
<div>Home</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
export default function Projects() {
|
||||
return (
|
||||
<div>
|
||||
projects
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
5
src/web/src/app/template.js
Normal file
5
src/web/src/app/template.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import PageTransition from "@/components/transitions";
|
||||
|
||||
export default function rootTemplate({ children }) {
|
||||
return <PageTransition>{children}</PageTransition>;
|
||||
}
|
||||
19
src/web/src/components/transitions.jsx
Normal file
19
src/web/src/components/transitions.jsx
Normal file
@@ -0,0 +1,19 @@
|
||||
"use client"
|
||||
|
||||
import { motion } from "framer-motion";
|
||||
|
||||
const PageTransition = ({ children }) => (
|
||||
<motion.div
|
||||
initial={{ x: 300, opacity: 0 }}
|
||||
animate={{ x: 0, opacity: 1 }}
|
||||
exit={{ x: 300, opacity: 0 }}
|
||||
transition={{
|
||||
type: "spring",
|
||||
stiffness: 260,
|
||||
damping: 20,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</motion.div>
|
||||
);
|
||||
export default PageTransition;
|
||||
Reference in New Issue
Block a user