Files
sheetmusictrainer/src/App.css

961 lines
19 KiB
CSS

/* App.css */
.app-container {
display: block;
/* Changed from flex to allow natural document flow */
min-height: 100vh;
background-color: var(--color-bg);
overflow-x: hidden;
max-width: 100vw;
}
.app-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: var(--spacing-sm) var(--spacing-md);
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);
}
@media (max-width: 600px) {
.logo {
display: none;
}
}
.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 {
/* Natural height - not flex to prevent shrinking when footer is present */
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
padding: var(--spacing-md);
gap: var(--spacing-xl);
overflow-x: hidden;
max-width: 100%;
box-sizing: border-box;
}
.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;
box-sizing: border-box;
overflow-x: hidden;
}
.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.4rem 0.8rem;
/* Compact padding by default */
border-radius: 30px;
font-weight: 600;
cursor: pointer;
display: flex;
align-items: center;
gap: 8px;
transition: all 0.2s;
font-size: 0.8rem;
/* Compact font size by default */
}
.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.4rem 0.8rem;
/* Compact padding by default */
border-radius: 30px;
font-weight: 600;
cursor: pointer;
display: flex;
align-items: center;
gap: 8px;
transition: all 0.2s;
font-size: 0.8rem;
/* Compact font size by default */
}
.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;
top: 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);
max-height: 85vh;
overflow-y: auto;
}
.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);
}
.link-button {
background: none;
border: none;
padding: 0;
color: var(--color-primary);
cursor: pointer;
font-family: inherit;
font-size: inherit;
text-decoration: none;
transition: color 0.2s;
}
.link-button:hover {
color: var(--color-primary-dark);
text-decoration: underline;
}
.separator {
margin: 0 8px;
color: #666;
}
.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;
}
@media (max-width: 600px) {
.toggle-option {
padding: 4px 8px;
font-size: 0.75rem;
}
/* Hide help button in favor of settings on small screens */
.help-btn {
display: none;
}
.header-controls {
gap: 4px;
}
/* Fix action row overflow on narrow screens */
.action-row {
flex-wrap: wrap;
gap: 8px !important;
padding: 0 8px;
max-width: 100%;
box-sizing: border-box;
}
/* Reduce card padding on mobile */
.card {
padding: var(--spacing-md);
}
}
.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;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
gap: 0;
min-height: 100vh;
/* Allow growing */
height: auto;
overflow-y: auto;
/* Allow scrolling */
}
.card.sheet-music-card {
max-width: 100%;
width: 100%;
height: auto;
/* Let it grow naturally */
min-height: 100vh;
/* Fill at least the screen */
margin: 0;
border-radius: 0;
align-items: stretch;
box-sizing: border-box;
display: flex;
flex-direction: column;
}
/* 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: 120px;
/* Reduced to allow more space for fretboard */
/* max-height removed to allow full staff visibility */
transform: scale(1.0);
/* No scaling to prevent overflow */
transform-origin: center center;
justify-content: center;
margin-bottom: 5px;
padding-top: 5px;
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;
width: 100%;
max-width: 100%;
padding: 0;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
min-height: 0;
height: auto;
}
/* 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;
width: 100%;
flex: 1;
/* Take remaining space */
display: flex;
align-items: center;
justify-content: center;
/* background: #2a2a2a; Removed hardcoded background to respect theme */
min-height: 100px;
/* Reduced to fit on screen */
max-height: 50vh;
/* Limit height */
padding: 5px 0;
}
/* 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);
}
/* Show settings footer in landscape */
.settings-footer {
display: flex;
margin-top: 20px;
padding-bottom: 40px;
}
/* App container in landscape */
.app-container {
overflow-x: hidden;
overflow-y: auto;
height: auto;
min-height: 100vh;
display: block;
}
.action-row {
margin-top: 5px !important;
width: 100%;
max-width: 100vw;
padding: 5px;
position: static;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
gap: 8px;
background: var(--color-bg);
pointer-events: auto;
box-sizing: border-box;
flex-shrink: 0;
/* Don't shrink */
}
.action-row button {
/* Reset styles for scrolling row */
pointer-events: auto;
width: auto;
height: auto;
background: transparent;
border: none;
box-shadow: none;
border-radius: 0;
padding: 10px;
display: flex;
flex-direction: column;
/* Stack icon/text */
align-items: center;
color: var(--color-text-main);
}
/* Specific Floating Skip Button logic */
.skip-button {
position: fixed;
bottom: 20px;
right: 20px;
z-index: 999;
background-color: var(--color-primary) !important;
color: white !important;
width: 56px !important;
height: 56px !important;
border-radius: 50% !important;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
border: none !important;
}
/* Hide text in floating button, show icon */
.skip-button svg {
width: 24px !important;
height: 24px !important;
margin: 0;
}
.skip-button:active {
transform: scale(0.95);
}
/* Show text labels in scrollable row for others */
.action-row button span,
.action-row button text {
display: block;
font-size: 0.7rem;
margin-top: 4px;
}
/* Adjust icon sizes */
.action-row button svg {
width: 20px;
height: 20px;
}
/* Restore Zen Toggle in Landscape Mobile - Move to top right to avoid Skip button */
.exit-zen-button {
display: block;
transform: scale(0.8);
top: 10px;
bottom: auto;
right: 60px;
/* Left of the settings/help/fullscreen if present, or just top right */
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%;
}