mirror of
https://github.com/9x/sheetmusictrainer.git
synced 2026-09-02 09:34:33 +02:00
Zen mode
This commit is contained in:
46
src/App.css
46
src/App.css
@@ -296,3 +296,49 @@
|
|||||||
background-color: rgba(var(--hue-primary), 0.1);
|
background-color: rgba(var(--hue-primary), 0.1);
|
||||||
transform: translateY(-2px);
|
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);
|
||||||
|
}
|
||||||
37
src/App.tsx
37
src/App.tsx
@@ -40,7 +40,8 @@ function App() {
|
|||||||
autoAdvance: false,
|
autoAdvance: false,
|
||||||
sound: true,
|
sound: true,
|
||||||
volume: 0.5
|
volume: 0.5
|
||||||
}
|
},
|
||||||
|
zenMode: false
|
||||||
});
|
});
|
||||||
|
|
||||||
const [matchStartTime, setMatchStartTime] = useState<number | null>(null);
|
const [matchStartTime, setMatchStartTime] = useState<number | null>(null);
|
||||||
@@ -173,10 +174,12 @@ function App() {
|
|||||||
}, [settings.showHint, targetMidi, currentTuning, currentInstrumentDef]);
|
}, [settings.showHint, targetMidi, currentTuning, currentInstrumentDef]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="app-container">
|
<div className={`app-container ${settings.zenMode ? 'zen-mode' : ''}`}>
|
||||||
|
{!settings.zenMode && (
|
||||||
<header className="app-header">
|
<header className="app-header">
|
||||||
<div className="logo">Sheet music trainer</div>
|
<div className="logo">Sheet music trainer</div>
|
||||||
</header>
|
</header>
|
||||||
|
)}
|
||||||
|
|
||||||
<main className="main-stage">
|
<main className="main-stage">
|
||||||
<div className="card sheet-music-card">
|
<div className="card sheet-music-card">
|
||||||
@@ -190,6 +193,7 @@ function App() {
|
|||||||
height={currentInstrumentDef.clefMode === 'grand' ? 300 : 250}
|
height={currentInstrumentDef.clefMode === 'grand' ? 300 : 250}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{!settings.zenMode && (
|
||||||
<div className="feedback-area">
|
<div className="feedback-area">
|
||||||
{feedbackMessage ? (
|
{feedbackMessage ? (
|
||||||
<div className="success-message animate-pop">{feedbackMessage}</div>
|
<div className="success-message animate-pop">{feedbackMessage}</div>
|
||||||
@@ -197,6 +201,7 @@ function App() {
|
|||||||
<div className="instruction-text">Play the note above</div>
|
<div className="instruction-text">Play the note above</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{settings.showHint && (
|
{settings.showHint && (
|
||||||
<div className="hint-card">
|
<div className="hint-card">
|
||||||
@@ -211,6 +216,7 @@ function App() {
|
|||||||
|
|
||||||
{error && <div className="error-message">{error}</div>}
|
{error && <div className="error-message">{error}</div>}
|
||||||
|
|
||||||
|
{!settings.zenMode && (
|
||||||
<div className="action-row" style={{ marginTop: '24px', display: 'flex', justifyContent: 'center', gap: '16px' }}>
|
<div className="action-row" style={{ marginTop: '24px', display: 'flex', justifyContent: 'center', gap: '16px' }}>
|
||||||
<button
|
<button
|
||||||
className={`hint-button ${settings.showHint ? 'active' : ''}`}
|
className={`hint-button ${settings.showHint ? 'active' : ''}`}
|
||||||
@@ -223,9 +229,20 @@ function App() {
|
|||||||
<SkipForward size={18} />
|
<SkipForward size={18} />
|
||||||
Skip Note
|
Skip Note
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
className="zen-button"
|
||||||
|
onClick={() => setSettings(s => ({ ...s, zenMode: true }))}
|
||||||
|
title="Zen Mode"
|
||||||
|
>
|
||||||
|
<span>Zen</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
!settings.zenMode && (
|
||||||
<div className="pitch-monitor-bar">
|
<div className="pitch-monitor-bar">
|
||||||
<button
|
<button
|
||||||
className={`mic-button ${listening ? 'listening' : ''}`}
|
className={`mic-button ${listening ? 'listening' : ''}`}
|
||||||
@@ -252,11 +269,27 @@ function App() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
</main >
|
</main >
|
||||||
|
|
||||||
|
{!settings.zenMode && (
|
||||||
<footer className="settings-footer">
|
<footer className="settings-footer">
|
||||||
<Controls settings={settings} onUpdateSettings={setSettings} />
|
<Controls settings={settings} onUpdateSettings={setSettings} />
|
||||||
</footer>
|
</footer>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
settings.zenMode && (
|
||||||
|
<button
|
||||||
|
className="exit-zen-button"
|
||||||
|
onClick={() => setSettings(s => ({ ...s, zenMode: false }))}
|
||||||
|
>
|
||||||
|
Exit Zen Mode
|
||||||
|
</button>
|
||||||
|
)
|
||||||
|
}
|
||||||
</div >
|
</div >
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export interface AppSettings {
|
|||||||
instrument: string;
|
instrument: string;
|
||||||
showTuningMeter: boolean;
|
showTuningMeter: boolean;
|
||||||
rhythm: RhythmSettings;
|
rhythm: RhythmSettings;
|
||||||
|
zenMode: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ControlsProps {
|
interface ControlsProps {
|
||||||
|
|||||||
Reference in New Issue
Block a user