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 | |
| parent | Moved breadcrum navigation into its own component (diff) | |
| download | lphub-ddfe5015c9237fbe0fea44f8bcde31708eb3adac.tar.gz lphub-ddfe5015c9237fbe0fea44f8bcde31708eb3adac.tar.bz2 lphub-ddfe5015c9237fbe0fea44f8bcde31708eb3adac.zip | |
Fixed some inconsistant styles and fixed category queryparam in maplist pagecss
| -rw-r--r-- | frontend/src/App.css | 11 | ||||
| -rw-r--r-- | frontend/src/components/Sidebar/Content.tsx | 2 | ||||
| -rw-r--r-- | frontend/src/components/Sidebar/Search.tsx | 9 | ||||
| -rw-r--r-- | frontend/src/components/Sidebar/Sidebar.module.css | 3 | ||||
| -rw-r--r-- | frontend/src/components/Sidebar/Sidebar.tsx | 11 | ||||
| -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 |
13 files changed, 82 insertions, 42 deletions
diff --git a/frontend/src/App.css b/frontend/src/App.css index d443222..4c87357 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css | |||
| @@ -37,15 +37,11 @@ h1 { | |||
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | h2 { | 39 | h2 { |
| 40 | font-size: 32px; | 40 | font-size: 42px; |
| 41 | } | ||
| 42 | |||
| 43 | h2 { | ||
| 44 | font-size: 24px; | ||
| 45 | } | 41 | } |
| 46 | 42 | ||
| 47 | h3 { | 43 | h3 { |
| 48 | font-size: 20px; | 44 | font-size: 32px; |
| 49 | } | 45 | } |
| 50 | 46 | ||
| 51 | h4 { | 47 | h4 { |
| @@ -61,7 +57,7 @@ h6 { | |||
| 61 | } | 57 | } |
| 62 | 58 | ||
| 63 | p { | 59 | p { |
| 64 | font-size: 16px; | 60 | font-size: 24px; |
| 65 | } | 61 | } |
| 66 | 62 | ||
| 67 | body { | 63 | body { |
| @@ -70,6 +66,7 @@ body { | |||
| 70 | color: var(--color-white); | 66 | color: var(--color-white); |
| 71 | font-family: var(--font-barlow-semicondensed-regular); | 67 | font-family: var(--font-barlow-semicondensed-regular); |
| 72 | margin: 0; | 68 | margin: 0; |
| 69 | font-size: 22px; | ||
| 73 | } | 70 | } |
| 74 | 71 | ||
| 75 | main { | 72 | main { |
diff --git a/frontend/src/components/Sidebar/Content.tsx b/frontend/src/components/Sidebar/Content.tsx index ceb9e67..6aade15 100644 --- a/frontend/src/components/Sidebar/Content.tsx +++ b/frontend/src/components/Sidebar/Content.tsx | |||
| @@ -18,7 +18,7 @@ interface ContentProps { | |||
| 18 | const _Content: React.FC<ContentProps> = ({ isSearching, selectedButtonIndex, handle_sidebar_click }) => { | 18 | const _Content: React.FC<ContentProps> = ({ isSearching, selectedButtonIndex, handle_sidebar_click }) => { |
| 19 | 19 | ||
| 20 | return ( | 20 | return ( |
| 21 | <div className="h-full"> | 21 | <div className="md:h-full"> |
| 22 | 22 | ||
| 23 | <div className="px-2 my-2.5"> | 23 | <div className="px-2 my-2.5"> |
| 24 | <button onClick={() => handle_sidebar_click(0)} className={`${styles.button} ${selectedButtonIndex == 0 ? styles["button-selected"] : ""} ${isSearching ? styles["button-hidden"] : ""}`}> | 24 | <button onClick={() => handle_sidebar_click(0)} className={`${styles.button} ${selectedButtonIndex == 0 ? styles["button-selected"] : ""} ${isSearching ? styles["button-hidden"] : ""}`}> |
diff --git a/frontend/src/components/Sidebar/Search.tsx b/frontend/src/components/Sidebar/Search.tsx index 00d9e1e..49bcec7 100644 --- a/frontend/src/components/Sidebar/Search.tsx +++ b/frontend/src/components/Sidebar/Search.tsx | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | import React, { useRef } from "react"; | 1 | import React from "react"; |
| 2 | import { Link } from "react-router-dom"; | 2 | import { Link } from "react-router-dom"; |
| 3 | 3 | ||
| 4 | import { Search } from "@customTypes/Search"; | 4 | import { Search } from "@customTypes/Search"; |
| @@ -7,21 +7,20 @@ import { UserProfile } from "@customTypes/Profile"; | |||
| 7 | 7 | ||
| 8 | interface SearchProps { | 8 | interface SearchProps { |
| 9 | profile?: UserProfile; | 9 | profile?: UserProfile; |
| 10 | searchbarRef: React.RefObject<HTMLInputElement | null>; | ||
| 10 | }; | 11 | }; |
| 11 | 12 | ||
| 12 | const _Search: React.FC<SearchProps> = ({ profile }) => { | 13 | const _Search: React.FC<SearchProps> = ({ profile, searchbarRef }) => { |
| 13 | const [searchData, setSearchData] = React.useState<Search | undefined>( | 14 | const [searchData, setSearchData] = React.useState<Search | undefined>( |
| 14 | undefined | 15 | undefined |
| 15 | ); | 16 | ); |
| 16 | 17 | ||
| 17 | const searchbarRef = useRef<HTMLInputElement>(null); | ||
| 18 | |||
| 19 | const _handle_search_change = async (q: string) => { | 18 | const _handle_search_change = async (q: string) => { |
| 20 | const searchResponse = await API.get_search(q); | 19 | const searchResponse = await API.get_search(q); |
| 21 | setSearchData(searchResponse); | 20 | setSearchData(searchResponse); |
| 22 | }; | 21 | }; |
| 23 | return ( | 22 | return ( |
| 24 | <div className="flex w-full flex-col justify-between p-3"> | 23 | <div className="flex w-full flex-col p-3 not-md:absolute"> |
| 25 | <input | 24 | <input |
| 26 | ref={searchbarRef} | 25 | ref={searchbarRef} |
| 27 | type="text" | 26 | type="text" |
diff --git a/frontend/src/components/Sidebar/Sidebar.module.css b/frontend/src/components/Sidebar/Sidebar.module.css index 9baf415..6e43254 100644 --- a/frontend/src/components/Sidebar/Sidebar.module.css +++ b/frontend/src/components/Sidebar/Sidebar.module.css | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | transition: all 0.2s ease; | 7 | transition: all 0.2s ease; |
| 8 | padding: 4px 0px; | 8 | padding: 4px 0px; |
| 9 | height: 48px; | 9 | height: 48px; |
| 10 | gap: 24px; | ||
| 10 | } | 11 | } |
| 11 | 12 | ||
| 12 | .button:hover, | 13 | .button:hover, |
| @@ -25,7 +26,7 @@ button>span { | |||
| 25 | font-size: 22px; | 26 | font-size: 22px; |
| 26 | font-family: var(--font-barlow-semicondensed-regular); | 27 | font-family: var(--font-barlow-semicondensed-regular); |
| 27 | white-space: nowrap; | 28 | white-space: nowrap; |
| 28 | margin-left: 16px; | 29 | transition: all 0.2s ease; |
| 29 | } | 30 | } |
| 30 | 31 | ||
| 31 | .button-hidden>span { | 32 | .button-hidden>span { |
diff --git a/frontend/src/components/Sidebar/Sidebar.tsx b/frontend/src/components/Sidebar/Sidebar.tsx index 77e23a6..f280a59 100644 --- a/frontend/src/components/Sidebar/Sidebar.tsx +++ b/frontend/src/components/Sidebar/Sidebar.tsx | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | import React, { useCallback } from "react"; | 1 | import React, { useCallback, useRef } from "react"; |
| 2 | import { useLocation } from "react-router-dom"; | 2 | import { useLocation } from "react-router-dom"; |
| 3 | import { UserProfile } from "@customTypes/Profile"; | 3 | import { UserProfile } from "@customTypes/Profile"; |
| 4 | 4 | ||
| @@ -24,6 +24,8 @@ const Sidebar: React.FC<SidebarProps> = ({ | |||
| 24 | const [isSearching, setIsSearching] = React.useState<boolean>(false); | 24 | const [isSearching, setIsSearching] = React.useState<boolean>(false); |
| 25 | const [selectedButtonIndex, setSelectedButtonIndex] = React.useState<number>(1); | 25 | const [selectedButtonIndex, setSelectedButtonIndex] = React.useState<number>(1); |
| 26 | 26 | ||
| 27 | const searchbarRef = useRef<HTMLInputElement>(null); | ||
| 28 | |||
| 27 | const location = useLocation(); | 29 | const location = useLocation(); |
| 28 | const path = location.pathname; | 30 | const path = location.pathname; |
| 29 | 31 | ||
| @@ -34,6 +36,7 @@ const Sidebar: React.FC<SidebarProps> = ({ | |||
| 34 | if (clicked_sidebar_idx == 0 && !isSearching) { | 36 | if (clicked_sidebar_idx == 0 && !isSearching) { |
| 35 | if (!isSearching) { | 37 | if (!isSearching) { |
| 36 | setIsSearching(true); | 38 | setIsSearching(true); |
| 39 | searchbarRef.current?.focus(); | ||
| 37 | } | 40 | } |
| 38 | } else { | 41 | } else { |
| 39 | setIsSearching(false); | 42 | setIsSearching(false); |
| @@ -57,13 +60,13 @@ const Sidebar: React.FC<SidebarProps> = ({ | |||
| 57 | }, [path]); | 60 | }, [path]); |
| 58 | 61 | ||
| 59 | return ( | 62 | return ( |
| 60 | <div className={`h-screen w-80 not-md:w-full text-white bg-block flex flex-col not-md:flex-row not-md:bg-gradient-to-t not-md:from-block not-md:to-bright | 63 | <div className={`md:h-screen w-80 not-md:w-full text-white bg-block flex flex-col not-md:flex-row not-md:bg-gradient-to-t not-md:from-block not-md:to-bright |
| 61 | }`}> | 64 | }`}> |
| 62 | 65 | ||
| 63 | {/* Header */} | 66 | {/* Header */} |
| 64 | <_Header /> | 67 | <_Header /> |
| 65 | 68 | ||
| 66 | <div className="flex flex-1 overflow-hidden w-full not-md:hidden "> | 69 | <div className="flex flex-1 overflow-hidden w-full"> |
| 67 | <div className={`flex flex-col transition-all duration-300 ${isSearching ? "w-[64px]" : "w-full"}`}> | 70 | <div className={`flex flex-col transition-all duration-300 ${isSearching ? "w-[64px]" : "w-full"}`}> |
| 68 | {/* Sidebar Content */} | 71 | {/* Sidebar Content */} |
| 69 | <_Content isSearching={isSearching} selectedButtonIndex={selectedButtonIndex} handle_sidebar_click={handle_sidebar_click} /> | 72 | <_Content isSearching={isSearching} selectedButtonIndex={selectedButtonIndex} handle_sidebar_click={handle_sidebar_click} /> |
| @@ -73,7 +76,7 @@ const Sidebar: React.FC<SidebarProps> = ({ | |||
| 73 | </div> | 76 | </div> |
| 74 | 77 | ||
| 75 | <div className={`flex bg-panel ${isSearching ? 'w-full' : "w-0"}`}> | 78 | <div className={`flex bg-panel ${isSearching ? 'w-full' : "w-0"}`}> |
| 76 | <_Search profile={profile} /> | 79 | <_Search profile={profile} searchbarRef={searchbarRef} /> |
| 77 | </div> | 80 | </div> |
| 78 | 81 | ||
| 79 | </div> | 82 | </div> |
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> |