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
4 changes: 4 additions & 0 deletions src/AppConfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"hueAnimDuration": 4000,
"hueAnimDuration_Slow": 10000
}
8 changes: 4 additions & 4 deletions src/components/HomeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ import { useContext, useEffect, useState } from "react";
import HomeViewHeader from "./HomeViewHeader";
import HomeViewFooter from "./HomeViewFooter";
import HomeViewContent from "./HomeViewContent";
import { SpringValue } from "react-spring";
import StyleContext from "../contexts/StyleContext";
import AppConfig from "../AppConfig.json";

interface Props {}

const HomeView = ({}: Props) => {
// - - - - GENERAL STATES - - - -
const [firstRender, setFirstRender] = useState<boolean>(true);
const { hueRotation, setHueDuration } = useContext(StyleContext);
// - - - - - TITLES AND TEXT - - - - -
const [currentProject, setCurrentProject] = useState<string>("Deerfall");
Expand Down Expand Up @@ -74,9 +73,10 @@ const HomeView = ({}: Props) => {
} else if (currentPath.includes("/webdev/")) {
setCurrentProject(webDevProjList[0]);
}
console.log(currentPath);

// setHueDuration(12000);
if (hueRotation != AppConfig.hueAnimDuration_Slow) {
setHueDuration(AppConfig.hueAnimDuration_Slow);
}
}, [currentPath]);

return (
Expand Down
7 changes: 5 additions & 2 deletions src/components/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import pixelBG from "../img/pixelBG_LowRes.png";
import pixelFadeBG from "../img/animated-14fps.png";
import PersonalIntro from "./PersonalIntro";
import StyleContext from "../contexts/StyleContext";
import AppConfig from "../AppConfig.json";

interface Props {}

Expand Down Expand Up @@ -65,7 +66,7 @@ const LandingPage = ({}: Props) => {
setIsActivePage(false);
setHideHV("");
setTimeout(() => setHideLP("hide"), 2000);
setHueDuration(12000);
setHueDuration(AppConfig.hueAnimDuration_Slow);
}

if (currentPath === "/") {
Expand All @@ -81,19 +82,21 @@ const LandingPage = ({}: Props) => {
setLink1Path("/landing/webdev");
setLink2Text("Game Dev");
setLink2Path("/landing/gamedev");
setHueDuration(4000);
setHueDuration(AppConfig.hueAnimDuration);
} else if (currentPath === "/landing/webdev") {
setCurrentDisplay("Web Development");
setLink1Text("Portfolio");
setLink1Path("/landing/webdev/portfolio");
setLink2Text("Blog");
setLink2Path("/landing/webdev/blog");
setHueDuration(AppConfig.hueAnimDuration);
} else if (currentPath === "/landing/gamedev") {
setCurrentDisplay("Game Development");
setLink1Text("Portfolio");
setLink1Path("/landing/webdev/portfolio");
setLink2Text("Blog");
setLink2Path("/landing/gamedev/blog");
setHueDuration(AppConfig.hueAnimDuration);
}
}, [currentPath]);

Expand Down
5 changes: 4 additions & 1 deletion src/contexts/StyleContextProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import StyleContext from "./StyleContext";
import { ReactNode, useEffect, useState } from "react";
import { useSpring } from "react-spring";
import AppConfig from "../AppConfig.json";

interface Props {
children: ReactNode;
Expand All @@ -12,7 +13,9 @@ const StyleContextProvider = ({ children }: Props) => {

// ANIMATIONS / REACT SPRING
const [bgAnimOff, setBgAnimOff] = useState<boolean>(false);
const [hueDuration, setHueDuration] = useState<number>(4000);
const [hueDuration, setHueDuration] = useState<number>(
AppConfig.hueAnimDuration
);
const hueRotation = useSpring({
loop: { reverse: true, config: { duration: hueDuration } },
delay: 1000,
Expand Down