diff --git a/src/assets/main.css b/src/assets/main.css index d44fb93..f42533a 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -1,9 +1,5 @@ @import "tailwindcss"; -@theme { - --breakpoint-xs: 400px; -} - body { font-family: 'Pathway Gothic One', sans-serif; background-color: black; @@ -18,27 +14,4 @@ body { background-color:gray; border-radius: var(--radius-lg); } -} - -.marquee { - overflow: hidden; - white-space: nowrap; -} - -.marquee-content { - display: inline-block; - animation: scroll 10s linear infinite; -} - -.marquee-content span { - display: inline-block; -} - -@keyframes scroll { - 0% { - transform: translateX(0); - } - 100% { - transform: translateX(-50%); - } } \ No newline at end of file diff --git a/src/components/ErrorState.tsx b/src/components/ErrorState.tsx new file mode 100644 index 0000000..ae0d88b --- /dev/null +++ b/src/components/ErrorState.tsx @@ -0,0 +1,34 @@ +export default function ErrorState({ + type = "error", +}: { + type: "error" | "loading" | "unavailable"; +}) { + if (type === "error") { + return ( +
+
+

uh oh :(

+

something went wrong loading this stat

+
+
+ ); + } else if (type === "loading") { + return ( +
+
+

loading..

+

hang tight..

+
+
+ ); + } else if (type === "unavailable") { + return ( +
+
+

nothing here :(

+

no game launched recently

+
+
+ ); + } +} diff --git a/src/components/FantasyStatus.tsx b/src/components/FantasyStatus.tsx index 4d17607..88937e9 100644 --- a/src/components/FantasyStatus.tsx +++ b/src/components/FantasyStatus.tsx @@ -4,17 +4,17 @@ import { TeamRow } from "./fantasy/TeamRow"; export default function FantasyStatus() { const [personalRoster, setPersonalRoster] = useState( - null + null, ); const [opposingRoster, setOpposingRoster] = useState( - null + null, ); // fetch roster information useEffect(() => { async function fetchData() { const data = (await fetch("https://api.alexav.gg/v4/football").then( - (res) => res.json() + (res) => res.json(), )) as NFLAPIData; // rosters @@ -35,12 +35,12 @@ export default function FantasyStatus() { }, []); return ( -
+

fantasy

diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 9634562..65200b8 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -2,7 +2,7 @@ import type { ReactNode } from "react"; export default function Layout({ children }: { children: ReactNode }) { return ( -
+
{children}
); diff --git a/src/components/Overlay.tsx b/src/components/Overlay.tsx deleted file mode 100644 index 7490574..0000000 --- a/src/components/Overlay.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { ReactNode } from "react"; - -export default function Overlay({ - children, - onClose, -}: { - children: ReactNode; - onClose: () => void; -}) { - return ( -
- {children} -
- ); -} diff --git a/src/components/Picture.tsx b/src/components/Picture.tsx deleted file mode 100644 index 1c0dff9..0000000 --- a/src/components/Picture.tsx +++ /dev/null @@ -1,15 +0,0 @@ -export default function Picture({ - image, - onClick, -}: { - image: string; - onClick: () => void; -}) { - return ( - - ); -} diff --git a/src/components/info/GameComponent.tsx b/src/components/info/GameComponent.tsx index c5ef771..26e3949 100644 --- a/src/components/info/GameComponent.tsx +++ b/src/components/info/GameComponent.tsx @@ -1,4 +1,5 @@ import { useState, useEffect } from "react"; +import ErrorState from "../ErrorState"; type GameObject = { currentlyPlaying: CurrentlyPlaying; @@ -18,7 +19,7 @@ export default function GameComponent() { async function fetchGame() { const response = await fetch( - "https://api.alexav.gg/v4/tracker/latestGame" + "https://api.alexav.gg/v4/tracker/latestGame", ); if (response.ok) { const data = await response.json(); @@ -33,54 +34,27 @@ export default function GameComponent() { }, []); if (game) { - const dateOrTime = (game: CurrentlyPlaying) => { - if (game.finishedAt) { - const currentDate = new Date(); - const finishedDate = new Date(game.finishedAt); - - if ( - currentDate.toLocaleDateString() === finishedDate.toLocaleDateString() - ) { - return `at ${finishedDate.toLocaleTimeString()}`; - } else { - return `on ${finishedDate.toLocaleDateString()}`; - } - } - }; - return ( -
- {game.currentlyPlaying && ( - <> -

currently playing

-

- + +

+ ); + } else { + return ; } } diff --git a/src/components/info/MusicComponent.tsx b/src/components/info/MusicComponent.tsx index 334b182..249bd27 100644 --- a/src/components/info/MusicComponent.tsx +++ b/src/components/info/MusicComponent.tsx @@ -1,9 +1,10 @@ import { useState, useEffect } from "react"; import type { LastFMMusicObject } from "../../utils/types"; +import ErrorState from "../ErrorState"; export default function MusicComponent() { const [music, setMusic] = useState(null); - const [failedFetch, setFailedFetch] = useState(false); + const [failedFetch, setFailedFetch] = useState(false); useEffect(() => { async function fetchMusic() { @@ -25,46 +26,67 @@ export default function MusicComponent() { fetchMusic(); }, []); - if (music) { - return ( - -
-
- - - - ); - } else { - if (failedFetch) { - return ( -
-

uh oh!

-

failed to get music :(

-
+ ); } else { - return ( -
-

loading music..

-

loading artist..

-
- ); + return ; } + } else { + return ; } + + // if (music) { + // return ( + // + //
+ //
+ // + //
+ //

+ // {music.title} + //

+ //

{music.artist}

+ //
+ //
+ //
+ //
+ // ); + // } else { + // if (failedFetch) { + // return ( + //
+ //

uh oh!

+ //

failed to get music :(

+ //
+ // ); + // } else { + // return ( + //
+ //

loading music..

+ //

loading artist..

+ //
+ // ); + // } + // } } diff --git a/src/components/modules/Clock.tsx b/src/components/modules/Clock.tsx new file mode 100644 index 0000000..03f9f57 --- /dev/null +++ b/src/components/modules/Clock.tsx @@ -0,0 +1,28 @@ +import { useState, useEffect } from "react"; + +export default function Clock() { + const [clock, setClock] = useState( + new Date().toLocaleTimeString("en-GB", { + hour: "2-digit", + minute: "2-digit", + }), + ); + + useEffect(() => { + setInterval(() => { + const date = new Date().toLocaleTimeString("en-GB", { + hour: "2-digit", + minute: "2-digit", + }); + if (clock != date) { + setClock(date); + } + }, 500); + }, []); + + return ( +

+ {clock} +

+ ); +} diff --git a/src/components/modules/InfoModule.tsx b/src/components/modules/InfoModule.tsx deleted file mode 100644 index 84a4b99..0000000 --- a/src/components/modules/InfoModule.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import MusicComponent from "../info/MusicComponent"; - -export default function InfoModule() { - return ( -
-
-
-

alex, 18

- Profile -
- -
-
-
-

what i do

-

- qa @{" "} - - medal.tv - - , game, code -

-

navigator.clipboard.writeText("alex@vierfrantz.com")} - > - alex@vierfrantz.com -

- -
- -

obsessed with

-

dexter, tlou, twd

-
-
-
- ); -} diff --git a/src/components/modules/PictureCarousel.tsx b/src/components/modules/PictureCarousel.tsx index 17836e8..b67d1c5 100644 --- a/src/components/modules/PictureCarousel.tsx +++ b/src/components/modules/PictureCarousel.tsx @@ -1,5 +1,3 @@ -import Picture from "../Picture"; - const images = [ "https://storage.alexav.gg/content/1f822215-0768-424d-893a-13bcd10aa98b.jpg", "https://storage.alexav.gg/content/de890eaf-fc73-42a4-9fbe-a62313394a4c.jpg", @@ -8,19 +6,19 @@ const images = [ "https://storage.alexav.gg/content/2f36c1dd-eaf8-4fd3-a3cd-1d25fe8f5a07.jpg", ]; -export default function PictureCarousel({ - onClick, -}: { - onClick: (url: string) => void; -}) { +export default function PictureCarousel() { return (
-

pictures

-
{images.map((v, k) => { - return onClick(v)} />; + return ( + + ); })}
diff --git a/src/components/modules/ScoreModule.tsx b/src/components/modules/ScoreModule.tsx index 22c0b87..a049206 100644 --- a/src/components/modules/ScoreModule.tsx +++ b/src/components/modules/ScoreModule.tsx @@ -38,7 +38,7 @@ export default function ScoreModule({ type }: { type: "sabres" | "bills" }) { }, []); return ( -
+
diff --git a/src/components/modules/StatModule.tsx b/src/components/modules/StatModule.tsx index 52b93d6..0fd20e0 100644 --- a/src/components/modules/StatModule.tsx +++ b/src/components/modules/StatModule.tsx @@ -1,4 +1,5 @@ import { useState, useEffect } from "react"; +import ErrorState from "../ErrorState"; type ContentObject = { id: number; @@ -17,19 +18,9 @@ type ContentObject = { }; export default function StatModule() { - const [data, setData] = useState(null); - + const [data, setData] = useState(null); const [failedFetch, setFailedFetch] = useState(false); - const ErrorState = () => { - return ( -
-

Uh oh :(

-

Something went wrong loading this stat

-
- ); - }; - useEffect(() => { async function fetchData() { const response = await fetch( @@ -39,49 +30,46 @@ export default function StatModule() { const data = await response.json(); if (data && data.length <= 0) { setFailedFetch(true); - } else setData(data.data as ContentObject[]); + } else setData(data.data[0] as ContentObject); } else setFailedFetch(true); } fetchData(); }, []); - return ( -
-

recent watches

- + + ); + } else { + return ; + } + } else { + return ; + } } diff --git a/src/components/modules/WelcomeModule.tsx b/src/components/modules/WelcomeModule.tsx deleted file mode 100644 index 83718b1..0000000 --- a/src/components/modules/WelcomeModule.tsx +++ /dev/null @@ -1,7 +0,0 @@ -export default function WelcomeModule() { - return ( -
-

welcome to my site !

-
- ); -} diff --git a/src/pages/App.tsx b/src/pages/App.tsx index 4f969fc..ff1afa6 100644 --- a/src/pages/App.tsx +++ b/src/pages/App.tsx @@ -1,48 +1,153 @@ import { useState } from "react"; import Layout from "../components/Layout"; -import Overlay from "../components/Overlay"; import GameComponent from "../components/info/GameComponent"; import PictureCarousel from "../components/modules/PictureCarousel"; -import InfoModule from "../components/modules/InfoModule"; -import WelcomeModule from "../components/modules/WelcomeModule"; import ScoreModule from "../components/modules/ScoreModule"; import StatModule from "../components/modules/StatModule"; +import FantasyStatus from "../components/FantasyStatus"; +import Clock from "../components/modules/Clock"; +import MusicComponent from "../components/info/MusicComponent"; export default function App() { - const [selectedImage, setSelectedImage] = useState(""); + const [tab, setTab] = useState("home"); return ( - {selectedImage !== "" && ( - setSelectedImage("")}> -
+
+
+
+
+
+

welcome

+ +

let it rip

+
+
+ +
+
+
+
+ +
+
+

hi, i'm alex!

+

+ i do QA stuff at{" "} + + Medal.tv{" "} + + and write mediocre code sometimes +

+

+ + twt + + • + + instagram + + • + + tiktok + +

+
+
+
+ {" "} + shows{" "} + dexter, the pitt, tlou, twd +
+
+ music ptv, + treaty oak, zach top, she wants revenge +
+
+
+
+
+
+
+
+

about me

+

+ born & raised western new yorker. i've been doing QA work + for the past 4 years and learning software engineering in + between. i also play acoustic guitar, am really into gaming + and love travelling to NYC. i am also incredibly awkward, + but that's besides the point +

+
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+
+ +
+

setTab("home")} + className={`border-r-1 border-t-1 border-black hover:cursor-pointer ${tab === "home" && "underline"}`} + > + 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"}`} + > + pictures +

+

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

+
- - )} - -
-
- - - - - - setSelectedImage(url)} /> - - - {/* */} + {tab === "fantasy" && } + {tab === "pictures" && } + {tab === "scores" && }