Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -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);
}
}
7 changes: 4 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ function App() {
<Routes>
<Route path="/" element={<LandingPage />} />
<Route path="/landing" element={<LandingPage />} />
<Route path="/landing/:links" element={<LandingPage />} />
<Route path="/home" element={<HomeView />} />
<Route path="/home/:location/:content" element={<HomeView />} />
<Route path="/landing/:location" element={<LandingPage />} />
<Route path="/landing/:location/:content" element={<LandingPage />} />
<Route path="/home" element={<LandingPage />} />
<Route path="/home/:location/:content" element={<LandingPage />} />
</Routes>
</Router>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/HomeView.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.HomeView {
position: absolute;
display: flex;
flex-direction: column;
justify-content: center;
Expand Down
12 changes: 8 additions & 4 deletions src/components/LandingPage.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand All @@ -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,
Expand Down
118 changes: 81 additions & 37 deletions src/components/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 - - - - -
Expand All @@ -15,19 +16,48 @@ const LandingPage = () => {
const [link2Path, setLink2Path] = useState<string>("");
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 === "/") {
Expand All @@ -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 (
<div className="LandingPage">
<animated.div className={"header-container"}>
<LandingPageLink
currentDisplay={currentDisplay}
linkText={currentDisplay}
pathName={"/"}
className={"lp-link"}
isH1={true}
/>
</animated.div>
<animated.div className="link-container">
<LandingPageLink
currentDisplay={currentDisplay}
linkText={link1Text}
pathName={link1Path}
className={"lp-link"}
isH1={false}
/>
<LandingPageLink
currentDisplay={currentDisplay}
linkText={link2Text}
pathName={link2Path}
className={"lp-link"}
isH1={false}
/>
</animated.div>
{transitionUp((style, item) =>
item ? (
<animated.div className={"header-container"} style={style}>
<LandingPageLink
currentDisplay={currentDisplay}
linkText={currentDisplay}
pathName={"/"}
className={"lp-link"}
isH1={true}
/>
</animated.div>
) : (
<HomeView />
)
)}
{transitionDown((style, item) =>
item ? (
<animated.div className="link-container" style={style}>
<LandingPageLink
currentDisplay={currentDisplay}
linkText={link1Text}
pathName={link1Path}
className={"lp-link"}
isH1={false}
/>
<LandingPageLink
currentDisplay={currentDisplay}
linkText={link2Text}
pathName={link2Path}
className={"lp-link"}
isH1={false}
/>
</animated.div>
) : (
""
)
)}
</div>
);
};
Expand Down
Binary file removed src/img/pixelBGWide.png
Binary file not shown.