Add three.js dep, update page transition animation

This commit is contained in:
Timothy Pidashev
2024-03-19 09:56:17 -07:00
parent b04cd10453
commit 2acb40c90c
3 changed files with 14 additions and 8 deletions

View File

@@ -13,7 +13,8 @@
"next-themes": "^0.3.0", "next-themes": "^0.3.0",
"react": "^18", "react": "^18",
"react-dom": "^18", "react-dom": "^18",
"react-icons": "^5.0.1" "react-icons": "^5.0.1",
"three": "^0.162.0"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "^10.4.18", "autoprefixer": "^10.4.18",
@@ -4516,6 +4517,11 @@
"node": ">=0.8" "node": ">=0.8"
} }
}, },
"node_modules/three": {
"version": "0.162.0",
"resolved": "https://registry.npmjs.org/three/-/three-0.162.0.tgz",
"integrity": "sha512-xfCYj4RnlozReCmUd+XQzj6/5OjDNHBy5nT6rVwrOKGENAvpXe2z1jL+DZYaMu4/9pNsjH/4Os/VvS9IrH7IOQ=="
},
"node_modules/to-regex-range": { "node_modules/to-regex-range": {
"version": "5.0.1", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",

View File

@@ -14,7 +14,8 @@
"next-themes": "^0.3.0", "next-themes": "^0.3.0",
"react": "^18", "react": "^18",
"react-dom": "^18", "react-dom": "^18",
"react-icons": "^5.0.1" "react-icons": "^5.0.1",
"three": "^0.162.0"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "^10.4.18", "autoprefixer": "^10.4.18",

View File

@@ -4,13 +4,12 @@ import { motion } from "framer-motion";
const PageTransition = ({ children }) => ( const PageTransition = ({ children }) => (
<motion.div <motion.div
initial={{ x: 300, opacity: 0 }} initial={{ opacity: 0 }}
animate={{ x: 0, opacity: 1 }} animate={{ opacity: 1 }}
exit={{ x: 300, opacity: 0 }} exit={{ opacity: 0 }}
transition={{ transition={{
type: "spring", type: "tween",
stiffness: 260, duration: 0.5, // You can adjust the duration as needed
damping: 20,
}} }}
> >
{children} {children}