diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-05-19 16:31:57 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-05-19 16:31:57 -0700 |
| commit | 445d5c14eff9beb62f2a20ac5234fbdf40c3c890 (patch) | |
| tree | 48f19f96629968b7f2c26e1ffd611d4ae448e91e | |
| parent | f342dca5bd5e239362768ec80ca478ee3cee608b (diff) | |
frontend: add WMMT, add new section for non-rhythm
| -rw-r--r-- | site/src/components/GameNotes.tsx | 5 | ||||
| -rw-r--r-- | site/src/components/TitleBar.tsx | 80 | ||||
| -rw-r--r-- | site/src/utils.ts | 6 |
3 files changed, 86 insertions, 5 deletions
diff --git a/site/src/components/GameNotes.tsx b/site/src/components/GameNotes.tsx index 0e5504a..82f1629 100644 --- a/site/src/components/GameNotes.tsx +++ b/site/src/components/GameNotes.tsx @@ -392,6 +392,11 @@ export const GameNotes = (isMoe: boolean): Record<string, React.ReactNode> => ({ > Needs to be sideloaded once you get a hold of the IPA. Network features supported. iOS ONLY </p> + <p + className={`mt-3 ${isMoe ? "text-pink-800" : "text-pink-300"} text-right`} + > + *Not in main feed as date data is unavailable from this source + </p> </> ) }); diff --git a/site/src/components/TitleBar.tsx b/site/src/components/TitleBar.tsx index ce70aaa..8016a77 100644 --- a/site/src/components/TitleBar.tsx +++ b/site/src/components/TitleBar.tsx @@ -12,7 +12,9 @@ interface GameCategory { } const TitleBar: React.FC = () => { const [dropdownOpen, setDropdownOpen] = useState(false); + const [otherDropdownOpen, setOtherDropdownOpen] = useState(false); const dropdownRef = useRef<HTMLDivElement>(null); + const otherDropdownRef = useRef<HTMLDivElement>(null); const [searchParams] = useSearchParams(); const navigate = useNavigate(); const location = useLocation(); @@ -95,6 +97,15 @@ const TitleBar: React.FC = () => { }, ]; + const otherGames: GameCategory[] = [ + { + name: "BANDAI NAMCO", + games: [ + { id: "wmmt", title: "WANGAN MAXI" }, + ], + }, + ]; + useEffect(() => { const handleClickOutside = (event: MouseEvent) => { if ( @@ -103,11 +114,18 @@ const TitleBar: React.FC = () => { ) { setDropdownOpen(false); } + if ( + otherDropdownRef.current && + !otherDropdownRef.current.contains(event.target as Node) + ) { + setOtherDropdownOpen(false); + } }; - if (dropdownOpen) + if (dropdownOpen || otherDropdownOpen) document.addEventListener("mousedown", handleClickOutside); - return () => document.removeEventListener("mousedown", handleClickOutside); - }, [dropdownOpen]); + return () => + document.removeEventListener("mousedown", handleClickOutside); + }, [dropdownOpen, otherDropdownOpen]); return ( <div @@ -153,7 +171,7 @@ const TitleBar: React.FC = () => { className={`${isMoe ? "text-pink-800 hover:text-pink-600" : "text-gray-300 hover:text-white"} font-medium flex items-center`} onClick={() => setDropdownOpen(!dropdownOpen)} > - Game Select + Rhythm Games <svg className="w-4 h-4 ml-1" fill="none" @@ -201,6 +219,60 @@ const TitleBar: React.FC = () => { </div> )} </div> + + <div className="relative" ref={otherDropdownRef}> + <button + className={`${isMoe ? "text-pink-800 hover:text-pink-600" : "text-gray-300 hover:text-white"} font-medium flex items-center`} + onClick={() => setOtherDropdownOpen(!otherDropdownOpen)} + > + Other Games + <svg + className="w-4 h-4 ml-1" + fill="none" + stroke="currentColor" + viewBox="0 0 24 24" + > + <path + strokeLinecap="round" + strokeLinejoin="round" + strokeWidth={2} + d="M19 9l-7 7-7-7" + /> + </svg> + </button> + + {otherDropdownOpen && ( + <div + className={`absolute mt-2 w-64 sm:w-80 ${isMoe ? "bg-pink-100 border-pink-300" : "bg-gray-800 border-gray-700"} border rounded-md shadow-lg z-10 right-0`} + > + <div className="py-1 max-h-[70vh] overflow-y-auto scroll-py-2"> + {otherGames.map((category, index) => ( + <div key={index} className="px-2 py-1"> + <div + className={`${isMoe ? "text-pink-600 border-pink-300" : "text-gray-400 border-gray-700"} text-sm font-semibold mb-1 border-b pb-1`} + > + {category.name} + </div> + <div + className={`${category.games.length > 3 ? "grid grid-cols-1 sm:grid-cols-2 gap-x-2 gap-y-0.5" : "space-y-0.5"}`} + > + {category.games.map((game) => ( + <Link + key={game.id} + to={`/game/${game.id}?${searchParams.toString()}`} + className={`${isMoe ? "text-pink-800 hover:bg-pink-200" : "text-gray-300 hover:bg-gray-700 hover:text-white"} block text-left px-2 py-1 text-sm rounded whitespace-nowrap overflow-hidden text-ellipsis`} + onClick={() => setOtherDropdownOpen(false)} + > + {game.title} + </Link> + ))} + </div> + </div> + ))} + </div> + </div> + )} + </div> </div> </div> </div> diff --git a/site/src/utils.ts b/site/src/utils.ts index c6f4ba6..47652da 100644 --- a/site/src/utils.ts +++ b/site/src/utils.ts @@ -22,7 +22,11 @@ export const getGameTitle = (gameId: string) => { if (lowerCaseGameId.startsWith("reflec_beat") || lowerCaseGameId.startsWith("rb_deluxe")) return "REFLEC BEAT DELUXE PLUS"; if (lowerCaseGameId.startsWith("dance_rush")) return "DANCERUSH"; if(lowerCaseGameId.startsWith("dance_around")) return "DANCE aROUND"; - if(lowerCaseGameId.startsWith("polaris_chord")) return "POLARIS CHORD/ポラリスコード" + if(lowerCaseGameId.startsWith("polaris_chord")) return "POLARIS CHORD/ポラリスコード"; + if(lowerCaseGameId.startsWith("wmmt")) return "WANGAN MIDNIGHT MAXIMUM TUNE"; + if(lowerCaseGameId.startsWith("wangan_maxi_jp")) return "WANGAN MIDNIGHT MAXIMUM TUNE (JAPAN)"; + if(lowerCaseGameId.startsWith("wangan_maxi_na")) return "WANGAN MIDNIGHT MAXIMUM TUNE (NORTH AMERICA)"; + if(lowerCaseGameId.startsWith("wangan_maxi_asia_oce")) return "WANGAN MIDNIGHT MAXIMUM TUNE (ASIA/OCEANIA)"; return gameId.toUpperCase(); |
