-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdashboard.html
More file actions
211 lines (196 loc) · 8.14 KB
/
dashboard.html
File metadata and controls
211 lines (196 loc) · 8.14 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>TypingSchool | Dashboard</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/dashboard.css" />
</head>
<body data-page="dashboard">
<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">Dashboard</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">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" aria-current="page">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 dashboard-hero">
<div class="dashboard-hero-copy">
<p class="eyebrow">Coaching dashboard</p>
<h2 id="dashHeroTitle">Build enough data to coach your speed.</h2>
<p id="dashHeroText" class="hint">Run a few sessions and this screen will start telling you where your speed is leaking and what to fix next.</p>
</div>
<div class="dashboard-hero-meta">
<div>
<span>Skill tier</span>
<strong id="dashTier">Beginner</strong>
</div>
<div>
<span>Consistency</span>
<strong id="dashConsistency">0%</strong>
</div>
<div>
<span>Sessions</span>
<strong id="dashSessionCount">0</strong>
</div>
</div>
</section>
<section class="grid-3 stats-grid">
<article class="card stat-card"><h2>Best WPM</h2><p id="dashBestWpm" class="stat-value">0</p></article>
<article class="card stat-card"><h2>Average WPM</h2><p id="dashAverageWpm" class="stat-value">0</p></article>
<article class="card stat-card"><h2>Accuracy</h2><p id="dashAccuracy" class="stat-value">0%</p></article>
<article class="card stat-card"><h2>Lessons Completed</h2><p id="dashLessons" class="stat-value">0</p></article>
<article class="card stat-card"><h2>Daily Streak</h2><p id="dashStreak" class="stat-value">0 days</p></article>
<article class="card stat-card"><h2>Words Trained</h2><p id="dashWordsTyped" class="stat-value">0</p><small id="dashRecentGain">0 recent sessions</small></article>
</section>
<section class="grid-2 coaching-grid">
<article class="card coach-card">
<p class="eyebrow">Top priority</p>
<h3 id="dashPriorityTitle">Start collecting signal.</h3>
<p id="dashPriorityText" class="mission-copy">A few focused sessions are enough to reveal where accuracy and rhythm break down.</p>
<div class="mission-meta">
<div>
<span>Recent form</span>
<strong id="dashRecentForm">Waiting</strong>
</div>
<div>
<span>Fastest zone</span>
<strong id="dashBestZone">0-30 WPM</strong>
</div>
<div>
<span>Ghost library</span>
<strong id="dashGhostCount">0</strong>
</div>
</div>
</article>
<article class="card coach-card">
<p class="eyebrow">Leak map</p>
<h3>Where speed is slipping</h3>
<ul id="dashLeakList" class="achievement-list" aria-live="polite"></ul>
</article>
</section>
<section class="card action-row">
<button id="exportJsonBtn" class="btn-outline" type="button">Export JSON</button>
<button id="exportCsvBtn" class="btn-outline" type="button">Export CSV</button>
<p class="hint">Export your typing statistics locally.</p>
</section>
<section class="charts-grid">
<section class="card chart-card">
<div class="section-heading">
<div>
<p class="eyebrow">Momentum</p>
<h2>WPM Over Time</h2>
</div>
<p class="hint">Are your last sessions climbing, flat, or noisy?</p>
</div>
<canvas id="wpmChart" width="900" height="260" aria-label="WPM history chart"></canvas>
</section>
<section class="card chart-card">
<div class="section-heading">
<div>
<p class="eyebrow">Control</p>
<h2>Accuracy Trends</h2>
</div>
<p class="hint">Speed gains matter only if accuracy survives.</p>
</div>
<canvas id="accuracyChart" width="900" height="260" aria-label="Accuracy history chart"></canvas>
</section>
<section class="card chart-card">
<div class="section-heading">
<div>
<p class="eyebrow">Consistency</p>
<h2>Practice Frequency</h2>
</div>
<p class="hint">Daily reps keep rhythm from resetting.</p>
</div>
<canvas id="frequencyChart" width="900" height="240" aria-label="Daily practice frequency chart"></canvas>
</section>
<section class="card chart-card">
<div class="section-heading">
<div>
<p class="eyebrow">Range</p>
<h2>Speed Distribution</h2>
</div>
<p class="hint">Your most common pace band shows where you really live.</p>
</div>
<canvas id="distributionChart" width="900" height="240" aria-label="Speed distribution chart"></canvas>
</section>
<section class="card chart-card">
<div class="section-heading">
<div>
<p class="eyebrow">Habit</p>
<h2>Practice Streak Graph</h2>
</div>
<p class="hint">Momentum is easier to keep than restart.</p>
</div>
<canvas id="streakGraph" width="900" height="240" aria-label="Practice streak graph"></canvas>
</section>
<section class="card coach-card">
<p class="eyebrow">Weak-key ranking</p>
<h2>Friction by key</h2>
<ul id="dashWeakKeys" class="achievement-list"></ul>
</section>
</section>
<section class="card">
<h2>Achievements</h2>
<ul id="dashAchievements" class="achievement-list"></ul>
</section>
</main>
<script src="js/achievementSystem.js"></script>
<script src="js/progressTracker.js"></script>
<script src="js/skillRanking.js"></script>
<script src="js/sessionExporter.js"></script>
<script src="js/chartRenderer.js"></script>
<script src="js/statsEngine.js"></script>
<script src="js/uiController.js"></script>
</body>
</html>