diff options
| author | Wolfboy248 <georgejvindkarlsen@gmail.com> | 2025-08-21 10:33:27 +0200 |
|---|---|---|
| committer | Wolfboy248 <georgejvindkarlsen@gmail.com> | 2025-08-21 10:33:27 +0200 |
| commit | da1fd74f9387149b2b94d62853587a8afdb74ddd (patch) | |
| tree | 57f13021890b6d27848a3379d0869790fd1d7c97 /frontend/src/pages/Maplist/Components | |
| parent | organised pages, started work on theme (diff) | |
| download | lphub-da1fd74f9387149b2b94d62853587a8afdb74ddd.tar.gz lphub-da1fd74f9387149b2b94d62853587a8afdb74ddd.tar.bz2 lphub-da1fd74f9387149b2b94d62853587a8afdb74ddd.zip | |
Reorganised Maplist and Sidebar
Diffstat (limited to 'frontend/src/pages/Maplist/Components')
| -rw-r--r-- | frontend/src/pages/Maplist/Components/Map.tsx | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/frontend/src/pages/Maplist/Components/Map.tsx b/frontend/src/pages/Maplist/Components/Map.tsx new file mode 100644 index 0000000..5451830 --- /dev/null +++ b/frontend/src/pages/Maplist/Components/Map.tsx | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | import React from "react"; | ||
| 2 | import { Link } from "react-router-dom"; | ||
| 3 | import type { Map } from "@customTypes/Map"; | ||
| 4 | |||
| 5 | interface MapProps { | ||
| 6 | map: Map; | ||
| 7 | catNum: number; | ||
| 8 | }; | ||
| 9 | |||
| 10 | const Map: React.FC<MapProps> = ({ map, catNum }) => { | ||
| 11 | return ( | ||
| 12 | |||
| 13 | <div className="bg-panel rounded-3xl overflow-hidden"> | ||
| 14 | <Link to={`/maps/${map.id}`}> | ||
| 15 | <span className="text-center text-base sm:text-xl w-full block my-1.5 text-foreground truncate"> | ||
| 16 | {map.name} | ||
| 17 | </span> | ||
| 18 | <div | ||
| 19 | className="flex h-40 sm:h-48 bg-cover relative" | ||
| 20 | style={{ backgroundImage: `url(${map.image})` }} | ||
| 21 | > | ||
| 22 | <div className="backdrop-blur-sm w-full flex items-center justify-center"> | ||
| 23 | <span className="text-3xl sm:text-5xl font-barlow-semicondensed-semibold text-white mr-1.5"> | ||
| 24 | {map.is_disabled | ||
| 25 | ? map.category_portals[0].portal_count | ||
| 26 | : map.category_portals.find( | ||
| 27 | obj => obj.category.id === catNum + 1 | ||
| 28 | )?.portal_count} | ||
| 29 | </span> | ||
| 30 | <span className="text-2xl sm:text-4xl font-barlow-semicondensed-regular text-white"> | ||
| 31 | portals | ||
| 32 | </span> | ||
| 33 | </div> | ||
| 34 | </div> | ||
| 35 | |||
| 36 | <div className="flex mx-5 my-4"> | ||
| 37 | <div className="flex w-full items-center justify-center gap-1.5 rounded-[2000px] ml-0.5 translate-y-px"> | ||
| 38 | {[1, 2, 3, 4, 5].map((point) => ( | ||
| 39 | <div | ||
| 40 | key={point} | ||
| 41 | className={`flex h-[3px] w-full rounded-3xl ${point <= (map.difficulty + 1) | ||
| 42 | ? map.difficulty === 0 | ||
| 43 | ? "bg-green-500" | ||
| 44 | : map.difficulty === 1 || map.difficulty === 2 | ||
| 45 | ? "bg-lime-500" | ||
| 46 | : map.difficulty === 3 | ||
| 47 | ? "bg-red-400" | ||
| 48 | : "bg-red-600" | ||
| 49 | : "bg-block" | ||
| 50 | }`} | ||
| 51 | /> | ||
| 52 | ))} | ||
| 53 | </div> | ||
| 54 | </div> | ||
| 55 | </Link> | ||
| 56 | </div> | ||
| 57 | ); | ||
| 58 | }; | ||
| 59 | |||
| 60 | export default Map; | ||