From 6a8b909afbe1560be95f7ad0a3e19cfe4717aec6 Mon Sep 17 00:00:00 2001 From: FifthWit Date: Thu, 14 Aug 2025 14:01:01 -0500 Subject: Switched to tailwind/vite --- frontend/src/pages/About.tsx | 4 +- frontend/src/pages/Games.tsx | 32 +++------- frontend/src/pages/Homepage.tsx | 12 ++-- frontend/src/pages/Maplist.tsx | 131 ++++++++++++++++++++++------------------ frontend/src/pages/Maps.tsx | 15 +++-- frontend/src/pages/Profile.tsx | 1 - frontend/src/pages/Rules.tsx | 4 +- frontend/src/pages/User.tsx | 1 - 8 files changed, 93 insertions(+), 107 deletions(-) (limited to 'frontend/src/pages') diff --git a/frontend/src/pages/About.tsx b/frontend/src/pages/About.tsx index 5a69bfe..a5bb291 100644 --- a/frontend/src/pages/About.tsx +++ b/frontend/src/pages/About.tsx @@ -2,8 +2,6 @@ import React from "react"; import ReactMarkdown from "react-markdown"; import { Helmet } from "react-helmet"; -import "@css/About.css"; - const About: React.FC = () => { const [aboutText, setAboutText] = React.useState(""); @@ -26,7 +24,7 @@ const About: React.FC = () => { }, []); return ( -
+
LPHUB | About diff --git a/frontend/src/pages/Games.tsx b/frontend/src/pages/Games.tsx index d7dacde..1ef0f57 100644 --- a/frontend/src/pages/Games.tsx +++ b/frontend/src/pages/Games.tsx @@ -3,41 +3,23 @@ import { Helmet } from "react-helmet"; import GameEntry from "@components/GameEntry"; import { Game } from "@customTypes/Game"; -import "@css/Maps.css"; interface GamesProps { games: Game[]; } const Games: React.FC = ({ games }) => { - const _page_load = () => { - const loaders = document.querySelectorAll(".loader"); - loaders.forEach(loader => { - (loader as HTMLElement).style.display = "none"; - }); - }; - - React.useEffect(() => { - document - .querySelectorAll(".games-page-item-body") - .forEach((game, index) => { - game.innerHTML = ""; - }); - _page_load(); - }, []); - return ( -
+
LPHUB | Games -
-
-
- {games.map((game, index) => ( - - ))} -
+
+

Games

+
+ {games.map((game, index) => ( + + ))}
diff --git a/frontend/src/pages/Homepage.tsx b/frontend/src/pages/Homepage.tsx index f0c5821..2d16b8d 100644 --- a/frontend/src/pages/Homepage.tsx +++ b/frontend/src/pages/Homepage.tsx @@ -3,23 +3,23 @@ import { Helmet } from "react-helmet"; const Homepage: React.FC = () => { return ( -
+
LPHUB | Homepage -
+

-

Welcome to Least Portals Hub!

-

+

Welcome to Least Portals Hub!

+

At the moment, LPHUB is in beta state. This means that the site has only the core functionalities enabled for providing both collaborative information and competitive leaderboards.

-

+

The website should feel intuitive to navigate around. For any type of feedback, reach us at LPHUB Discord server.

-

+

By using LPHUB, you agree that you have read the 'Leaderboard Rules' and the 'About LPHUB' pages.

diff --git a/frontend/src/pages/Maplist.tsx b/frontend/src/pages/Maplist.tsx index a7242ef..8343129 100644 --- a/frontend/src/pages/Maplist.tsx +++ b/frontend/src/pages/Maplist.tsx @@ -2,7 +2,6 @@ import React, { useEffect } from "react"; import { Link, useLocation, useNavigate, useParams } from "react-router-dom"; import { Helmet } from "react-helmet"; -import "@css/Maplist.css"; import { API } from "@api/Api"; import { Game } from "@customTypes/Game"; import { GameChapter, GamesChapters } from "@customTypes/Chapters"; @@ -92,44 +91,52 @@ const Maplist: React.FC = () => { LPHUB | Maplist -
+ +
-
+ {load ? (
) : (
-

{game?.name}

+

+ {game?.name} +

+
-
-
-

+
+
+

{ game?.category_portals.find( obj => obj.category.id === catNum + 1 )?.portal_count }

-

portals

+

+ portals +

-
+ +
{game?.category_portals.map((cat, index) => (
-
+
- + {curChapter?.chapter.name.split(" - ")[0]}
-
- {curChapter?.chapter.name.split(" - ")[1]} - +
+ + {curChapter?.chapter.name.split(" - ")[1]} + +
+ \
{gameChapters?.chapters.map((chapter, i) => { return (
{ _fetch_chapters(chapter.id.toString()); _handle_dropdown_click(); @@ -179,49 +187,52 @@ const Maplist: React.FC = () => { })}
-
+ +
{curChapter?.maps.map((map, i) => { return ( -
+
- {map.name} + + {map.name} +
-
- +
+ {map.is_disabled ? map.category_portals[0].portal_count : map.category_portals.find( obj => obj.category.id === catNum + 1 )?.portal_count} - portals + + portals +
-
- {/* Difficulty: */} -
-
-
-
-
-
+ + {/* Difficulty rating */} +
+
+ {[1, 2, 3, 4, 5].map((point) => ( +
+ ))}
diff --git a/frontend/src/pages/Maps.tsx b/frontend/src/pages/Maps.tsx index fbdb8f3..75753ac 100644 --- a/frontend/src/pages/Maps.tsx +++ b/frontend/src/pages/Maps.tsx @@ -2,14 +2,13 @@ import React from "react"; import { Link, useLocation } from "react-router-dom"; import { Helmet } from "react-helmet"; -import { PortalIcon, FlagIcon, ChatIcon } from "@images/Images"; +import { PortalIcon, FlagIcon, ChatIcon } from "../images/Images"; import Summary from "@components/Summary"; import Leaderboards from "@components/Leaderboards"; import Discussions from "@components/Discussions"; import ModMenu from "@components/ModMenu"; import { MapDiscussions, MapLeaderboard, MapSummary } from "@customTypes/Map"; import { API } from "@api/Api"; -import "@css/Maps.css"; interface MapProps { token?: string; @@ -82,15 +81,15 @@ const Maps: React.FC = ({ token, isModerator }) => {
@@ -151,15 +150,15 @@ const Maps: React.FC = ({ token, isModerator }) => {
diff --git a/frontend/src/pages/Profile.tsx b/frontend/src/pages/Profile.tsx index e2d6000..f44f587 100644 --- a/frontend/src/pages/Profile.tsx +++ b/frontend/src/pages/Profile.tsx @@ -19,7 +19,6 @@ import { UserProfile } from "@customTypes/Profile"; import { Game, GameChapters } from "@customTypes/Game"; import { Map } from "@customTypes/Map"; import { ticks_to_time } from "@utils/Time"; -import "@css/Profile.css"; import { API } from "@api/Api"; import useConfirm from "@hooks/UseConfirm"; import useMessage from "@hooks/UseMessage"; diff --git a/frontend/src/pages/Rules.tsx b/frontend/src/pages/Rules.tsx index 91027a0..7cdc08b 100644 --- a/frontend/src/pages/Rules.tsx +++ b/frontend/src/pages/Rules.tsx @@ -2,8 +2,6 @@ import React from "react"; import ReactMarkdown from "react-markdown"; import { Helmet } from "react-helmet"; -import "@css/Rules.css"; - const Rules: React.FC = () => { const [rulesText, setRulesText] = React.useState(""); @@ -27,7 +25,7 @@ const Rules: React.FC = () => { }, []); return ( -
+
LPHUB | Rules diff --git a/frontend/src/pages/User.tsx b/frontend/src/pages/User.tsx index 0198034..4b8a456 100644 --- a/frontend/src/pages/User.tsx +++ b/frontend/src/pages/User.tsx @@ -19,7 +19,6 @@ import { Game, GameChapters } from "@customTypes/Game"; import { Map } from "@customTypes/Map"; import { API } from "@api/Api"; import { ticks_to_time } from "@utils/Time"; -import "@css/Profile.css"; import useMessage from "@hooks/UseMessage"; interface UserProps { -- cgit v1.2.3