|
1 | 1 | import "./App.css"; |
2 | | -import { |
3 | | - BrowserRouter as Router, |
4 | | - Route, |
5 | | - Routes, |
6 | | - useLocation, |
7 | | -} from "react-router-dom"; |
| 2 | +import { BrowserRouter as Router, Route, Routes } from "react-router-dom"; |
8 | 3 | import LandingPage from "./components/LandingPage"; |
9 | 4 | import HomeView from "./components/HomeView"; |
10 | 5 | import { useSpring } from "react-spring"; |
11 | 6 | import { useState } from "react"; |
12 | 7 | import WIPDisclaimer from "./components/WIPDisclaimer"; |
13 | 8 |
|
14 | 9 | function App() { |
15 | | - const [hueFlip, setHueFlip] = useState<boolean>(false); |
16 | | - const [bgAnimOff, setBgAnimOff] = useState<boolean>(false); |
17 | | - const [hueDuration, setHueDuration] = useState<number>(4000); |
18 | | - const hueRotation = useSpring({ |
19 | | - to: { |
20 | | - filter: "hue-rotate(130deg) saturate(80%) sepia(30%)", |
21 | | - }, |
22 | | - from: { |
23 | | - filter: "hue-rotate(0deg) saturate(100%) sepia(0%)", |
24 | | - }, |
25 | | - reset: false, |
26 | | - cancel: bgAnimOff, |
27 | | - reverse: hueFlip, |
28 | | - delay: 1000, |
29 | | - config: { duration: hueDuration, tension: 280, friction: 60 }, |
30 | | - onRest: () => setHueFlip(!hueFlip), |
31 | | - }); |
32 | | - |
33 | 10 | return ( |
34 | 11 | <div className='App'> |
35 | 12 | <Router> |
36 | 13 | <Routes> |
37 | | - <Route |
38 | | - path='/' |
39 | | - element={ |
40 | | - <LandingPage |
41 | | - hueRotation={hueRotation} |
42 | | - setHueDuration={setHueDuration} |
43 | | - /> |
44 | | - } |
45 | | - /> |
46 | | - <Route |
47 | | - path='/landing' |
48 | | - element={ |
49 | | - <LandingPage |
50 | | - hueRotation={hueRotation} |
51 | | - setHueDuration={setHueDuration} |
52 | | - /> |
53 | | - } |
54 | | - /> |
55 | | - <Route |
56 | | - path='/landing/:location' |
57 | | - element={ |
58 | | - <LandingPage |
59 | | - hueRotation={hueRotation} |
60 | | - setHueDuration={setHueDuration} |
61 | | - /> |
62 | | - } |
63 | | - /> |
64 | | - <Route |
65 | | - path='/landing/:category/:content' |
66 | | - element={ |
67 | | - <LandingPage |
68 | | - hueRotation={hueRotation} |
69 | | - setHueDuration={setHueDuration} |
70 | | - /> |
71 | | - } |
72 | | - /> |
| 14 | + <Route path='/' element={<LandingPage />} /> |
| 15 | + <Route path='/landing' element={<LandingPage />} /> |
| 16 | + <Route path='/landing/:location' element={<LandingPage />} /> |
| 17 | + <Route path='/landing/:category/:content' element={<LandingPage />} /> |
73 | 18 | <Route |
74 | 19 | path='/landing/:category/:content/:project' |
75 | | - element={ |
76 | | - <LandingPage |
77 | | - hueRotation={hueRotation} |
78 | | - setHueDuration={setHueDuration} |
79 | | - /> |
80 | | - } |
81 | | - /> |
82 | | - <Route |
83 | | - path='/home' |
84 | | - element={ |
85 | | - <HomeView |
86 | | - hueRotation={hueRotation} |
87 | | - setHueDuration={setHueDuration} |
88 | | - /> |
89 | | - } |
90 | | - /> |
91 | | - <Route |
92 | | - path='/home/:category/:content' |
93 | | - element={ |
94 | | - <HomeView |
95 | | - hueRotation={hueRotation} |
96 | | - setHueDuration={setHueDuration} |
97 | | - /> |
98 | | - } |
| 20 | + element={<LandingPage />} |
99 | 21 | /> |
| 22 | + <Route path='/home' element={<HomeView />} /> |
| 23 | + <Route path='/home/:category/:content' element={<HomeView />} /> |
100 | 24 | <Route |
101 | 25 | path='/home/:category/:content/:project' |
102 | | - element={ |
103 | | - <HomeView |
104 | | - hueRotation={hueRotation} |
105 | | - setHueDuration={setHueDuration} |
106 | | - /> |
107 | | - } |
| 26 | + element={<HomeView />} |
108 | 27 | /> |
109 | 28 | </Routes> |
110 | 29 | </Router> |
|
0 commit comments