Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
851 lines (823 loc) · 42.5 KB
/
Copy pathindex.html
File metadata and controls
851 lines (823 loc) · 42.5 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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self'; style-src 'self'; style-src-attr 'unsafe-inline'; font-src 'self'; img-src 'self' data:; connect-src 'self'; object-src 'none'; base-uri 'self'; form-action 'none'"
/>
<meta
name="description"
content="TypeSpeed: a browser typing trainer with time and word modes, code snippets in six languages, weak-key practice, and ghost replay of your best run."
/>
<title>TypeSpeed: typing test and trainer with code snippets</title>
<link rel="canonical" href="https://tmhsdigital.github.io/Typing-Game/" />
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "TypeSpeed",
"url": "https://tmhsdigital.github.io/Typing-Game/",
"description": "Browser typing trainer with time and word modes, code snippets in six languages, weak-key practice, and ghost replay of your best run.",
"applicationCategory": "EducationalApplication",
"operatingSystem": "Any",
"browserRequirements": "Requires JavaScript",
"offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" }
}
</script>
<meta property="og:type" content="website" />
<meta property="og:title" content="TypeSpeed" />
<meta
property="og:description"
content="Browser typing trainer with time and word modes, code snippets in six languages, weak-key practice, and ghost replay of your best run."
/>
<meta property="og:url" content="https://tmhsdigital.github.io/Typing-Game/" />
<meta property="og:image" content="https://tmhsdigital.github.io/Typing-Game/preview.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta
property="og:image:alt"
content="The TypeSpeed page: stats bar, mode and length controls, and a passage of common words"
/>
<meta name="twitter:card" content="summary_large_image" />
<link rel="manifest" href="manifest.webmanifest" />
<meta name="theme-color" content="#0f172a" />
<link rel="apple-touch-icon" href="icons/icon-192.png" />
<link
rel="icon"
href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='6' fill='%230f172a'/%3E%3Ctext x='16' y='23' font-size='20' font-family='monospace' font-weight='700' text-anchor='middle' fill='%23818cf8'%3ET%3C/text%3E%3C/svg%3E"
/>
<link
rel="preload"
href="fonts/jetbrains-mono-latin.woff2"
as="font"
type="font/woff2"
crossorigin
/>
<link rel="stylesheet" href="style.css" />
<script src="theme.js"></script>
</head>
<body>
<div class="background-glow"></div>
<div class="container">
<header>
<button
id="stats-btn"
class="icon-btn left"
title="Stats"
aria-label="Stats"
aria-haspopup="dialog"
>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
aria-hidden="true"
>
<path d="M3 3v18h18"></path>
<path d="M7 15l4-4 3 3 5-6"></path>
</svg>
</button>
<h1>TYPE<span class="accent">SPEED</span></h1>
<button
id="settings-btn"
class="icon-btn"
title="Settings"
aria-label="Settings"
aria-haspopup="dialog"
>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
aria-hidden="true"
>
<circle cx="12" cy="12" r="3"></circle>
<path
d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"
></path>
</svg>
</button>
</header>
<div class="game-area">
<p id="storage-warning" class="storage-warning hidden" role="alert">
Progress could not be saved: browser storage is full or blocked. Export your
data from Stats to keep it.
</p>
<p id="update-notice" class="update-notice hidden" role="status">
<span id="update-text"></span>
<a href="https://github.com/TMHSDigital/Typing-Game/blob/main/CHANGELOG.md"
>Changelog</a
>
<button id="dismiss-update-btn" class="link-btn">Dismiss</button>
</p>
<div class="controls">
<div class="control-group left">
<button
id="daily-btn"
class="option-btn"
aria-pressed="false"
title="The same 30-second passage for everyone today"
>
Daily
</button>
<label for="category-select" class="visually-hidden">Text category</label>
<select id="category-select" class="category-select">
<option value="common">Common Words</option>
<option value="weak">Weak Keys</option>
<option value="lessons">Lessons</option>
<option value="books">Books</option>
<option value="general">Quotes</option>
<option value="technology">Technology</option>
<option value="code">Code Snippets</option>
<option value="custom">Custom Text</option>
</select>
<label for="code-language-select" class="visually-hidden">
Code language
</label>
<label for="lesson-select" class="visually-hidden">Lesson stage</label>
<select id="lesson-select" class="category-select hidden"></select>
<label for="book-select" class="visually-hidden">Book</label>
<select id="book-select" class="category-select hidden"></select>
<select id="code-language-select" class="category-select hidden">
<option value="javascript">JavaScript</option>
<option value="python">Python</option>
<option value="go">Go</option>
<option value="rust">Rust</option>
<option value="sql">SQL</option>
<option value="shell">Shell</option>
<option value="own">Your code</option>
</select>
<label class="option-check" id="punctuation-option">
<input type="checkbox" id="punctuation-toggle" />
Punctuation
</label>
<label class="option-check" id="numbers-option">
<input type="checkbox" id="numbers-toggle" />
Numbers
</label>
<label for="word-language-select" class="visually-hidden">
Word language
</label>
<select id="word-language-select" class="category-select">
<option value="en">English</option>
<option value="es">Español</option>
<option value="fr">Français</option>
<option value="pt">Português</option>
</select>
<label
class="option-check hidden"
id="auto-indent-option"
title="Leading spaces after a new line are filled in for you"
>
<input type="checkbox" id="auto-indent-toggle" checked />
Skip indentation
</label>
<button
id="edit-custom-btn"
class="option-btn hidden"
aria-haspopup="dialog"
>
Edit text
</button>
<button id="edit-code-btn" class="option-btn hidden" aria-haspopup="dialog">
Edit code
</button>
<p id="practice-note" class="practice-note hidden"></p>
</div>
<div class="control-group right">
<div
class="pill-selector compact"
id="quick-mode"
role="group"
aria-label="Mode"
>
<button class="pill active" data-value="time" aria-pressed="true">
Time
</button>
<button class="pill" data-value="words" aria-pressed="false">
Words
</button>
</div>
<div
class="pill-selector compact"
id="quick-duration"
role="group"
aria-label="Duration"
>
<button class="pill" data-value="15" aria-pressed="false">15s</button>
<button class="pill" data-value="30" aria-pressed="false">30s</button>
<button class="pill active" data-value="60" aria-pressed="true">
60s
</button>
</div>
<div
class="pill-selector compact hidden"
id="quick-word-count"
role="group"
aria-label="Word count"
>
<button class="pill active" data-value="10" aria-pressed="true">
10
</button>
<button class="pill" data-value="25" aria-pressed="false">25</button>
<button class="pill" data-value="50" aria-pressed="false">50</button>
</div>
<span class="badge hidden" id="ghost-badge">Ghost on</span>
</div>
</div>
<div id="stats-bar" class="stats">
<div class="stats-main">
<span class="stat-item stat-timer">
<span class="visually-hidden">Time</span>
<span id="timer" class="value">60</span><span class="unit">s</span>
</span>
<span class="stat-item">
<span id="wpm" class="value">0</span>
<span class="label">WPM</span>
</span>
</div>
<div class="stats-side">
<span class="stat-item">
<span id="accuracy" class="value">100</span><span class="unit">%</span>
<span class="label">accuracy</span>
</span>
<span class="stat-item">
<span id="mistakes" class="value">0</span>
<span class="label">mistakes</span>
</span>
<span class="stat-item">
<span class="label">best</span>
<span id="high-score" class="value">0</span>
</span>
</div>
</div>
<div class="typing-container">
<p id="ghost-status" class="ghost-status hidden"></p>
<p id="caps-warning" class="caps-warning hidden" role="status">
Caps Lock is on
</p>
<div id="quote-display" class="quote-display" aria-hidden="true"></div>
<p id="quote-text" class="visually-hidden"></p>
<div id="focus-hint" class="focus-hint" aria-hidden="true">
Click here or press any key to type
</div>
<textarea
id="typing-input"
class="typing-input"
aria-label="Type the text shown above"
aria-describedby="quote-text"
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"
></textarea>
</div>
<button id="reset-button" class="reset-btn">
<svg
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
aria-hidden="true"
>
<path d="M23 4v6h-6"></path>
<path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path>
</svg>
Restart
<kbd class="key-hint">Tab</kbd>
</button>
</div>
<footer>
<p class="footer-note">
No account. Your results are stored only in this browser.
<a href="https://github.com/TMHSDigital/Typing-Game#privacy">Privacy</a>
· Version
<a
id="version-link"
href="https://github.com/TMHSDigital/Typing-Game/blob/main/CHANGELOG.md"
>1.1.0</a
>
</p>
</footer>
</div>
<!-- Dialogs sit outside .container: its backdrop-filter would make it the
containing block for their position: fixed overlays and clip them. -->
<div
id="result-modal"
class="modal-overlay"
role="dialog"
aria-modal="true"
aria-labelledby="result-title"
aria-describedby="result-stats"
>
<div class="modal-content result-content">
<h2 id="result-title" class="result-title">Result</h2>
<div id="result-stats">
<p class="result-headline">
<span id="modal-wpm" class="headline-value">0</span>
<span class="headline-unit">WPM</span>
</p>
<dl class="modal-details">
<div>
<dt>Accuracy</dt>
<dd id="modal-accuracy">0%</dd>
</div>
<div>
<dt>Raw WPM</dt>
<dd id="modal-raw">0</dd>
</div>
<div>
<dt>Correct / wrong</dt>
<dd id="modal-chars">0</dd>
</div>
<div>
<dt>Time</dt>
<dd id="modal-time">0s</dd>
</div>
</dl>
</div>
<p id="modal-best" class="modal-best"></p>
<p id="modal-challenge" class="modal-challenge hidden"></p>
<p id="modal-progress" class="modal-challenge hidden"></p>
<p class="modal-keys">
<span id="modal-keys"></span>
<button id="practice-btn" class="link-btn hidden">Practice weak keys</button>
<button id="replay-btn" class="link-btn hidden" aria-haspopup="dialog">
Watch replay
</button>
</p>
<p id="modal-source" class="modal-source hidden"></p>
<div class="chart-row">
<div id="run-chart-container" class="chart-container hidden">
<h3>Raw WPM by second</h3>
<div class="chart-plot">
<span class="chart-y-max"></span>
<span class="chart-y-min"></span>
<svg
id="run-chart"
width="100%"
height="100"
viewBox="0 0 300 100"
preserveAspectRatio="none"
aria-hidden="true"
></svg>
<span class="chart-x-start"></span>
<span class="chart-x-end"></span>
</div>
</div>
<div id="progress-chart-container" class="chart-container hidden">
<h3 id="progress-chart-title">WPM, recent runs</h3>
<div class="chart-plot">
<span class="chart-y-max"></span>
<span class="chart-y-min"></span>
<svg
id="progress-chart"
width="100%"
height="100"
viewBox="0 0 300 100"
preserveAspectRatio="none"
aria-hidden="true"
></svg>
<span class="chart-x-start"></span>
<span class="chart-x-end"></span>
</div>
</div>
</div>
<label id="challenge-link-row" class="challenge-link hidden">
<span>Copying failed. Select the link and copy it:</span>
<input id="challenge-link" type="text" readonly />
</label>
<div class="modal-actions result-actions">
<button id="share-btn" class="action-btn tertiary">Share result</button>
<button id="save-image-btn" class="action-btn tertiary">Save image</button>
<button id="challenge-btn" class="action-btn tertiary">
Copy challenge link
</button>
<button id="play-again-btn" class="action-btn primary">Play again</button>
</div>
</div>
</div>
<!-- Replay of the finished run, opened from the result dialog -->
<div
id="replay-modal"
class="modal-overlay"
role="dialog"
aria-modal="true"
aria-labelledby="replay-title"
>
<div class="modal-content replay-content">
<h2 id="replay-title">Replay</h2>
<p class="replay-clock"><span id="replay-clock">0.0</span>s</p>
<div id="replay-display" class="quote-display replay-display"></div>
<div class="modal-actions replay-actions">
<div
class="pill-selector compact"
id="replay-speed"
role="group"
aria-label="Replay speed"
>
<button class="pill active" data-value="1" aria-pressed="true">1x</button>
<button class="pill" data-value="2" aria-pressed="false">2x</button>
</div>
<button id="replay-pause-btn" class="action-btn tertiary">Pause</button>
<button id="close-replay-btn" class="action-btn primary">Back to result</button>
</div>
</div>
</div>
<!-- Settings Modal -->
<div
id="settings-modal"
class="modal-overlay"
role="dialog"
aria-modal="true"
aria-labelledby="settings-title"
>
<div class="modal-content settings-content">
<h2 id="settings-title">Settings</h2>
<div class="settings-body">
<div class="settings-column">
<section class="setting-group" aria-labelledby="rules-heading">
<h3 class="setting-heading" id="rules-heading">Practice rules</h3>
<label class="toggle-label">
<span class="setting-text">
<span class="setting-name" id="stop-on-error-name">
Stop on error
</span>
<span class="setting-desc" id="stop-on-error-desc">
The caret stays put until you type the right key.
</span>
</span>
<input
type="checkbox"
id="stop-on-error-toggle"
aria-labelledby="stop-on-error-name"
aria-describedby="stop-on-error-desc"
/>
<span class="toggle-custom" aria-hidden="true"></span>
</label>
<label class="toggle-label">
<span class="setting-text">
<span class="setting-name" id="hard-mode-name">Hard mode</span>
<span class="setting-desc" id="hard-mode-desc">
Characters you have typed are blurred.
</span>
</span>
<input
type="checkbox"
id="hard-mode-toggle-settings"
aria-labelledby="hard-mode-name"
aria-describedby="hard-mode-desc"
/>
<span class="toggle-custom" aria-hidden="true"></span>
</label>
<div class="setting-row layout-row">
<span class="setting-text">
<label class="setting-name" for="layout-select">
Keyboard layout
</label>
<span class="setting-desc" id="layout-desc">
Keys type as this layout, whatever your system uses.
Physical keyboards only.
</span>
</span>
<select
id="layout-select"
class="category-select"
aria-describedby="layout-desc"
>
<option value="qwerty">QWERTY</option>
<option value="colemak">Colemak</option>
<option value="colemak-dh">Colemak-DH</option>
<option value="dvorak">Dvorak</option>
<option value="workman">Workman</option>
</select>
</div>
</section>
<section class="setting-group" aria-labelledby="ghost-heading">
<h3 class="setting-heading" id="ghost-heading">Ghost and pace</h3>
<label class="toggle-label">
<span class="setting-text">
<span class="setting-name" id="ghost-mode-name"
>Ghost mode</span
>
<span class="setting-desc" id="ghost-mode-desc">
A second cursor replays your best run at these settings.
</span>
</span>
<input
type="checkbox"
id="ghost-mode-toggle"
aria-labelledby="ghost-mode-name"
aria-describedby="ghost-mode-desc"
/>
<span class="toggle-custom" aria-hidden="true"></span>
</label>
<div class="setting-row">
<span class="setting-text">
<label class="setting-name" id="pace-name" for="pace-select">
Pace caret
</label>
<span class="setting-desc" id="pace-desc">
A second cursor at a steady speed, when Ghost mode is off.
</span>
</span>
<span class="setting-controls">
<select
id="pace-select"
class="category-select"
aria-describedby="pace-desc"
>
<option value="off">Off</option>
<option value="target">Target speed</option>
<option value="average">Your average</option>
<option value="last">Your last run</option>
</select>
<input
type="number"
id="pace-wpm"
class="number-input"
min="10"
max="300"
step="1"
aria-label="Target WPM"
/>
</span>
</div>
</section>
</div>
<div class="settings-column">
<section class="setting-group" aria-labelledby="theme-label">
<h3 class="setting-heading" id="theme-label">Appearance</h3>
<div
class="pill-selector"
id="theme-selector"
role="group"
aria-labelledby="theme-label"
>
<button class="pill active" data-value="system" aria-pressed="true">
System
</button>
<button class="pill" data-value="dark" aria-pressed="false">
Dark
</button>
<button class="pill" data-value="light" aria-pressed="false">
Light
</button>
<button class="pill" data-value="contrast" aria-pressed="false">
Contrast
</button>
</div>
<div class="setting-row">
<label class="setting-name" for="font-select">Passage font</label>
<select id="font-select" class="category-select">
<option value="mono">JetBrains Mono</option>
<option value="sans">Space Grotesk</option>
<option value="dyslexic">OpenDyslexic</option>
</select>
</div>
<div class="setting-row">
<label class="setting-name" for="text-size-select">Text size</label>
<select id="text-size-select" class="category-select">
<option value="small">Small</option>
<option value="medium">Medium</option>
<option value="large">Large</option>
<option value="xlarge">Extra large</option>
</select>
</div>
<div class="setting-row">
<label class="setting-name" for="line-spacing-select"
>Line spacing</label
>
<select id="line-spacing-select" class="category-select">
<option value="compact">Compact</option>
<option value="normal">Normal</option>
<option value="wide">Wide</option>
</select>
</div>
<div class="setting-row">
<label class="setting-name" for="caret-select">Caret</label>
<select id="caret-select" class="category-select">
<option value="underline">Underline</option>
<option value="line">Line</option>
<option value="block">Block</option>
</select>
</div>
</section>
<section class="setting-group" aria-labelledby="sound-heading">
<h3 class="setting-heading" id="sound-heading">Sound</h3>
<label class="toggle-label">
<span class="setting-text">
<span class="setting-name" id="sound-name">Sound effects</span>
<span class="setting-desc" id="sound-desc">
A click per key, a buzz on mistakes, a chime at the end.
</span>
</span>
<input
type="checkbox"
id="sound-toggle-settings"
aria-labelledby="sound-name"
aria-describedby="sound-desc"
checked
/>
<span class="toggle-custom" aria-hidden="true"></span>
</label>
<div class="setting-row">
<label class="setting-name" for="sound-pack-select"
>Sound set</label
>
<span class="setting-controls">
<select id="sound-pack-select" class="category-select">
<option value="tones">Tones</option>
<option value="mechanical">Mechanical</option>
<option value="typewriter">Typewriter</option>
<option value="soft">Soft</option>
</select>
<button
id="sound-preview-btn"
class="option-btn"
aria-label="Play the sound set"
>
Play
</button>
</span>
</div>
</section>
</div>
</div>
<div class="modal-actions settings-footer">
<button id="close-settings-btn" class="action-btn primary">Done</button>
</div>
</div>
</div>
<!-- Custom Text Modal -->
<div
id="custom-modal"
class="modal-overlay"
role="dialog"
aria-modal="true"
aria-labelledby="custom-title"
>
<div class="modal-content settings-content">
<h2 id="custom-title">Custom text</h2>
<div class="settings-body">
<label class="setting-name" for="custom-text">Text to type</label>
<textarea
id="custom-text"
class="custom-text"
rows="8"
maxlength="4000"
spellcheck="false"
aria-describedby="custom-text-help"
></textarea>
<p id="custom-text-help" class="setting-help">
Pasting works here. Curly quotes and dashes become plain ones, line breaks
become spaces, and text past 2000 characters is dropped.
</p>
</div>
<div class="modal-actions settings-footer">
<button id="close-custom-btn" class="action-btn primary">Done</button>
</div>
</div>
</div>
<!-- Your code, for the Code Snippets category -->
<div
id="code-modal"
class="modal-overlay"
role="dialog"
aria-modal="true"
aria-labelledby="code-title"
>
<div class="modal-content settings-content">
<h2 id="code-title">Your code</h2>
<div class="settings-body">
<label class="setting-name" for="own-code">Code to type</label>
<textarea
id="own-code"
class="custom-text"
rows="12"
wrap="off"
spellcheck="false"
aria-describedby="own-code-help"
></textarea>
<p class="code-file-row">
<button id="code-file-btn" class="option-btn">Load a file</button>
<input
type="file"
id="code-file"
hidden
accept=".js,.mjs,.ts,.jsx,.tsx,.py,.go,.rs,.sql,.sh,.rb,.java,.c,.h,.cpp,.cs,.php,.swift,.kt,.css,.html,.txt,text/*"
/>
<span id="code-file-status" aria-live="polite"></span>
</p>
<p id="own-code-help" class="setting-help">
Paste code or load a file; it stays in this browser. Tabs become four
spaces, trailing spaces and repeated blank lines are removed, lines over 100
characters are dropped, and code past 20,000 characters is cut at a line.
Each run picks a block of up to 15 lines between blank lines.
</p>
</div>
<div class="modal-actions settings-footer">
<button id="close-code-btn" class="action-btn primary">Done</button>
</div>
</div>
</div>
<!-- Stats Modal -->
<div
id="stats-modal"
class="modal-overlay"
role="dialog"
aria-modal="true"
aria-labelledby="stats-title"
>
<div class="modal-content stats-content">
<h2 id="stats-title">Stats</h2>
<p id="stats-summary" class="stats-summary"></p>
<div id="stats-tables">
<h3 class="stats-heading" id="heatmap-heading">Misses by key</h3>
<p class="heatmap-note">
Darker keys are missed more often, across all recorded runs. Dashed keys
have fewer than five attempts.
</p>
<div
id="stats-heatmap"
class="heatmap"
role="group"
aria-labelledby="heatmap-heading"
></div>
<div id="daily-chart-container" class="chart-container daily-chart hidden">
<h3 id="daily-chart-title">WPM by day</h3>
<div class="chart-plot">
<span class="chart-y-max"></span>
<span class="chart-y-min"></span>
<svg
id="daily-chart"
width="100%"
height="100"
viewBox="0 0 300 100"
preserveAspectRatio="none"
aria-hidden="true"
></svg>
<span class="chart-x-start"></span>
<span class="chart-x-end"></span>
</div>
<p id="daily-chart-summary" class="visually-hidden"></p>
</div>
<h3 class="stats-heading">Best per setting</h3>
<table class="stats-table compact">
<thead>
<tr>
<th scope="col">Setting</th>
<th scope="col" class="num">Best WPM</th>
</tr>
</thead>
<tbody id="stats-bests"></tbody>
</table>
<h3 class="stats-heading">Recent runs</h3>
<div class="stats-scroll">
<table class="stats-table">
<thead>
<tr>
<th scope="col">Date</th>
<th scope="col">Setting</th>
<th scope="col" class="num">WPM</th>
<th scope="col" class="num">Accuracy</th>
</tr>
</thead>
<tbody id="stats-runs"></tbody>
</table>
</div>
</div>
<p class="stats-note">
Stored in this browser only. Export to keep a copy or move to another device.
</p>
<p id="stats-status" class="stats-status" role="status"></p>
<input type="file" id="import-input" accept="application/json,.json" hidden />
<div class="modal-actions stats-actions">
<button id="clear-btn" class="action-btn danger">Clear data</button>
<button id="export-btn" class="action-btn secondary">Export</button>
<button id="import-btn" class="action-btn secondary">Import</button>
<button id="close-stats-btn" class="action-btn primary">Done</button>
</div>
</div>
</div>
<script src="texts.js"></script>
<script src="wordlists.js"></script>
<script src="script.js"></script>
</body>
</html>