diff options
| author | Wolfboy248 <georgejvindkarlsen@gmail.com> | 2025-08-26 08:20:51 +0200 |
|---|---|---|
| committer | Wolfboy248 <georgejvindkarlsen@gmail.com> | 2025-08-26 08:20:51 +0200 |
| commit | ddfe5015c9237fbe0fea44f8bcde31708eb3adac (patch) | |
| tree | db7d9812461c0ab0dc39812465f20bc958f9bf67 /frontend/src/pages | |
| parent | Moved breadcrum navigation into its own component (diff) | |
| download | lphub-css.tar.gz lphub-css.tar.bz2 lphub-css.zip | |
Fixed some inconsistant styles and fixed category queryparam in maplist pagecss
Diffstat (limited to 'frontend/src/pages')
| -rw-r--r-- | frontend/src/pages/About/About.tsx | 2 | ||||
| -rw-r--r-- | frontend/src/pages/Games/Games.tsx | 6 | ||||
| -rw-r--r-- | frontend/src/pages/Home/Homepage.tsx | 4 | ||||
| -rw-r--r-- | frontend/src/pages/Maplist/Components/Map.tsx | 8 | ||||
| -rw-r--r-- | frontend/src/pages/Maplist/Maplist.tsx | 21 | ||||
| -rw-r--r-- | frontend/src/pages/Maps/Maps.module.css | 22 | ||||
| -rw-r--r-- | frontend/src/pages/Maps/Maps.tsx | 23 | ||||
| -rw-r--r-- | frontend/src/pages/Rules/Rules.tsx | 2 |
8 files changed, 64 insertions, 24 deletions
diff --git a/frontend/src/pages/About/About.tsx b/frontend/src/pages/About/About.tsx index 0db4bf2..0db6c8a 100644 --- a/frontend/src/pages/About/About.tsx +++ b/frontend/src/pages/About/About.tsx | |||
| @@ -24,7 +24,7 @@ const About: React.FC = () => { | |||
| 24 | }, []); | 24 | }, []); |
| 25 | 25 | ||
| 26 | return ( | 26 | return ( |
| 27 | <div> | 27 | <div className="px-12 pt-6"> |
| 28 | <Helmet> | 28 | <Helmet> |
| 29 | <title>LPHUB | About</title> | 29 | <title>LPHUB | About</title> |
| 30 | </Helmet> | 30 | </Helmet> |
diff --git a/frontend/src/pages/Games/Games.tsx b/frontend/src/pages/Games/Games.tsx index ea46733..2f084f3 100644 --- a/frontend/src/pages/Games/Games.tsx +++ b/frontend/src/pages/Games/Games.tsx | |||
| @@ -3,6 +3,7 @@ import { Helmet } from "react-helmet"; | |||
| 3 | 3 | ||
| 4 | import GameEntry from "@components/GameEntry.tsx"; | 4 | import GameEntry from "@components/GameEntry.tsx"; |
| 5 | import { Game } from "@customTypes/Game.ts"; | 5 | import { Game } from "@customTypes/Game.ts"; |
| 6 | import BreadcrumbNav from "@components/BreadcrumbNav/BreadcrumbNav"; | ||
| 6 | 7 | ||
| 7 | interface GamesProps { | 8 | interface GamesProps { |
| 8 | games: Game[]; | 9 | games: Game[]; |
| @@ -10,11 +11,12 @@ interface GamesProps { | |||
| 10 | 11 | ||
| 11 | const Games: React.FC<GamesProps> = ({ games }) => { | 12 | const Games: React.FC<GamesProps> = ({ games }) => { |
| 12 | return ( | 13 | return ( |
| 13 | <div className="py-12 px-12 w-full"> | 14 | <div> |
| 14 | <Helmet> | 15 | <Helmet> |
| 15 | <title>LPHUB | Games</title> | 16 | <title>LPHUB | Games</title> |
| 16 | </Helmet> | 17 | </Helmet> |
| 17 | <section> | 18 | |
| 19 | <section className="px-12 pt-8 w-full"> | ||
| 18 | <h1 className="text-3xl mb-8">Games</h1> | 20 | <h1 className="text-3xl mb-8">Games</h1> |
| 19 | <div className="flex flex-col w-full"> | 21 | <div className="flex flex-col w-full"> |
| 20 | {games.map((game, index) => ( | 22 | {games.map((game, index) => ( |
diff --git a/frontend/src/pages/Home/Homepage.tsx b/frontend/src/pages/Home/Homepage.tsx index e4c2261..9bbf768 100644 --- a/frontend/src/pages/Home/Homepage.tsx +++ b/frontend/src/pages/Home/Homepage.tsx | |||
| @@ -3,11 +3,11 @@ import { Helmet } from "react-helmet"; | |||
| 3 | 3 | ||
| 4 | const Homepage: React.FC = () => { | 4 | const Homepage: React.FC = () => { |
| 5 | return ( | 5 | return ( |
| 6 | <div> | 6 | <div className="px-12 pt-8"> |
| 7 | <Helmet> | 7 | <Helmet> |
| 8 | <title>LPHUB | Homepage</title> | 8 | <title>LPHUB | Homepage</title> |
| 9 | </Helmet> | 9 | </Helmet> |
| 10 | <section className="p-8"> | 10 | <section> |
| 11 | <p /> | 11 | <p /> |
| 12 | <h1 className="text-5xl font-barlow-condensed-bold mb-6 text-primary">Welcome to Least Portals Hub!</h1> | 12 | <h1 className="text-5xl font-barlow-condensed-bold mb-6 text-primary">Welcome to Least Portals Hub!</h1> |
| 13 | <p className="text-lg mb-4 leading-relaxed"> | 13 | <p className="text-lg mb-4 leading-relaxed"> |
diff --git a/frontend/src/pages/Maplist/Components/Map.tsx b/frontend/src/pages/Maplist/Components/Map.tsx index 5451830..503c143 100644 --- a/frontend/src/pages/Maplist/Components/Map.tsx +++ b/frontend/src/pages/Maplist/Components/Map.tsx | |||
| @@ -19,7 +19,7 @@ const Map: React.FC<MapProps> = ({ map, catNum }) => { | |||
| 19 | className="flex h-40 sm:h-48 bg-cover relative" | 19 | className="flex h-40 sm:h-48 bg-cover relative" |
| 20 | style={{ backgroundImage: `url(${map.image})` }} | 20 | style={{ backgroundImage: `url(${map.image})` }} |
| 21 | > | 21 | > |
| 22 | <div className="backdrop-blur-sm w-full flex items-center justify-center"> | 22 | <div className="backdrop-blur-[4px] w-full flex items-center justify-center"> |
| 23 | <span className="text-3xl sm:text-5xl font-barlow-semicondensed-semibold text-white mr-1.5"> | 23 | <span className="text-3xl sm:text-5xl font-barlow-semicondensed-semibold text-white mr-1.5"> |
| 24 | {map.is_disabled | 24 | {map.is_disabled |
| 25 | ? map.category_portals[0].portal_count | 25 | ? map.category_portals[0].portal_count |
| @@ -28,7 +28,11 @@ const Map: React.FC<MapProps> = ({ map, catNum }) => { | |||
| 28 | )?.portal_count} | 28 | )?.portal_count} |
| 29 | </span> | 29 | </span> |
| 30 | <span className="text-2xl sm:text-4xl font-barlow-semicondensed-regular text-white"> | 30 | <span className="text-2xl sm:text-4xl font-barlow-semicondensed-regular text-white"> |
| 31 | portals | 31 | {map.is_disabled |
| 32 | ? map.category_portals[0].portal_count == 1 ? "portal" : "portals" | ||
| 33 | : map.category_portals.find( | ||
| 34 | obj => obj.category.id === catNum + 1 | ||
| 35 | )?.portal_count == 1 ? "portal" : "portals"} | ||
| 32 | </span> | 36 | </span> |
| 33 | </div> | 37 | </div> |
| 34 | </div> | 38 | </div> |
diff --git a/frontend/src/pages/Maplist/Maplist.tsx b/frontend/src/pages/Maplist/Maplist.tsx index d8acdf0..0b64619 100644 --- a/frontend/src/pages/Maplist/Maplist.tsx +++ b/frontend/src/pages/Maplist/Maplist.tsx | |||
| @@ -28,7 +28,7 @@ const Maplist: React.FC = () => { | |||
| 28 | 28 | ||
| 29 | function _update_currently_selected(catNum2: number) { | 29 | function _update_currently_selected(catNum2: number) { |
| 30 | setCurrentlySelected(catNum2); | 30 | setCurrentlySelected(catNum2); |
| 31 | navigate("/games/" + game?.id + "?cat=" + catNum2); | 31 | // navigate("/games/" + game?.id + "?cat=" + catNum2); |
| 32 | setHasClicked(true); | 32 | setHasClicked(true); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| @@ -54,11 +54,16 @@ const Maplist: React.FC = () => { | |||
| 54 | // location query params | 54 | // location query params |
| 55 | const queryParams = new URLSearchParams(location.search); | 55 | const queryParams = new URLSearchParams(location.search); |
| 56 | if (queryParams.get("chapter")) { | 56 | if (queryParams.get("chapter")) { |
| 57 | let cat = parseFloat(queryParams.get("chapter") || ""); | 57 | let chapter = parseFloat(queryParams.get("chapter") || ""); |
| 58 | if (gameId === 2) { | 58 | if (gameId === 2) { |
| 59 | cat += 10; | 59 | chapter += 10; |
| 60 | } | 60 | } |
| 61 | _fetch_chapters(cat.toString()); | 61 | _fetch_chapters(chapter.toString()); |
| 62 | } | ||
| 63 | |||
| 64 | if (queryParams.get("cat")) { | ||
| 65 | let cat = parseFloat(queryParams.get("cat") || ""); | ||
| 66 | setCatNum(cat - 1); | ||
| 62 | } | 67 | } |
| 63 | 68 | ||
| 64 | const _fetch_game = async () => { | 69 | const _fetch_game = async () => { |
| @@ -80,7 +85,7 @@ const Maplist: React.FC = () => { | |||
| 80 | setLoad(true); | 85 | setLoad(true); |
| 81 | _fetch_game(); | 86 | _fetch_game(); |
| 82 | _fetch_game_chapters(); | 87 | _fetch_game_chapters(); |
| 83 | }, [location.search]); | 88 | }, [location]); |
| 84 | 89 | ||
| 85 | useEffect(() => { | 90 | useEffect(() => { |
| 86 | const queryParams = new URLSearchParams(location.search); | 91 | const queryParams = new URLSearchParams(location.search); |
| @@ -145,7 +150,7 @@ const Maplist: React.FC = () => { | |||
| 145 | </div> | 150 | </div> |
| 146 | 151 | ||
| 147 | <div> | 152 | <div> |
| 148 | <section> | 153 | <section className="relative"> |
| 149 | <div> | 154 | <div> |
| 150 | <span className="text-lg sm:text-lg translate-y-1.5 block mt-2.5 text-foreground"> | 155 | <span className="text-lg sm:text-lg translate-y-1.5 block mt-2.5 text-foreground"> |
| 151 | {curChapter?.chapter.name.split(" - ")[0]} | 156 | {curChapter?.chapter.name.split(" - ")[0]} |
| @@ -155,14 +160,14 @@ const Maplist: React.FC = () => { | |||
| 155 | onClick={_handle_dropdown_click} | 160 | onClick={_handle_dropdown_click} |
| 156 | className="cursor-pointer select-none flex w-fit items-center" | 161 | className="cursor-pointer select-none flex w-fit items-center" |
| 157 | > | 162 | > |
| 158 | <span className="text-foreground text-base sm:text-2xl"> | 163 | <span className="sm:text-4xl font-barlow-semicondensed-semibold"> |
| 159 | {curChapter?.chapter.name.split(" - ")[1]} | 164 | {curChapter?.chapter.name.split(" - ")[1]} |
| 160 | </span> | 165 | </span> |
| 161 | <i className="triangle translate-x-1.5 translate-y-2 -rotate-90"></i> | 166 | <i className="triangle translate-x-1.5 translate-y-2 -rotate-90"></i> |
| 162 | </div> | 167 | </div> |
| 163 | 168 | ||
| 164 | <div | 169 | <div |
| 165 | className={`absolute z-[1000] bg-panel rounded-2xl overflow-hidden p-1 animate-in fade-in duration-100 ${dropdownActive === "none" ? "hidden" : "block" | 170 | className={`absolute z-10 bg-panel rounded-2xl overflow-hidden p-1 animate-in fade-in duration-100 ${dropdownActive === "none" ? "hidden" : "block" |
| 166 | }`} | 171 | }`} |
| 167 | > | 172 | > |
| 168 | {gameChapters?.chapters.map((chapter, i) => { | 173 | {gameChapters?.chapters.map((chapter, i) => { |
diff --git a/frontend/src/pages/Maps/Maps.module.css b/frontend/src/pages/Maps/Maps.module.css new file mode 100644 index 0000000..5c2b414 --- /dev/null +++ b/frontend/src/pages/Maps/Maps.module.css | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | .button-nav { | ||
| 2 | display: flex; | ||
| 3 | flex: 1; | ||
| 4 | gap: 12px; | ||
| 5 | |||
| 6 | align-items: center; | ||
| 7 | justify-content: center; | ||
| 8 | cursor: pointer; | ||
| 9 | |||
| 10 | background-color: var(--color-block); | ||
| 11 | transition: all 0.1s ease; | ||
| 12 | padding: 8px 0px; | ||
| 13 | font-size: 28px; | ||
| 14 | } | ||
| 15 | |||
| 16 | .button-nav:hover { | ||
| 17 | background-color: var(--color-panel); | ||
| 18 | } | ||
| 19 | |||
| 20 | .button-nav>span { | ||
| 21 | transform: translateY(-2px); | ||
| 22 | } \ No newline at end of file | ||
diff --git a/frontend/src/pages/Maps/Maps.tsx b/frontend/src/pages/Maps/Maps.tsx index 03de289..3989b56 100644 --- a/frontend/src/pages/Maps/Maps.tsx +++ b/frontend/src/pages/Maps/Maps.tsx | |||
| @@ -2,6 +2,8 @@ import React from "react"; | |||
| 2 | import { Link, useLocation } from "react-router-dom"; | 2 | import { Link, useLocation } from "react-router-dom"; |
| 3 | import { Helmet } from "react-helmet"; | 3 | import { Helmet } from "react-helmet"; |
| 4 | 4 | ||
| 5 | import styles from "./Maps.module.css"; | ||
| 6 | |||
| 5 | import { PortalIcon, FlagIcon, ChatIcon } from "../../images/Images.tsx"; | 7 | import { PortalIcon, FlagIcon, ChatIcon } from "../../images/Images.tsx"; |
| 6 | import Summary from "@components/Summary.tsx"; | 8 | import Summary from "@components/Summary.tsx"; |
| 7 | import Leaderboards from "@components/Leaderboards.tsx"; | 9 | import Leaderboards from "@components/Leaderboards.tsx"; |
| @@ -63,22 +65,25 @@ const Maps: React.FC<MapProps> = ({ token, isModerator }) => { | |||
| 63 | 65 | ||
| 64 | if (!mapSummaryData) { | 66 | if (!mapSummaryData) { |
| 65 | // loading placeholder | 67 | // loading placeholder |
| 68 | // TODO: Don't do this | ||
| 66 | return ( | 69 | return ( |
| 67 | <> | 70 | <> |
| 68 | <div className=""> | 71 | <div className=""> |
| 69 | <BreadcrumbNav /> | 72 | <BreadcrumbNav /> |
| 70 | 73 | ||
| 71 | <div className="px-12"> | 74 | <div className="px-12"> |
| 75 | <h1>Loading...</h1> | ||
| 76 | |||
| 72 | <section id="section2" className="summary1 mt-4 flex gap-2 flex-wrap"> | 77 | <section id="section2" className="summary1 mt-4 flex gap-2 flex-wrap"> |
| 73 | <button className="nav-button"> | 78 | <button className={styles["button-nav"]}> |
| 74 | <img src={PortalIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> | 79 | <img src={PortalIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> |
| 75 | <span>Summary</span> | 80 | <span>Summary</span> |
| 76 | </button> | 81 | </button> |
| 77 | <button className="nav-button"> | 82 | <button className={styles["button-nav"]}> |
| 78 | <img src={FlagIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> | 83 | <img src={FlagIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> |
| 79 | <span>Leaderboards</span> | 84 | <span>Leaderboards</span> |
| 80 | </button> | 85 | </button> |
| 81 | <button className="nav-button"> | 86 | <button className={styles["button-nav"]}> |
| 82 | <img src={ChatIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> | 87 | <img src={ChatIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> |
| 83 | <span>Discussions</span> | 88 | <span>Discussions</span> |
| 84 | </button> | 89 | </button> |
| @@ -109,19 +114,21 @@ const Maps: React.FC<MapProps> = ({ token, isModerator }) => { | |||
| 109 | <div id="background-image"> | 114 | <div id="background-image"> |
| 110 | <img src={mapSummaryData.map.image} alt="" /> | 115 | <img src={mapSummaryData.map.image} alt="" /> |
| 111 | </div> | 116 | </div> |
| 112 | <div className=""> | 117 | <div> |
| 113 | <BreadcrumbNav chapter={{ label: mapSummaryData.map.chapter_name, to: `/games/${mapSummaryData.map.is_coop ? "2" : "1"}?chapter=${mapSummaryData.map.chapter_name.split(" ")[1]}` }} /> | 118 | <BreadcrumbNav chapter={{ label: mapSummaryData.map.chapter_name, to: `/games/${mapSummaryData.map.is_coop ? "2" : "1"}?chapter=${mapSummaryData.map.chapter_name.split(" ")[1]}` }} /> |
| 114 | <div className="px-12"> | 119 | <div className="px-12"> |
| 115 | <section id="section2" className="summary1 mt-4 flex gap-2 flex-wrap"> | 120 | <h1>{mapSummaryData.map.map_name}</h1> |
| 116 | <button className="nav-button" onClick={() => setNavState(0)}> | 121 | |
| 122 | <section className="mt-2 flex w-full gap-[2px] rounded-[2000px] overflow-clip"> | ||
| 123 | <button className={styles["button-nav"]} onClick={() => setNavState(0)}> | ||
| 117 | <img src={PortalIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> | 124 | <img src={PortalIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> |
| 118 | <span>Summary</span> | 125 | <span>Summary</span> |
| 119 | </button> | 126 | </button> |
| 120 | <button className="nav-button" onClick={() => setNavState(1)}> | 127 | <button className={styles["button-nav"]} onClick={() => setNavState(1)}> |
| 121 | <img src={FlagIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> | 128 | <img src={FlagIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> |
| 122 | <span>Leaderboards</span> | 129 | <span>Leaderboards</span> |
| 123 | </button> | 130 | </button> |
| 124 | <button className="nav-button" onClick={() => setNavState(2)}> | 131 | <button className={styles["button-nav"]} onClick={() => setNavState(2)}> |
| 125 | <img src={ChatIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> | 132 | <img src={ChatIcon} alt="" className="w-5 h-5 sm:w-6 sm:h-6" /> |
| 126 | <span>Discussions</span> | 133 | <span>Discussions</span> |
| 127 | </button> | 134 | </button> |
diff --git a/frontend/src/pages/Rules/Rules.tsx b/frontend/src/pages/Rules/Rules.tsx index 20d301c..a94118a 100644 --- a/frontend/src/pages/Rules/Rules.tsx +++ b/frontend/src/pages/Rules/Rules.tsx | |||
| @@ -25,7 +25,7 @@ const Rules: React.FC = () => { | |||
| 25 | }, []); | 25 | }, []); |
| 26 | 26 | ||
| 27 | return ( | 27 | return ( |
| 28 | <div className="pl-8 pt-2"> | 28 | <div className="px-12 pt-6"> |
| 29 | <Helmet> | 29 | <Helmet> |
| 30 | <title>LPHUB | Rules</title> | 30 | <title>LPHUB | Rules</title> |
| 31 | </Helmet> | 31 | </Helmet> |