diff --git a/src/App.tsx b/src/App.tsx index 4aa38d7..652d1ae 100755 --- a/src/App.tsx +++ b/src/App.tsx @@ -12,190 +12,201 @@ import "@/styles/protofox-theme.css"; // EndOS animation control const useEndOSAnimation = () => { - const [bootComplete, setBootComplete] = useState(false); - const [skipBoot] = useState(() => { - const urlParams = new URLSearchParams(window.location.search); - const skipParam = urlParams.get("skipBoot"); - const sessionSeen = - sessionStorage.getItem("endos-boot-complete") === "true"; + const [bootComplete, setBootComplete] = useState(false); + const [skipBoot] = useState(() => { + const urlParams = new URLSearchParams(window.location.search); + const skipParam = urlParams.get("skipBoot"); + const sessionSeen = + sessionStorage.getItem("endos-boot-complete") === "true"; - return skipParam === "true" || sessionSeen; - }); + return skipParam === "true" || sessionSeen; + }); - const handleBootComplete = () => { - setBootComplete(true); - sessionStorage.setItem("endos-boot-complete", "true"); - }; + const handleBootComplete = () => { + setBootComplete(true); + sessionStorage.setItem("endos-boot-complete", "true"); + }; - return { bootComplete, skipBoot, handleBootComplete }; + return { bootComplete, skipBoot, handleBootComplete }; }; // AuthChecker component to access auth context inside the router const AuthChecker = ({ children }: { children: React.ReactNode }) => { - const auth = useAuth(); - const [isStatusVisible, setIsStatusVisible] = useState(false); + const auth = useAuth(); + const [isStatusVisible, setIsStatusVisible] = useState(false); - const toggleStatus = () => { - setIsStatusVisible((prev) => !prev); - }; + const toggleStatus = () => { + setIsStatusVisible((prev) => !prev); + }; - return ( - <> - {children} + return ( + <> + {children} - {auth.isAuthenticated && ( -
-
- - {isStatusVisible ? "Hide System Status" : "System Status"} - -
-
- )} - - ); + {auth.isAuthenticated && ( +
+
+ + {isStatusVisible + ? "Hide System Status" + : "System Status"} + +
+
+ )} + + ); }; const App = () => { - const [isGameActive, setIsGameActive] = useState(false); - const { bootComplete, skipBoot, handleBootComplete } = useEndOSAnimation(); + const [isGameActive, setIsGameActive] = useState(false); + const { bootComplete, skipBoot, handleBootComplete } = useEndOSAnimation(); - useEffect(() => { - // Konami code sequence - const konamiCode = [ - "ArrowUp", - "ArrowUp", - "ArrowDown", - "ArrowDown", - "ArrowLeft", - "ArrowRight", - "ArrowLeft", - "ArrowRight", - "b", - "a", - ]; - let index = 0; + useEffect(() => { + // Konami code sequence + const konamiCode = [ + "ArrowUp", + "ArrowUp", + "ArrowDown", + "ArrowDown", + "ArrowLeft", + "ArrowRight", + "ArrowLeft", + "ArrowRight", + "b", + "a", + ]; + let index = 0; - const handleKeydown = (event: KeyboardEvent) => { - if (event.key === konamiCode[index]) { - index++; + const handleKeydown = (event: KeyboardEvent) => { + if (event.key === konamiCode[index]) { + index++; - if (index === konamiCode.length) { - setIsGameActive(true); - console.log("Konami code activated!"); - } - } else { - index = 0; - } - }; + if (index === konamiCode.length) { + setIsGameActive(true); + console.log("Konami code activated!"); + } + } else { + index = 0; + } + }; - window.addEventListener("keydown", handleKeydown); + window.addEventListener("keydown", handleKeydown); - return () => window.removeEventListener("keydown", handleKeydown); - }, []); + return () => window.removeEventListener("keydown", handleKeydown); + }, []); - return ( - - {/* EndOS Boot Animation */} - {!skipBoot && !bootComplete && ( - - )} + return ( + + {/* EndOS Boot Animation */} + {!skipBoot && !bootComplete && ( + + )} - {/* Main Application - Only visible after boot animation completes */} -
- - + {/* Main Application - Only visible after boot animation completes */}
- {/* Background Logo */} -
-
- Background Logo -
-
+ + +
+ {/* Background Logo */} +
+
+ Background Logo +
+
- {/* Main Content */} -
- + {/* Main Content */} +
+ - {/* Theme Toggle */} -
- -
+ {/* Theme Toggle */} +
+ +
-
- - } /> - } /> - -

- 404: Page Not Found -

-

- This fox couldn't find what you're looking for. -

+
+ + } + /> + } + /> + +

+ 404: Page Not Found +

+

+ This fox couldn't find + what you're looking for. +

+
+ } + /> + + + + {/* Footer */} +
+

+ © 2023 - {new Date().getFullYear()}{" "} + EndofTimee. All rights reserved. +

+
+ + Try the Konami code: ↑↑↓↓←→←→BA + +
+ v0.9.5 +
+
+
+
+ + {/* Fox Game Overlay - Activated by Konami Code */} + {isGameActive && ( + <> + + + + )}
- } - /> - - - - {/* Footer */} -
-

- © 2023 - {new Date().getFullYear()} EndofTimee. All rights - reserved. -

-
- - Try the Konami code: ↑↑↓↓←→←→BA - -
- v0.9.5 -
-
-
-
- - {/* Fox Game Overlay - Activated by Konami Code */} - {isGameActive && ( - <> - - - - )} +
+
- - - -
- ); +
+ ); }; export default App; diff --git a/src/reportWebVitals.tsx b/src/reportWebVitals.tsx index 885e293..5e09d85 100755 --- a/src/reportWebVitals.tsx +++ b/src/reportWebVitals.tsx @@ -1,20 +1,20 @@ import type { Metric } from "web-vitals"; const reportWebVitals = (onPerfEntry?: (metric: Metric) => void): void => { - if (onPerfEntry && typeof onPerfEntry === "function") { - import("web-vitals") - .then((vitals) => { - const { onCLS, onFID, onFCP, onLCP, onTTFB } = vitals; - onCLS(onPerfEntry); - onFID(onPerfEntry); - onFCP(onPerfEntry); - onLCP(onPerfEntry); - onTTFB(onPerfEntry); - }) - .catch((error) => { - console.error("Error loading web-vitals:", error); - }); - } + if (onPerfEntry && typeof onPerfEntry === "function") { + import("web-vitals") + .then((vitals) => { + const { onCLS, onFID, onFCP, onLCP, onTTFB } = vitals; + onCLS(onPerfEntry); + onFID(onPerfEntry); + onFCP(onPerfEntry); + onLCP(onPerfEntry); + onTTFB(onPerfEntry); + }) + .catch((error) => { + console.error("Error loading web-vitals:", error); + }); + } }; export default reportWebVitals;