From 30a52529d42498f0737df5bb67279981bb696240 Mon Sep 17 00:00:00 2001 From: Jens Mohrmann Date: Sun, 21 Dec 2025 22:39:18 +0100 Subject: [PATCH] Zen mode --- src/App.css | 46 ++++++++++++ src/App.tsx | 143 ++++++++++++++++++++++-------------- src/components/Controls.tsx | 1 + 3 files changed, 135 insertions(+), 55 deletions(-) diff --git a/src/App.css b/src/App.css index 8f1af59..78a1a3e 100644 --- a/src/App.css +++ b/src/App.css @@ -295,4 +295,50 @@ .hint-button:hover { background-color: rgba(var(--hue-primary), 0.1); transform: translateY(-2px); +} + +.zen-button { + background-color: transparent; + border: 2px solid var(--color-text-muted); + color: var(--color-text-muted); + padding: 0.5rem 1rem; + border-radius: 30px; + font-weight: 600; + cursor: pointer; + display: flex; + align-items: center; + gap: 8px; + transition: all 0.2s; + font-size: 0.9rem; +} + +.zen-button:hover { + border-color: var(--color-text-main); + color: var(--color-text-main); + background-color: rgba(128, 128, 128, 0.1); + transform: translateY(-2px); +} + +.exit-zen-button { + position: fixed; + bottom: 20px; + right: 20px; + padding: 10px 20px; + background: var(--color-surface); + border: 1px solid var(--color-text-muted); + border-radius: 20px; + color: var(--color-text-muted); + cursor: pointer; + opacity: 0.5; + transition: all 0.2s; + z-index: 100; + font-weight: 600; + box-shadow: var(--shadow-md); +} + +.exit-zen-button:hover { + opacity: 1; + color: var(--color-text-main); + border-color: var(--color-text-main); + transform: scale(1.05); } \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index 03ec827..5b6a378 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -40,7 +40,8 @@ function App() { autoAdvance: false, sound: true, volume: 0.5 - } + }, + zenMode: false }); const [matchStartTime, setMatchStartTime] = useState(null); @@ -173,10 +174,12 @@ function App() { }, [settings.showHint, targetMidi, currentTuning, currentInstrumentDef]); return ( -
-
-
Sheet music trainer
-
+
+ {!settings.zenMode && ( +
+
Sheet music trainer
+
+ )}
@@ -190,13 +193,15 @@ function App() { height={currentInstrumentDef.clefMode === 'grand' ? 300 : 250} /> -
- {feedbackMessage ? ( -
{feedbackMessage}
- ) : ( -
Play the note above
- )} -
+ {!settings.zenMode && ( +
+ {feedbackMessage ? ( +
{feedbackMessage}
+ ) : ( +
Play the note above
+ )} +
+ )} {settings.showHint && (
@@ -211,53 +216,81 @@ function App() { {error &&
{error}
} -
- - -
-
- -
- - - {settings.showTuningMeter && pitchData ? ( - - ) : ( -
- {pitchData ? ( - <> - - {pitchData.note} - - {Math.round(pitchData.frequency)} Hz - - ) : ( - {listening ? "Listening..." : "Mic Off"} - )} + {!settings.zenMode && ( +
+ + +
)}
-
-
- -
-
+ + { + !settings.zenMode && ( +
+ + + {settings.showTuningMeter && pitchData ? ( + + ) : ( +
+ {pitchData ? ( + <> + + {pitchData.note} + + {Math.round(pitchData.frequency)} Hz + + ) : ( + {listening ? "Listening..." : "Mic Off"} + )} +
+ )} +
+ ) + } + + + {!settings.zenMode && ( +
+ +
+ ) + } + + { + settings.zenMode && ( + + ) + } +
); } diff --git a/src/components/Controls.tsx b/src/components/Controls.tsx index 8f1bbd2..b529fec 100644 --- a/src/components/Controls.tsx +++ b/src/components/Controls.tsx @@ -22,6 +22,7 @@ export interface AppSettings { instrument: string; showTuningMeter: boolean; rhythm: RhythmSettings; + zenMode: boolean; } interface ControlsProps {