-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpractice.html
More file actions
226 lines (210 loc) · 9.68 KB
/
practice.html
File metadata and controls
226 lines (210 loc) · 9.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>TypingSchool | Practice</title>
<script>
(function () {
const prefsKey = "typingSchoolUiPrefs";
const themeColors = {
midnight: "#020617",
earth: "#15160f",
cyberpunk: "#0b0620",
sketchbook: "#efebe3",
"pink-lady": "#2a1022",
"retro-game": "#0f1b25",
"high-contrast": "#000000"
};
try {
const raw = localStorage.getItem(prefsKey);
const prefs = raw ? JSON.parse(raw) : {};
const theme = typeof prefs.theme === "string" && prefs.theme ? prefs.theme : "midnight";
const normalizedTheme = prefs.highContrast && theme === "midnight" ? "high-contrast" : theme;
const fontScale = Number(prefs.fontScale) || 100;
const backgroundColor = themeColors[normalizedTheme] || themeColors.midnight;
const root = document.documentElement;
root.dataset.theme = normalizedTheme;
root.classList.toggle("high-contrast", normalizedTheme === "high-contrast");
root.style.setProperty("--font-scale", `${fontScale}%`);
root.style.backgroundColor = backgroundColor;
} catch (_error) {
document.documentElement.style.backgroundColor = "#020617";
}
})();
</script>
<link rel="stylesheet" href="css/main.css" />
<link rel="stylesheet" href="css/typing.css" />
<link rel="stylesheet" href="css/keyboard.css" />
</head>
<body data-page="practice">
<a class="skip-link" href="#main">Skip to content</a>
<header class="site-header">
<div class="brand-wrap">
<img src="assets/typingschoologo.png" alt="TypingSchool logo" class="logo" />
<div>
<h1>TypingSchool</h1>
<p class="tagline">Practice</p>
</div>
</div>
<nav aria-label="Main navigation">
<ul class="nav-links">
<li><a href="index.html">Home</a></li>
<li><a href="practice.html" aria-current="page">Practice</a></li>
<li><a href="lessons.html">Lessons</a></li>
<li><a href="speedtest.html">Speed Test</a></li>
<li><a href="dashboard.html">Dashboard</a></li>
</ul>
</nav>
<div class="controls" aria-label="Display controls">
<label for="themeSelect" class="font-label">Theme</label>
<select id="themeSelect" class="btn-outline" aria-label="Select color theme"></select>
<label for="fontScale" class="font-label">Font</label>
<input id="fontScale" type="range" min="85" max="130" step="5" value="100" aria-label="Adjust font size" />
</div>
</header>
<main id="main" class="container">
<section class="card practice-intro">
<div class="practice-intro-copy">
<p class="eyebrow">Guided practice</p>
<h2>Choose the kind of session you want to win.</h2>
<p class="hint">Presets configure the trainer for a specific goal, then the advanced controls let you override details.</p>
</div>
<div class="preset-grid" role="group" aria-label="Practice presets">
<button class="preset-card active" data-practice-preset="warmup" type="button">
<span class="preset-kicker">Warm Up</span>
<strong>Settle in with clean rhythm.</strong>
<span>General text, classic scoring, low-friction start.</span>
</button>
<button class="preset-card" data-practice-preset="weak_keys" type="button">
<span class="preset-kicker">Weak Key Repair</span>
<strong>Attack your highest-mistake keys.</strong>
<span>Adaptive targeting with a focus on accuracy and correction.</span>
</button>
<button class="preset-card" data-practice-preset="code_sprint" type="button">
<span class="preset-kicker">Code Sprint</span>
<strong>Practice syntax under pressure.</strong>
<span>Developer snippets with short high-speed bursts.</span>
</button>
<button class="preset-card" data-practice-preset="accuracy_reset" type="button">
<span class="preset-kicker">Accuracy Reset</span>
<strong>Slow down and clean up misses.</strong>
<span>Finger drills tuned to rebuild control.</span>
</button>
<button class="preset-card" data-practice-preset="ghost_prep" type="button">
<span class="preset-kicker">Ghost Prep</span>
<strong>Bank a stronger future race.</strong>
<span>Longer classic reps built to stabilize pace before the speed test.</span>
</button>
</div>
</section>
<section class="card typing-primary">
<div class="practice-topline">
<div>
<p class="eyebrow">Active mission</p>
<h2 id="practicePresetTitle">Warm Up</h2>
</div>
<p id="practicePresetSummary" class="hint">General text, classic scoring, low-friction start.</p>
</div>
<section class="metrics-row" aria-label="Practice metrics">
<div><span>WPM</span><strong id="metricWpm">0</strong></div>
<div><span>Accuracy</span><strong id="metricAccuracy">100%</strong></div>
<div><span>Errors</span><strong id="metricErrors">0</strong></div>
<div><span>Chars</span><strong id="metricChars">0</strong></div>
</section>
<div class="action-row">
<button id="startPracticeBtn" class="btn-primary" type="button">Start</button>
<button id="newPracticeBtn" class="btn-secondary" type="button">New Text</button>
</div>
<div id="typingArea" class="typing-target" tabindex="0" aria-label="Practice typing area"></div>
<h3>Keyboard Guide + Session Heatmap</h3>
<div id="keyboardMount"></div>
</section>
<section class="practice-side-grid practice-controls-layout">
<section class="card secondary-tools">
<h3>Training Controls</h3>
<div class="secondary-toolbar duration-row" role="group" aria-label="Practice mode">
<button class="duration-btn active" data-practice-mode="general" type="button">General</button>
<button class="duration-btn" data-practice-mode="adaptive" type="button">Adaptive AI</button>
<button class="duration-btn" data-practice-mode="finger" type="button">Finger Drill</button>
<button class="duration-btn" data-practice-mode="developer" type="button">Developer</button>
</div>
<div class="secondary-toolbar">
<label for="layoutSelect">Layout</label>
<select id="layoutSelect" class="btn-outline"></select>
<label for="gameModeSelect">Game</label>
<select id="gameModeSelect" class="btn-outline">
<option value="classic">Classic</option>
<option value="survival">Survival</option>
<option value="elimination">Mistake Elimination</option>
<option value="burst">Speed Burst</option>
<option value="marathon">Paragraph Marathon</option>
</select>
<label for="fingerDrillSelect">Finger Drill</label>
<select id="fingerDrillSelect" class="btn-outline" disabled>
<option value="left_index">Left Index</option>
<option value="right_pinky">Right Pinky</option>
<option value="shift">Shift Exercise</option>
<option value="left_pinky">Left Pinky</option>
<option value="right_index">Right Index</option>
</select>
</div>
<div class="secondary-toolbar">
<label for="codeLanguageSelect">Language</label>
<select id="codeLanguageSelect" class="btn-outline" disabled>
<option value="javascript">JavaScript</option>
<option value="python">Python</option>
<option value="html">HTML</option>
<option value="css">CSS</option>
</select>
<label for="challengeTypeSelect">Challenge</label>
<select id="challengeTypeSelect" class="btn-outline" disabled>
<option value="all">All</option>
<option value="debugging">Debugging</option>
<option value="refactoring">Refactoring</option>
<option value="comprehension">Comprehension</option>
</select>
</div>
</section>
<section class="card practice-status" aria-live="polite">
<div class="session-recap">
<div class="section-heading">
<div>
<p class="eyebrow">Session recap</p>
<h3>What the trainer sees</h3>
</div>
</div>
<div class="recap-grid">
<div>
<span>Result</span>
<strong id="practiceResultHeadline">Waiting to start</strong>
</div>
<div>
<span>Focus</span>
<strong id="practiceResultFocus">Set a mission</strong>
</div>
<div>
<span>Recommendation</span>
<strong id="practiceResultNext">Start with a clean run</strong>
</div>
</div>
</div>
<p id="adaptiveSummary" class="hint">Top weak keys: no mistake data yet.</p>
<p id="rhythmFeedback" class="hint">Rhythm feedback appears after each session.</p>
<div id="practiceFeedback" class="feedback"></div>
</section>
</section>
</main>
<script src="js/achievementSystem.js"></script>
<script src="js/progressTracker.js"></script>
<script src="js/layoutManager.js"></script>
<script src="js/lessonGenerator.js"></script>
<script src="js/adaptiveTrainer.js"></script>
<script src="js/heatmapEngine.js"></script>
<script src="js/rhythmAnalyzer.js"></script>
<script src="js/gameModes.js"></script>
<script src="js/typingEngine.js"></script>
<script src="js/keyboardVisual.js"></script>
<script src="js/uiController.js"></script>
</body>
</html>