From 54dfb67d675c47150ad6be90d447cdc4e33e00f5 Mon Sep 17 00:00:00 2001 From: Alex Frantz Date: Thu, 30 Apr 2026 17:13:23 -0400 Subject: [PATCH] fix fantasy/reorganize site --- src/assets/main.css | 26 +- src/components/FantasyStatus.tsx | 2 +- src/components/modules/PictureCarousel.tsx | 27 +-- src/components/modules/ScoreModule.tsx | 102 ++++++-- src/pages/App.tsx | 264 +++++++++++---------- src/utils/types.ts | 41 ++-- 6 files changed, 267 insertions(+), 195 deletions(-) diff --git a/src/assets/main.css b/src/assets/main.css index f42533a..1e6a7a2 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -1,17 +1,17 @@ @import "tailwindcss"; body { - font-family: 'Pathway Gothic One', sans-serif; - background-color: black; + font-family: "Pathway Gothic One", sans-serif; + background-color: black; - ::-webkit-scrollbar { - width:80px; - height:10px; - border-radius: var(--radius-lg); - background-color:white; - } - ::-webkit-scrollbar-thumb { - background-color:gray; - border-radius: var(--radius-lg); - } -} \ No newline at end of file + ::-webkit-scrollbar { + width: 5px; + height: 10px; + border-radius: var(--radius-lg); + background-color: white; + } + ::-webkit-scrollbar-thumb { + background-color: gray; + border-radius: var(--radius-lg); + } +} diff --git a/src/components/FantasyStatus.tsx b/src/components/FantasyStatus.tsx index 5f35c98..b0abe64 100644 --- a/src/components/FantasyStatus.tsx +++ b/src/components/FantasyStatus.tsx @@ -13,7 +13,7 @@ export default function FantasyStatus() { // fetch roster information useEffect(() => { async function fetchData() { - const data = (await fetch("https://api.alexav.gg/v4/football").then( + const data = (await fetch("https://api.alexav.gg/v4/sports/fantasy").then( (res) => res.json(), )) as NFLAPIData; diff --git a/src/components/modules/PictureCarousel.tsx b/src/components/modules/PictureCarousel.tsx index 6511e72..1e11ec4 100644 --- a/src/components/modules/PictureCarousel.tsx +++ b/src/components/modules/PictureCarousel.tsx @@ -19,20 +19,19 @@ export default function PictureCarousel({ onClick: (url: string) => void; }) { return ( -
-
-
- {images.map((v, k) => { - return ( - onClick(v)} - src={v} - className="inline w-[200px] max-h-[100px] object-cover" - /> - ); - })} -
+
+
+ {images.map((v, k) => { + return ( + onClick(v)} + src={v} + className="inline w-[200px] max-h-[100px] object-cover" + /> + ); + })}
); diff --git a/src/components/modules/ScoreModule.tsx b/src/components/modules/ScoreModule.tsx index ae77a52..59af56c 100644 --- a/src/components/modules/ScoreModule.tsx +++ b/src/components/modules/ScoreModule.tsx @@ -1,19 +1,14 @@ import { useEffect, useState } from "react"; import { BillsScore, SabresScore } from "../../utils/types"; -const IMAGES = { - bills: "https://storage.alexav.gg/content/bills.png", - sabres: "https://storage.alexav.gg/content/sabres.png", -}; - -export default function ScoreModule({ type }: { type: "sabres" | "bills" }) { +export default function ScoreModule() { const [billsScore, setBillsScore] = useState(null); const [sabresScore, setSabresScore] = useState(null); const [warpath, setWarpath] = useState(false); useEffect(() => { async function fetchBillsScore() { - const res = await fetch("https://api.alexav.gg/v4/scores/bills"); + const res = await fetch("https://api.alexav.gg/v4/sports/scores/bills"); if (res.ok) { const data = await res.json(); setBillsScore(data); @@ -22,7 +17,7 @@ export default function ScoreModule({ type }: { type: "sabres" | "bills" }) { } } async function fetchSabresScore() { - const res = await fetch("https://api.alexav.gg/v4/scores/sabres"); + const res = await fetch("https://api.alexav.gg/v4/sports/scores/sabres"); if (res.ok) { const data = await res.json(); setSabresScore(data); @@ -31,16 +26,81 @@ export default function ScoreModule({ type }: { type: "sabres" | "bills" }) { } } - if (type == "bills" && !billsScore) { - fetchBillsScore(); - } else if (type === "sabres" && !sabresScore) { - fetchSabresScore(); - } + fetchBillsScore(); + fetchSabresScore(); }, []); return ( -
-
+
+
+
+ { + if (sabresScore?.homeTeam.abbreviation === "BUF") + setWarpath(true); + }} + width="80" + className="shrink-0" + src={sabresScore?.homeTeam.logo} + /> + { + if (sabresScore?.awayTeam.abbreviation === "BUF") + setWarpath(true); + }} + width="80" + className="shrink-0" + src={sabresScore?.awayTeam.logo} + /> +
+
+

+ {sabresScore?.homeTeam.abbreviation} {sabresScore?.homeTeam.score} -{" "} + {sabresScore?.awayTeam.abbreviation} {sabresScore?.awayTeam.score} +

+

+ {sabresScore?.venue} -{" "} + {new Date(sabresScore?.date || Date.now()).toLocaleDateString()} +

+
+ + {warpath && ( +
+
+
+ + +
+
+

+ {billsScore?.homeTeam.abbreviation} {billsScore?.homeTeam.score} -{" "} + {billsScore?.awayTeam.abbreviation} {billsScore?.awayTeam.score} +

+

+ {billsScore?.venue} -{" "} + {new Date(billsScore?.gameDay || Date.now()).toLocaleDateString()} +

+
+
+ {/*
{ @@ -68,17 +128,7 @@ export default function ScoreModule({ type }: { type: "sabres" | "bills" }) {
- {warpath && ( -
); } diff --git a/src/pages/App.tsx b/src/pages/App.tsx index e2b69dd..ee82ea4 100644 --- a/src/pages/App.tsx +++ b/src/pages/App.tsx @@ -8,6 +8,137 @@ import FantasyStatus from "../components/FantasyStatus"; import Clock from "../components/modules/Clock"; import MusicComponent from "../components/info/MusicComponent"; +const HomePage = () => { + return ( + <> +
+
+
+ +
+
+

hi, i'm alex!

+

+ qa stuff & things at{" "} + + Medal.tv + {" "} +
+ sabres szn ticket holder +
+ master of shenanigans +

+
+ + +
+
+
+ {" "} + shows dexter, + pitt, tlou, twd, ystone +
+
+ music ptv, + treaty oak, zach top, zach bryan, type o +
+
+
+
+
+
+
+
+

about me

+

+ born and raised buffalonian + wnyer. doing qa work for 4 years and + learning software engineering on the side. i also play acoustic + guitar, been gaming since i was 4 and love going to games in + Buffalo. incredibly awkward, but that's besides the point +

+
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+
+ + ); +}; + +const PicturesPage = ({ + setOverlayImage, +}: { + setOverlayImage: (v: string | null) => void; +}) => { + return ( +
+

pictures

+ +
+ setOverlayImage(url)} /> +
+
+ ); +}; + export default function App() { const [tab, setTab] = useState("home"); const [overlayImage, setOverlayImage] = useState(null); @@ -45,115 +176,13 @@ export default function App() { src="https://storage.alexav.gg/content/sabres-board.jpg" />
-
-
-
- -
-
-

hi, i'm alex!

-

- qa stuff & things at{" "} - - Medal.tv - {" "} -
- sabres szn ticket holder -
- master of shenanigans -

-
- - -
-
-
- {" "} - shows{" "} - dexter, pitt, tlou, twd, ystone -
-
- music ptv, - treaty oak, zach top, zach bryan, type o -
-
-
-
-
-
-
-
-

about me

-

- born and raised buffalonian + wnyer. doing qa work for 4 - years and learning software engineering on the side. i also - play acoustic guitar, been gaming since i was 4 and love - going to games in Buffalo. incredibly awkward, but that's - besides the point -

-
-
-
-
- -
-
- -
-
- -
-
-
-
-
+ + {tab === "home" && } + {tab === "fantasy" && } + {tab === "pictures" && ( + + )} + {tab === "scores" && }

home

-

setTab("fantasy")} - className={`border-r-1 border-t-1 border-black hover:cursor-pointer ${tab === "fantasy" && "underline"}`} - > - fantasy -

setTab("pictures")} className={`border-r-1 border-t-1 border-black hover:cursor-pointer ${tab === "pictures" && "underline"}`} @@ -180,13 +203,14 @@ export default function App() { > scores

+

setTab("fantasy")} + className={`border-l-1 border-t-1 border-black hover:cursor-pointer ${tab === "fantasy" && "underline"}`} + > + fantasy +

- {tab === "fantasy" && } - {tab === "pictures" && ( - setOverlayImage(url)} /> - )} - {tab === "scores" && }
diff --git a/src/utils/types.ts b/src/utils/types.ts index 75307b9..2abb8f7 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -48,32 +48,31 @@ interface SleeperUser { // scores type BillsScore = { - name: string; - date: string; - score: string; + season: string; + gameType: string; + week: string; + gameDay: string; + gameTime: string; + venue: string; + homeTeam: NFLTeam; + awayTeam: NFLTeam; }; type SabresScore = { - gameDate: string; - wonInRegulation: boolean; - sabresScore: number; - oppScore: number; - homeTeam: NHLTeam; + date: string; + venue: string; awayTeam: NHLTeam; + homeTeam: NHLTeam; +}; +type NFLTeam = { + abbreviation: string; + score: string; + name: string; + nickname: string; + logo: string; }; type NHLTeam = { - id: number; - name: { - default: string; - fr: string; - }; - commonName: { - default: string; - }; - placeNameWithPreposition: { - default: string; - fr: string; - }; - abbrev: string; + abbreviation: string; + name: string; score: number; logo: string; };