@@ -3,16 +3,18 @@ import { useLocation, useNavigate } from "react-router-dom";
33import "./styles/LandingPage.css" ;
44import LandingPageLink from "./LandingPageLink" ;
55import { animated , useTransition } from "react-spring" ;
6- import HomeView from "./HomeView" ;
76import AuthContext from "../contexts/AuthContext" ;
87import pixelBG from "../img/pixelBG_LowRes.png" ;
98import pixelFadeBG from "../img/animated-14fps.png" ;
109import AppContext from "../contexts/AppContext" ;
1110import AppConfig from "../AppConfig.json" ;
1211
13- interface Props { }
12+ interface Props {
13+ setIsLanding : React . Dispatch < React . SetStateAction < boolean > > ;
14+ setParamsArray : React . Dispatch < React . SetStateAction < string > > [ ] ;
15+ }
1416
15- const LandingPage = ( { } : Props ) => {
17+ const LandingPage = ( { setIsLanding , setParamsArray } : Props ) => {
1618 // - - - - - LINK FUNCTIONALITY - - - - -
1719 const [ currentDisplay , setCurrentDisplay ] = useState < string > ( "" ) ;
1820 const [ firstRender , setFirstRender ] = useState < boolean > ( true ) ;
@@ -58,13 +60,14 @@ const LandingPage = ({}: Props) => {
5860 setFirstRender ( false ) ;
5961 } else if (
6062 // If current path is 'complete', transition to HomeView
61- currentPath . endsWith ( "/portfolio " ) ||
62- currentPath . endsWith ( "/blog " )
63+ currentPath . endsWith ( "/gamedev " ) ||
64+ currentPath . endsWith ( "/webdev " )
6365 ) {
6466 setCurrBG ( pixelFadeBG ) ;
6567 setIsActivePage ( false ) ;
6668 setHideHV ( "" ) ;
67- setTimeout ( ( ) => setHideLP ( "hide" ) , 2000 ) ;
69+ setTimeout ( ( ) => setIsLanding ( false ) , 1500 ) ;
70+ setParamsArray [ 0 ] ( "home" ) ;
6871 setHueDuration ( AppConfig . hueAnimDuration_Slow ) ;
6972 }
7073
@@ -77,24 +80,27 @@ const LandingPage = ({}: Props) => {
7780 setHueDuration ( 4000 ) ;
7881 } else if ( currentPath === "/landing" ) {
7982 setCurrentDisplay ( "jakesnyder.dev" ) ;
80- setLink1Text ( "Web Dev" ) ;
81- setLink1Path ( "/landing/webdev" ) ;
82- setLink2Text ( "Game Dev" ) ;
83- setLink2Path ( "/landing/gamedev" ) ;
84- setHueDuration ( AppConfig . hueAnimDuration ) ;
85- } else if ( currentPath === "/landing/webdev" ) {
86- setCurrentDisplay ( "Web Development" ) ;
83+ setParamsArray [ 0 ] ( "landing" ) ;
8784 setLink1Text ( "Portfolio" ) ;
88- setLink1Path ( "/landing/webdev/ portfolio" ) ;
85+ setLink1Path ( "/landing/portfolio" ) ;
8986 setLink2Text ( "Blog" ) ;
90- setLink2Path ( "/landing/webdev/ blog" ) ;
87+ setLink2Path ( "/landing/blog" ) ;
9188 setHueDuration ( AppConfig . hueAnimDuration ) ;
92- } else if ( currentPath === "/landing/gamedev" ) {
93- setCurrentDisplay ( "Game Development" ) ;
94- setLink1Text ( "Portfolio" ) ;
95- setLink1Path ( "/landing/webdev/portfolio" ) ;
96- setLink2Text ( "Blog" ) ;
97- setLink2Path ( "/landing/gamedev/blog" ) ;
89+ } else if ( currentPath === "/landing/portfolio" ) {
90+ setParamsArray [ 1 ] ( "portfolio" ) ;
91+ setCurrentDisplay ( "Portfolio" ) ;
92+ setLink1Text ( "Web Dev" ) ;
93+ setLink1Path ( "/landing/portfolio/webdev" ) ;
94+ setLink2Text ( "Game Dev" ) ;
95+ setLink2Path ( "/landing/portfolio/gamedev" ) ;
96+ setHueDuration ( AppConfig . hueAnimDuration ) ;
97+ } else if ( currentPath === "/landing/blog" ) {
98+ setParamsArray [ 1 ] ( "blog" ) ;
99+ setCurrentDisplay ( "Blog" ) ;
100+ setLink1Text ( "Web Dev" ) ;
101+ setLink1Path ( "/landing/blog/webdev" ) ;
102+ setLink2Text ( "Game Dev" ) ;
103+ setLink2Path ( "/landing/blog/gamedev" ) ;
98104 setHueDuration ( AppConfig . hueAnimDuration ) ;
99105 }
100106 } , [ currentPath ] ) ;
@@ -146,9 +152,6 @@ const LandingPage = ({}: Props) => {
146152 />
147153 </ div >
148154 </ div >
149- < div className = { `HomeView-ctr ${ hideHV } ` } >
150- < HomeView />
151- </ div >
152155 </ div >
153156 ) ;
154157} ;
0 commit comments