Files
sheetmusictrainer/src/App.css
2025-12-27 18:12:32 +01:00

827 lines
16 KiB
CSS

/* App.css */
.app-container {
display: flex;
flex-direction: column;
min-height: 100vh;
background-color: var(--color-bg);
}
.app-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: var(--spacing-sm) var(--spacing-xl);
background-color: var(--color-surface);
box-shadow: var(--shadow-sm);
}
.logo {
font-family: var(--font-family-serif);
font-weight: 700;
font-size: 1.5rem;
letter-spacing: -0.02em;
color: var(--color-primary);
}
.streak-badge {
background-color: var(--color-primary-dark);
color: white;
padding: var(--spacing-xs) var(--spacing-md);
border-radius: var(--radius-lg);
font-weight: 600;
}
.main-stage {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: var(--spacing-md);
gap: var(--spacing-xl);
}
.card {
background-color: var(--color-surface);
border-radius: var(--radius-md);
box-shadow: var(--shadow-lg);
padding: var(--spacing-xl);
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
max-width: 600px;
transition: max-width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.2s ease;
}
.card.has-hint {
max-width: 850px;
}
.sheet-music-container {
display: flex;
justify-content: center;
width: 100%;
overflow: hidden;
}
.feedback-area {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 1000;
pointer-events: none;
width: auto;
height: auto;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
}
.success-message {
color: white;
background-color: rgba(0, 0, 0, 0.75);
padding: 1rem 2rem;
border-radius: 40px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
backdrop-filter: blur(4px);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
line-height: 1.1;
text-align: center;
}
.success-prefix {
font-size: 1.5rem;
font-weight: 700;
opacity: 0.9;
text-transform: uppercase;
letter-spacing: 0.05em;
margin-bottom: 0.2rem;
}
.success-note {
font-size: 4rem;
font-weight: 800;
text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.instruction-text {
display: none;
}
.error-message {
color: var(--color-error);
margin-top: var(--spacing-md);
}
.hint-card {
margin-top: var(--spacing-md);
padding: var(--spacing-md);
background-color: var(--color-bg);
border-radius: var(--radius-sm);
width: 100%;
text-align: center;
}
.hint-note {
font-size: var(--font-size-lg);
font-weight: bold;
margin-bottom: var(--spacing-xs);
}
.hint-positions {
display: flex;
flex-wrap: wrap;
gap: var(--spacing-xs);
justify-content: center;
}
.hint-tag {
background-color: var(--color-surface);
border: 1px solid var(--color-text-muted);
padding: 2px 8px;
border-radius: 4px;
font-size: 0.8rem;
color: var(--color-text-main);
}
/* Force button colors to ensure dark mode visibility */
button {
color: var(--color-text-main);
}
/* Pitch Monitor Bar */
.pitch-monitor-bar {
display: flex;
align-items: center;
gap: var(--spacing-xl);
}
.mic-button {
background-color: var(--color-surface);
border: 2px solid var(--color-text-muted);
color: var(--color-text-muted);
width: 64px;
height: 64px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.2s ease;
}
.mic-button:hover {
background-color: var(--color-bg);
color: var(--color-text-main);
}
.mic-button.listening {
border-color: var(--color-primary);
color: var(--color-primary);
box-shadow: 0 0 15px rgba(var(--hue-primary), 0.3);
}
.pitch-readout {
display: flex;
flex-direction: column;
min-width: 100px;
}
.detected-note {
font-size: 3rem;
font-weight: 800;
line-height: 1;
color: var(--color-text-muted);
}
.detected-note.match {
color: var(--color-success);
}
.detected-hz {
font-size: 0.9rem;
color: var(--color-text-muted);
}
/* Controls Footer */
.settings-footer {
background-color: var(--color-surface);
padding: var(--spacing-md);
display: flex;
flex-direction: column;
align-items: center;
gap: var(--spacing-md);
border-top: 1px solid rgba(0, 0, 0, 0.05);
}
.controls-container {
display: flex;
flex-direction: column;
gap: var(--spacing-lg);
width: 100%;
max-width: 800px;
}
.settings-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--spacing-md);
width: 100%;
}
.tools-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: var(--spacing-md);
width: 100%;
align-items: start;
}
/* Mobile: Stack everything */
@media (max-width: 600px) {
.settings-grid,
.tools-grid {
grid-template-columns: 1fr;
}
}
.control-group {
display: flex;
flex-direction: column;
gap: var(--spacing-xs);
width: 100%;
}
.control-label {
display: flex;
align-items: center;
gap: var(--spacing-xs);
font-size: 0.8rem;
color: var(--color-text-muted);
text-transform: uppercase;
letter-spacing: 0.05em;
}
.control-select {
padding: var(--spacing-sm);
border-radius: var(--radius-sm);
border: 1px solid #ddd;
font-family: inherit;
font-size: 0.9rem;
background-color: var(--color-bg);
}
.control-button {
background: none;
border: none;
cursor: pointer;
color: var(--color-text-muted);
padding: var(--spacing-sm);
transition: color 0.2s;
}
.control-button.active {
color: var(--color-primary);
}
/* Animations */
@keyframes pop {
0% {
transform: scale(0.8);
opacity: 0;
}
50% {
transform: scale(1.1);
}
100% {
transform: scale(1);
opacity: 1;
}
}
.animate-pop {
animation: pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
/* Switch Button for Metronome */
.switch-button {
width: 44px;
height: 24px;
border-radius: 99px;
background-color: #ddd;
position: relative;
cursor: pointer;
transition: background-color 0.2s;
padding: 0;
border: none;
display: flex;
align-items: center;
}
.switch-button.active {
background-color: var(--color-primary);
}
.switch-thumb {
width: 18px;
height: 18px;
background-color: white;
border-radius: 50%;
position: absolute;
left: 3px;
transition: transform 0.2s;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.switch-button.active .switch-thumb {
transform: translateX(17px);
}
/* Hint Button styling - similar to skip button but distinct */
.hint-button {
background-color: transparent;
border: 2px solid var(--color-primary);
color: var(--color-primary);
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;
}
.hint-button:hover {
background-color: rgba(var(--hue-primary), 0.1);
transform: translateY(-2px);
}
.hint-button.active {
background-color: var(--color-primary);
color: white;
box-shadow: 0 4px 12px rgba(var(--hue-primary), 0.3);
}
.hint-button.active:hover {
background-color: var(--color-primary-dark);
}
.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);
}
/* Help Popup */
.help-popup-overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 200;
backdrop-filter: blur(4px);
animation: fadeIn 0.2s ease-out;
}
.help-popup {
background-color: var(--color-surface);
padding: var(--spacing-lg);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-lg);
max-width: 400px;
width: 90%;
position: relative;
border: 1px solid rgba(128, 128, 128, 0.1);
}
.help-item {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: var(--spacing-sm);
padding-bottom: var(--spacing-sm);
border-bottom: 1px solid rgba(128, 128, 128, 0.1);
}
.help-item:last-child {
border-bottom: none;
margin-bottom: 0;
padding-bottom: 0;
}
.shortcut-key {
background-color: var(--color-bg);
border: 1px solid rgba(128, 128, 128, 0.2);
padding: 2px 8px;
border-radius: 4px;
font-family: monospace;
font-weight: bold;
color: var(--color-text-main);
}
.help-close {
position: absolute;
top: 10px;
right: 10px;
background: none;
border: none;
cursor: pointer;
color: var(--color-text-muted);
}
.help-close:hover {
color: var(--color-text-main);
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* Header Adjustments */
.app-header-left {
display: flex;
flex-direction: column;
}
.app-subtitle {
font-size: 0.8rem;
font-weight: 500;
color: var(--color-text-muted);
}
.app-subtitle a {
color: var(--color-primary);
text-decoration: none;
transition: color 0.2s;
}
.app-subtitle a:hover {
color: var(--color-primary-dark);
text-decoration: underline;
}
.header-controls {
display: flex;
gap: var(--spacing-sm);
align-items: center;
}
.icon-button {
background: none;
border: none;
cursor: pointer;
color: var(--color-text-muted);
padding: 8px;
border-radius: 50%;
transition: all 0.2s;
display: flex;
align-items: center;
justify-content: center;
}
.icon-button:hover {
background-color: rgba(128, 128, 128, 0.1);
color: var(--color-text-main);
}
.game-mode-toggle {
display: flex;
background-color: var(--color-bg);
padding: 2px;
border-radius: 20px;
border: 1px solid rgba(128, 128, 128, 0.1);
}
.toggle-option {
padding: 4px 12px;
border-radius: 16px;
font-size: 0.85rem;
font-weight: 600;
cursor: pointer;
background: transparent;
border: none;
color: var(--color-text-muted);
transition: all 0.2s;
}
.toggle-option.active {
background-color: var(--color-surface);
color: var(--color-primary);
box-shadow: var(--shadow-sm);
}
/* Mobile Landscape Optimization */
/* Staff Row Wrapper (Removed) */
/* .side-hint-note (Removed) */
/* Mobile Landscape Optimization */
@media (max-height: 500px) and (orientation: landscape) {
.app-header {
padding: 2px var(--spacing-md);
position: absolute;
/* Take out of flow to save space */
top: 0;
left: 0;
right: 0;
width: 100%;
z-index: 100;
background: transparent;
pointer-events: none;
/* Let clicks pass through to content */
box-shadow: none;
}
/* Hide Title/Logo to save space for content */
.app-header-left {
display: none;
}
.header-controls {
pointer-events: auto;
/* Re-enable clicks for buttons */
margin-left: auto;
/* Push to right */
padding-right: 10px;
}
.main-stage {
padding: 0;
flex-direction: column;
align-items: center;
justify-content: center;
/* Center vertically */
gap: 0;
height: 100vh;
/* Fixed viewport height */
overflow: hidden;
/* No scrolling for main game loop */
position: relative;
}
.card.sheet-music-card {
max-width: 95vw;
height: 100%;
max-height: none;
flex-direction: column;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
padding: 0;
width: 100%;
background: transparent;
box-shadow: none;
border: none;
flex-shrink: 0;
}
/* Staff Row: Horizontal Layout for Staff + Note Name */
.staff-row {
flex-direction: row;
justify-content: center;
align-items: center;
width: 100%;
margin-top: 20px;
/* Space from top */
margin-bottom: 0;
gap: 16px;
flex: 0 0 auto;
z-index: 1;
}
.side-hint-note {
display: block;
font-size: 1.5rem;
margin-right: 0;
z-index: 10;
flex-shrink: 0;
}
/* BIGGER STAFF */
.sheet-music-container {
width: 100%;
flex: 0 0 auto;
min-height: 180px;
/* Increased from 150px */
transform: scale(1.1);
/* Scale UP */
transform-origin: center center;
justify-content: center;
margin-bottom: -10px;
/* Pull fretboard closer */
padding-top: 0;
z-index: 1;
}
.card.sheet-music-card.zen-mode .sheet-music-container {
margin-bottom: 0;
}
/* Hint card container (Fretboard + Note Name) */
.hint-card {
margin-top: 0;
flex: 1 1 auto;
width: 100%;
max-width: 100%;
padding: 0 10px;
background: transparent;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 8px;
min-height: 0;
max-height: 200px;
/* Cap fretboard height */
}
/* The note name inside hint card */
.hint-card .hint-note {
display: block;
font-size: 2rem;
margin-bottom: 0;
flex-shrink: 0;
font-weight: 800;
width: 4rem;
text-align: center;
}
/* Fretboard Container - Responsive adjustments */
.fretboard-container {
transform: none;
max-width: none;
flex-grow: 1;
height: 100%;
/* Ensure it fills the space but respects container limits */
}
/* Hide Instruction Text ("Play note above") */
.instruction-text {
display: none;
}
/* OVERLAY FEEDBACK - Replaces reserved space */
/* Remove local overrides since global is now overlay */
.feedback-area {
/* Use global settings but ensure visibility triggers work */
opacity: 0;
}
/* Show feedback overlay when it has content (requires slight JS tweak or CSS hack if empty div stays)
Assuming .feedback-area always exists, we target the message inside
*/
.feedback-area:has(.success-message),
.feedback-area:has(.error-message) {
opacity: 1;
}
.success-message {
color: white;
/* Make text white for contrast on dark overlay */
font-size: 2rem;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
/* Push settings way down so they don't interfere with main view */
.settings-footer {
margin-top: 50px;
padding-bottom: 50px;
}
/* Make main stage scrollable to reach settings */
.app-container {
overflow-y: auto;
height: 100vh;
display: block;
/* Break flex height lock */
}
/* Action Buttons - floating or tucked */
.action-row {
margin-top: 0 !important;
width: 100%;
padding-bottom: 5px;
flex-shrink: 0;
position: absolute;
bottom: 2px;
z-index: 20;
pointer-events: none;
/* Pass through clicks */
justify-content: center;
gap: 20px;
}
.action-row button {
pointer-events: auto;
/* Enable buttons */
background: rgba(255, 255, 255, 0.9);
border: 1px solid #ccc;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
/* Restore Zen Toggle in Landscape Mobile */
.exit-zen-button {
display: block;
transform: scale(0.8);
bottom: 45px;
/* Move up above action row */
right: 5px;
padding: 6px 12px;
font-size: 0.8rem;
background: rgba(255, 255, 255, 0.9);
border: 1px solid #ccc;
z-index: 100;
}
.hint-button,
.skip-button {
padding: 4px 16px;
font-size: 0.9rem;
height: 36px;
}
/* Pitch monitor: Top left absolute */
.pitch-monitor-bar {
position: absolute;
top: 5px;
left: 10px;
margin: 0;
gap: var(--spacing-sm);
transform: scale(0.7);
transform-origin: top left;
z-index: 100;
}
.mic-button {
width: 48px;
height: 48px;
background: rgba(255, 255, 255, 0.9);
}
}
/* Ensure FretboardHint container handles flexible width generic */
.fretboard-container {
width: 100%;
}