mirror of
https://github.com/timmypidashev/web.git
synced 2026-04-14 11:03:50 +00:00
Add page transitions
This commit is contained in:
@@ -6,6 +6,6 @@ import { HeroSection1, HeroSection2, HeroSection3 } from "@/components/hero";
|
|||||||
// Exports
|
// Exports
|
||||||
export default function Index() {
|
export default function Index() {
|
||||||
return (
|
return (
|
||||||
<div></div>
|
<div>Home</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
export default function Projects() {
|
export default function Projects() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
projects
|
||||||
</div>
|
</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