diff --git a/src/assets/main.css b/src/assets/main.css index 2451418..66aba14 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -6,7 +6,6 @@ body { font-family: 'Pathway Gothic One', sans-serif; - overflow: hidden; ::-webkit-scrollbar { width:50px; diff --git a/src/components/FantasyStatus.tsx b/src/components/FantasyStatus.tsx index 41f684e..7ae3f86 100644 --- a/src/components/FantasyStatus.tsx +++ b/src/components/FantasyStatus.tsx @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; -import PlayerCell from "./fantasy/PlayerCell"; import { type NFLAPIData, type NFLMatchupState } from "../utils/types"; +import { TeamRow } from "./fantasy/TeamRow"; export default function FantasyStatus() { const [personalRoster, setPersonalRoster] = useState( @@ -35,58 +35,18 @@ export default function FantasyStatus() { }, []); return ( -
+
-

Fantasy

+

fantasy

-
- -

- {personalRoster?.owner.metadata.team_name} |{" "} - {personalRoster?.points} -

-
-
- {personalRoster?.starters.map((v, k) => { - return ( -
- -
- ); - })} -
- -
- -

- {opposingRoster?.owner.metadata.team_name} |{" "} - {opposingRoster?.points} -

-
- -
- {opposingRoster?.starters.map((v, k) => { - return ( -
- -
- ); - })} -
+ {personalRoster && } + {opposingRoster && }
); diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 6a600cb..64db88b 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -1,181 +1,9 @@ -import { useState, useEffect, type ReactNode } from "react"; -import { Flashlight, FlashlightOff } from "lucide-react"; -import SplatterImage from "../assets/splatter.png"; +import type { ReactNode } from "react"; export default function Layout({ children }: { children: ReactNode }) { - const [pointerPosition, setPointerPosition] = useState({ x: 500, y: 500 }); - const [isActive, setIsActive] = useState(false); - const [isTouchDevice, setIsTouchDevice] = useState(false); - const [isFlashlightEnabled, setIsFlashlightEnabled] = useState(false); - - // Detect touch device on component mount - useEffect(() => { - const isTouchCapable = - "ontouchstart" in window || navigator.maxTouchPoints > 0; - - setIsTouchDevice(isTouchCapable); - }, []); - - // Handle mouse events for desktop - const handleMouseMove = (e: React.MouseEvent) => { - setPointerPosition({ x: e.clientX, y: e.clientY }); - setIsActive(true); - }; - - const handleMouseLeave = () => { - setIsActive(false); - }; - - // Handle touch events for mobile - const handleTouchMove = (e: React.TouchEvent) => { - if (e.touches && e.touches[0]) { - e.preventDefault(); // Prevent scrolling while touching - const touch = e.touches[0]; - setPointerPosition({ x: touch.clientX, y: touch.clientY }); - setIsActive(true); - } - }; - - const handleTouchStart = (e: React.TouchEvent) => { - if (e.touches && e.touches[0]) { - const touch = e.touches[0]; - setPointerPosition({ x: touch.clientX, y: touch.clientY }); - setIsActive(true); - } - }; - - const handleTouchEnd = () => { - // On mobile, we'll keep the last position visible for a moment - setTimeout(() => { - setIsActive(false); - }, 1000); - }; - - useEffect(() => { - // Define window event handlers with correct types - const windowMouseMove = (e: MouseEvent) => { - setPointerPosition({ x: e.clientX, y: e.clientY }); - setIsActive(true); - }; - - const windowMouseLeave = () => { - setIsActive(false); - }; - - const windowTouchStart = (e: TouchEvent) => { - if (e.touches && e.touches[0]) { - const touch = e.touches[0]; - setPointerPosition({ x: touch.clientX, y: touch.clientY }); - setIsActive(true); - } - }; - - const windowTouchMove = (e: TouchEvent) => { - if (e.touches && e.touches[0]) { - e.preventDefault?.(); // Optional chaining in case preventDefault isn't available - const touch = e.touches[0]; - setPointerPosition({ x: touch.clientX, y: touch.clientY }); - setIsActive(true); - } - }; - - const windowTouchEnd = () => { - // On mobile, we'll keep the last position visible for a moment - setTimeout(() => { - setIsActive(false); - }, 1000); - }; - - if (isFlashlightEnabled) { - // Add desktop event listeners - window.addEventListener("mousemove", windowMouseMove); - window.addEventListener("mouseleave", windowMouseLeave); - - // Add mobile event listeners - window.addEventListener("touchstart", windowTouchStart, { - passive: false, - }); - window.addEventListener("touchmove", windowTouchMove, { passive: false }); - window.addEventListener("touchend", windowTouchEnd); - } else { - // Remove desktop event listeners - window.removeEventListener("mousemove", windowMouseMove); - window.removeEventListener("mouseleave", windowMouseLeave); - - // Remove mobile event listeners - window.removeEventListener("touchstart", windowTouchStart); - window.removeEventListener("touchmove", windowTouchMove); - window.removeEventListener("touchend", windowTouchEnd); - } - - // Cleanup when component unmounts - return () => { - window.removeEventListener("mousemove", windowMouseMove); - window.removeEventListener("mouseleave", windowMouseLeave); - window.removeEventListener("touchstart", windowTouchStart); - window.removeEventListener("touchmove", windowTouchMove); - window.removeEventListener("touchend", windowTouchEnd); - }; - }, [isFlashlightEnabled]); - return ( -
-
-
-
-
setIsFlashlightEnabled(!isFlashlightEnabled)} - > - {isFlashlightEnabled ? : } -
-

welcome !

-
-
- {children} -
- - {isFlashlightEnabled && ( - <> -
-
- Cordyceps - Cordyceps -
-