From 6df78f254d98453520e8644996b917d673ee3978 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Tue, 23 Sep 2025 15:05:48 -0700 Subject: initial mobile CSS style --- frontend/src/components/NavBar.tsx | 59 +++++++++++++++++++++- .../components/displays/GenericScoreDisplay.tsx | 43 ++++++++-------- frontend/src/components/modals/JsonUploadModal.tsx | 2 +- frontend/src/pages/Home.tsx | 20 ++++---- frontend/src/pages/Import.tsx | 24 ++++----- frontend/src/pages/Landing.tsx | 50 +++++++++--------- frontend/src/pages/Score.tsx | 35 +++++++------ 7 files changed, 147 insertions(+), 86 deletions(-) (limited to 'frontend/src') diff --git a/frontend/src/components/NavBar.tsx b/frontend/src/components/NavBar.tsx index 4be8607..ac70dfb 100644 --- a/frontend/src/components/NavBar.tsx +++ b/frontend/src/components/NavBar.tsx @@ -1,10 +1,13 @@ import { Link } from "react-router"; +import { useState } from "react"; export const NavBar = ({ currentPage, user, handleLogout }: { currentPage: string; user: { username: string }; handleLogout: () => void; }) => { + const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false); + const menuOptions = ( <> setIsMobileMenuOpen(false)} > Home @@ -24,6 +28,7 @@ export const NavBar = ({ currentPage, user, handleLogout }: { ? 'bg-violet-600 text-white shadow-lg shadow-violet-500/25' : 'text-slate-300 hover:text-white hover:bg-slate-800/50' }`} + onClick={() => setIsMobileMenuOpen(false)} > Import Data @@ -34,6 +39,7 @@ export const NavBar = ({ currentPage, user, handleLogout }: { ? 'bg-violet-600 text-white shadow-lg shadow-violet-500/25' : 'text-slate-300 hover:text-white hover:bg-slate-800/50' }`} + onClick={() => setIsMobileMenuOpen(false)} > Community Scores @@ -44,13 +50,16 @@ export const NavBar = ({ currentPage, user, handleLogout }: { ); -}; +}; \ No newline at end of file diff --git a/frontend/src/components/displays/GenericScoreDisplay.tsx b/frontend/src/components/displays/GenericScoreDisplay.tsx index 4201d95..41a125c 100644 --- a/frontend/src/components/displays/GenericScoreDisplay.tsx +++ b/frontend/src/components/displays/GenericScoreDisplay.tsx @@ -269,7 +269,7 @@ const ScoreDisplay: React.FC = ({ if (viewMode === "cards") { return ( -
+
{sortedScores.map((score, index) => { const chartIdHash = SHA1(`${internalGameName}${score.title}${score.artist}`).toString(); // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -279,18 +279,18 @@ const ScoreDisplay: React.FC = ({ return (
{/* Primary Info */}
{!hideTitleArtist && ( -

+

{score.title || score.song || "Unknown Title"}

{score.artist && ( -

+

{score.artist}

)} @@ -306,13 +306,13 @@ const ScoreDisplay: React.FC = ({ {/* Main Stats */} {mainStats.length > 0 && ( -
+
{mainStats.slice(0, 4).map(([key, value]) => ( -
-

+

+

{getDisplayName(key)}

-

+

{renderValue(value, key)}

@@ -335,7 +335,7 @@ const ScoreDisplay: React.FC = ({
{others.map(([key, value]) => ( -
+
{getDisplayName(key)}: @@ -350,7 +350,7 @@ const ScoreDisplay: React.FC = ({ {/* Timestamp */}
-

+

{new Date( typeof timestamp === "number" ? timestamp : timestamp, ).toLocaleDateString()}{" "} @@ -372,21 +372,22 @@ const ScoreDisplay: React.FC = ({ return (

-
- +
+
+
{tableKeys.map((key) => ( ))} {showActions && ( - )} @@ -408,10 +409,10 @@ const ScoreDisplay: React.FC = ({ className="hover:bg-slate-800/30 transition-colors group" > {tableKeys.map((key) => ( - ))} {showActions && ( -
{key === "judgements" ? ( {getDisplayName(key)} ) : ( + Actions + {key === "lamp" || key === "diff_lamp" ? (
- + {score[key] || "No Clear"}
@@ -420,7 +421,7 @@ const ScoreDisplay: React.FC = ({ {renderValue(score[key], key, true)} ) : key === "timestamp" ? ( - + {new Date( typeof score[key] === "number" ? score[key] @@ -428,7 +429,7 @@ const ScoreDisplay: React.FC = ({ ).toLocaleDateString()} ) : key === "username" ? ( - + {score[key] || "Unknown"} ) : ( @@ -441,13 +442,13 @@ const ScoreDisplay: React.FC = ({
+ diff --git a/frontend/src/components/modals/JsonUploadModal.tsx b/frontend/src/components/modals/JsonUploadModal.tsx index 7d8f838..3bb2b9b 100644 --- a/frontend/src/components/modals/JsonUploadModal.tsx +++ b/frontend/src/components/modals/JsonUploadModal.tsx @@ -77,7 +77,7 @@ const JsonUploadModal = ({ isOpen, onClose, onUpload, game }: JsonUploadModalPro /> {/* Modal */} -
+
{/* Header */}
diff --git a/frontend/src/pages/Home.tsx b/frontend/src/pages/Home.tsx index 71ba772..4eb1c59 100644 --- a/frontend/src/pages/Home.tsx +++ b/frontend/src/pages/Home.tsx @@ -75,22 +75,22 @@ const Home = () => { {/* Main Content */} -
+
{/* Header */} -
-

Dashboard

-

+

+

Dashboard

+

Track your rhythm game progress and performance

{/* Supported Games */} -
-
+
+
{supportedGames.map((game) => (
navigate(`/score?game=${game.internalName}`)} >
@@ -120,11 +120,11 @@ const Home = () => {
)}
-
-

+
+

{game.formattedName}

-

+

{game.description}

diff --git a/frontend/src/pages/Import.tsx b/frontend/src/pages/Import.tsx index fe2501f..08976c7 100644 --- a/frontend/src/pages/Import.tsx +++ b/frontend/src/pages/Import.tsx @@ -92,8 +92,8 @@ const Import = () => { }; const JsonUploadCard = () => ( -
-
+
+
{

@@ -148,7 +148,7 @@ const Import = () => {

@@ -193,11 +193,11 @@ const Import = () => { {/* Main Content */} -
+
{/* Header */} -
-

Import Data

-

+

+

Import Data

+

Import your game scores and progress from various sources

@@ -224,10 +224,10 @@ const Import = () => { )} {/* Game Selection Card */} -
-
-

Select Game

-

+

+
+

Select Game

+

Choose the game you want to import data for

diff --git a/frontend/src/pages/Landing.tsx b/frontend/src/pages/Landing.tsx index c607cee..5ca4459 100644 --- a/frontend/src/pages/Landing.tsx +++ b/frontend/src/pages/Landing.tsx @@ -14,16 +14,16 @@ const Landing = () => {
Mirage
-
+
Log In Create Account @@ -32,7 +32,7 @@ const Landing = () => {
-
+
{/* Background Image */}
{ {/* Content */}
-

+

Welcome to Mirage!

-

+

Looks like you're not logged in. If you've got an account,{" "} {

{/* Introduction Section */} -
+
-

+

What is this?

-

+

Mirage is a flexible Rhythm Game Score Tracker that works without relying on predefined seeds. It offers a lightweight alternative that can act - as a holdover for tracking scores when chart metadata isn’t + as a holdover for tracking scores when chart metadata isn't readily available.

@@ -83,13 +83,13 @@ const Landing = () => {
{/* Track Your Scores Section */} -
+
-

+

Track Your Scores

-

+

Mirage lets you import scores from the games you play for safe-keeping, so you can prevent losing them to the void should anything ever happen. @@ -99,13 +99,13 @@ const Landing = () => {

{/* Add your own games */} -
+
-

+

Add Your Own Games

-

+

While not as robust as other seed-based systems. Mirage makes it easy for you to track and keep score for any game, no matter how niche it is. @@ -115,13 +115,13 @@ const Landing = () => {

{/* Join with others */} -
+
-

+

Mirage Together

-

+

Mirage is easily self-hostable and can be used locally for a single person or hosted so you can track scores with your friends. Everything is open-source.

@@ -129,22 +129,22 @@ const Landing = () => {
{/* Call to Action Section */} -
+
-

+

Ready to Start Tracking?

Create Account Log In @@ -154,7 +154,7 @@ const Landing = () => {
{/* Footer */} -