- Lesson screen HTML with letter-area and keyboard containers - initLessonScreen: renders keyboard, shows letters, handles keypress - Correct key dissolves letter with animation, advances to next - Wrong key does nothing (per D-03), correct key stays highlighted - startLesson in app.ts: manages lesson lifecycle and cleanup - onComplete: updates progress, unlocks next level, saves to IndexedDB - CSS: floating letter animation, dissolve effect on correct press Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
289 lines
4.8 KiB
CSS
289 lines
4.8 KiB
CSS
/* Zauberwald Design System */
|
|
|
|
:root {
|
|
/* Grundpalette — warm, einladend, Waldstimmung */
|
|
--bg-cream: #fff8f0;
|
|
--bg-forest: #e8f5e4;
|
|
--text-dark: #3d3225;
|
|
--text-warm: #5c4a3a;
|
|
--text-light: #8b7d6b;
|
|
--accent-green: #6db87d;
|
|
--accent-gold: #e8b84b;
|
|
--accent-pink: #e88bae;
|
|
--accent-purple: #9b7dc4;
|
|
--accent-blue: #7db8d4;
|
|
|
|
/* Fingerfarben — weiche Pastelltoene */
|
|
--finger-l-pinky: #e8b4c8;
|
|
--finger-l-ring: #c4a8d4;
|
|
--finger-l-mid: #a8c4e0;
|
|
--finger-l-index: #a8d8b8;
|
|
--finger-r-index: #d4d8a8;
|
|
--finger-r-mid: #e0c4a8;
|
|
--finger-r-ring: #d4a8a8;
|
|
--finger-r-pinky: #c8b4e8;
|
|
--finger-thumb: #d4cfc8;
|
|
}
|
|
|
|
/* Base styles */
|
|
body {
|
|
font-family: "Nunito", sans-serif;
|
|
background: var(--bg-cream);
|
|
color: var(--text-dark);
|
|
font-size: 16px;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
h1,
|
|
h2,
|
|
h3 {
|
|
font-family: "Quicksand", sans-serif;
|
|
}
|
|
|
|
/* Screen management */
|
|
.screen {
|
|
display: none;
|
|
opacity: 0;
|
|
transition: opacity 0.3s ease;
|
|
}
|
|
|
|
.screen--active {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
opacity: 1;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
/* Welcome screen */
|
|
.welcome {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
padding: 2rem;
|
|
max-width: 600px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.welcome h1 {
|
|
font-family: "Quicksand", sans-serif;
|
|
font-size: 2rem;
|
|
color: var(--text-dark);
|
|
}
|
|
|
|
.welcome__subtitle,
|
|
.welcome__layout-label {
|
|
font-size: 1.1rem;
|
|
color: var(--text-warm);
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.welcome__companions {
|
|
display: grid;
|
|
grid-template-columns: repeat(2, 1fr);
|
|
gap: 1rem;
|
|
width: 100%;
|
|
}
|
|
|
|
.companion-card {
|
|
background: white;
|
|
border: 3px solid transparent;
|
|
border-radius: 16px;
|
|
padding: 1.5rem;
|
|
cursor: pointer;
|
|
transition: border-color 0.2s;
|
|
text-align: center;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.companion-card:hover {
|
|
border-color: var(--accent-gold);
|
|
}
|
|
|
|
.companion-card--selected {
|
|
border-color: var(--accent-green);
|
|
background: var(--bg-forest);
|
|
}
|
|
|
|
.companion-card__emoji {
|
|
font-size: 3rem;
|
|
}
|
|
|
|
.companion-card__name {
|
|
font-family: "Quicksand", sans-serif;
|
|
font-weight: 600;
|
|
font-size: 1.2rem;
|
|
color: var(--text-dark);
|
|
}
|
|
|
|
.welcome__layout-toggle {
|
|
display: flex;
|
|
gap: 0.5rem;
|
|
margin-top: 0.5rem;
|
|
}
|
|
|
|
.layout-btn {
|
|
padding: 0.5rem 1.5rem;
|
|
border-radius: 8px;
|
|
border: 2px solid var(--text-light);
|
|
background: white;
|
|
cursor: pointer;
|
|
font-family: "Nunito", sans-serif;
|
|
font-size: 1rem;
|
|
}
|
|
|
|
.layout-btn--active {
|
|
background: var(--accent-green);
|
|
color: white;
|
|
border-color: var(--accent-green);
|
|
}
|
|
|
|
.welcome__start-btn {
|
|
margin-top: 1.5rem;
|
|
padding: 1rem 3rem;
|
|
border-radius: 12px;
|
|
background: var(--accent-green);
|
|
color: white;
|
|
border: none;
|
|
font-family: "Quicksand", sans-serif;
|
|
font-weight: 700;
|
|
font-size: 1.3rem;
|
|
cursor: pointer;
|
|
opacity: 1;
|
|
transition: opacity 0.2s;
|
|
}
|
|
|
|
.welcome__start-btn:disabled {
|
|
opacity: 0.4;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
/* Lesson screen */
|
|
.lesson {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 2rem;
|
|
padding: 2rem;
|
|
min-height: 100vh;
|
|
background: var(--bg-cream);
|
|
}
|
|
|
|
.lesson__letter-area {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 200px;
|
|
height: 200px;
|
|
}
|
|
|
|
.falling-letter {
|
|
font-family: "Quicksand", sans-serif;
|
|
font-size: 5rem;
|
|
font-weight: 700;
|
|
color: var(--accent-green);
|
|
animation: letter-float 2s ease-in-out infinite;
|
|
}
|
|
|
|
@keyframes letter-float {
|
|
0%,
|
|
100% {
|
|
transform: translateY(0);
|
|
}
|
|
50% {
|
|
transform: translateY(-10px);
|
|
}
|
|
}
|
|
|
|
.falling-letter--dissolve {
|
|
animation: letter-dissolve 0.3s ease-out forwards;
|
|
}
|
|
|
|
@keyframes letter-dissolve {
|
|
0% {
|
|
transform: scale(1);
|
|
opacity: 1;
|
|
}
|
|
100% {
|
|
transform: scale(1.5);
|
|
opacity: 0;
|
|
}
|
|
}
|
|
|
|
/* Keyboard */
|
|
.keyboard {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 4px;
|
|
padding: 1rem;
|
|
background: rgba(255, 255, 255, 0.6);
|
|
border-radius: 12px;
|
|
user-select: none;
|
|
}
|
|
|
|
.keyboard__row {
|
|
display: flex;
|
|
gap: 4px;
|
|
}
|
|
|
|
.keyboard__key {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 44px;
|
|
height: 44px;
|
|
border-radius: 8px;
|
|
font-family: "Quicksand", sans-serif;
|
|
font-weight: 700;
|
|
font-size: 1rem;
|
|
color: var(--text-dark);
|
|
background: #e0e0e0;
|
|
transition:
|
|
transform 0.1s ease,
|
|
background-color 0.2s ease,
|
|
box-shadow 0.2s ease;
|
|
cursor: default;
|
|
}
|
|
|
|
.keyboard__key--space {
|
|
width: 280px;
|
|
}
|
|
|
|
.keyboard__key--inactive {
|
|
background: #e0e0e0;
|
|
color: var(--text-light);
|
|
opacity: 0.5;
|
|
}
|
|
|
|
.keyboard__key--active {
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
/* Pulse animation for the target key (KYBD-03) */
|
|
.keyboard__key--highlight {
|
|
animation: key-pulse 1.2s ease-in-out infinite;
|
|
box-shadow: 0 0 12px rgba(232, 184, 75, 0.6);
|
|
}
|
|
|
|
@keyframes key-pulse {
|
|
0%,
|
|
100% {
|
|
transform: scale(1);
|
|
}
|
|
50% {
|
|
transform: scale(1.08);
|
|
}
|
|
}
|
|
|
|
/* Press animation (KYBD-03) */
|
|
.keyboard__key--pressed {
|
|
transform: scale(0.9) !important;
|
|
animation: none;
|
|
}
|