diff --git a/src/App.css b/src/App.css index 74b5e05..4931613 100644 --- a/src/App.css +++ b/src/App.css @@ -1,38 +1,3 @@ .App { text-align: center; } - -.App-logo { - height: 40vmin; - pointer-events: none; -} - -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} diff --git a/src/App.tsx b/src/App.tsx index 00130b8..1e9a806 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -10,9 +10,10 @@ function App() { } /> } /> - } /> - } /> - } /> + } /> + } /> + } /> + } /> diff --git a/src/components/HomeView.css b/src/components/HomeView.css index 0bb4ec5..b4a3f52 100644 --- a/src/components/HomeView.css +++ b/src/components/HomeView.css @@ -1,4 +1,5 @@ .HomeView { + position: absolute; display: flex; flex-direction: column; justify-content: center; diff --git a/src/components/LandingPage.css b/src/components/LandingPage.css index c462fa0..00f13c7 100644 --- a/src/components/LandingPage.css +++ b/src/components/LandingPage.css @@ -14,9 +14,6 @@ box-sizing: border-box; height: 100vh; width: 100vw; - background-image: url("/src/img/pixelBGWide.png"); - background-position: center; - background-size: cover; /* font-family: "VT323", monospace; */ font-family: "munro"; font-weight: 400; @@ -36,8 +33,11 @@ align-items: center; justify-content: center; box-sizing: border-box; + margin-bottom: 0%; width: 100%; - margin-bottom: 50px; + background-image: url("/src/img/pixelBGWide.png"); + background-origin: content-box; + background-size: auto 100vh; } .LandingPage .link-container { @@ -48,6 +48,10 @@ box-sizing: border-box; /* margin-top: 80px; */ width: 100%; + background-image: url("/src/img/pixelBGWide.png"); + background-origin: content-box; + background-size: auto 100vh; + background-position: 0% -100%; } .LandingPage .lp-link h1, diff --git a/src/components/LandingPage.tsx b/src/components/LandingPage.tsx index 14b8fe3..6bd25fd 100644 --- a/src/components/LandingPage.tsx +++ b/src/components/LandingPage.tsx @@ -2,7 +2,8 @@ import { useEffect, useState } from "react"; import { useLocation, useNavigate } from "react-router-dom"; import "./LandingPage.css"; import LandingPageLink from "./LandingPageLink"; -import { animated } from "react-spring"; +import { animated, useTransition } from "react-spring"; +import HomeView from "./HomeView"; const LandingPage = () => { // - - - - - STATES / FUNCTIONALITY - - - - - @@ -15,19 +16,48 @@ const LandingPage = () => { const [link2Path, setLink2Path] = useState(""); const currentPath = useLocation().pathname; const navigate = useNavigate(); - // const transitionUp = useTransition(isActivePage, { - // initial: {}, - // // from: { opacity: 1, transform: "translate(0,0)" }, - // // leave: { opacity: 1, transform: "translate(0,100%)" }, - // }); + const transDuration = 200; + const transitionUp = useTransition(isActivePage, { + initial: { + opacity: 1, + marginBottom: "0%", + config: { duration: transDuration }, + }, + from: { + opacity: 1, + marginBottom: "0%", + config: { duration: transDuration }, + }, + leave: { + opacity: 0.5, + marginBottom: "100%", + config: { duration: transDuration }, + }, + }); + const transitionDown = useTransition(isActivePage, { + initial: { + opacity: 1, + marginTop: "0%", + config: { duration: transDuration }, + }, + from: { opacity: 1, marginTop: "0%", config: { duration: transDuration } }, + leave: { + opacity: 0.5, + marginTop: "100%", + config: { duration: transDuration }, + }, + }); useEffect(() => { if (firstRender) { setFirstRender(false); - } else { + } else if ( + currentPath.endsWith("/gamedev") || + currentPath.endsWith("/webdev") + ) { setIsActivePage(false); } - }, []); + }, [currentPath]); useEffect(() => { if (currentPath === "/") { @@ -41,45 +71,59 @@ const LandingPage = () => { } else if (currentPath === "/landing/portfolio") { setCurrentDisplay("Portfolio"); setLink1Text("Web Dev"); - setLink1Path("/home/portfolio/webdev"); + setLink1Path("/landing/portfolio/webdev"); setLink2Text("Game Dev"); - setLink2Path("/home/portfolio/gamedev"); + setLink2Path("/landing/portfolio/gamedev"); } else if (currentPath === "/landing/blog") { setCurrentDisplay("Blog"); setLink1Text("Web Dev"); - setLink1Path("/home/blog/webdev"); + setLink1Path("/landing/blog/webdev"); setLink2Text("Game Dev"); - setLink2Path("/home/blog/gamedev"); + setLink2Path("/landing/blog/gamedev"); + } else if (currentPath === "/home/:location/:content") { + console.log("made it here"); } }, [currentPath]); return (
- - - - - - - + {transitionUp((style, item) => + item ? ( + + + + ) : ( + + ) + )} + {transitionDown((style, item) => + item ? ( + + + + + ) : ( + "" + ) + )}
); }; diff --git a/src/img/pixelBGWide.png b/src/img/pixelBGWide.png deleted file mode 100644 index 2be9887..0000000 Binary files a/src/img/pixelBGWide.png and /dev/null differ