-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
195 lines (190 loc) · 6.76 KB
/
index.html
File metadata and controls
195 lines (190 loc) · 6.76 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>TypeRacer</title>
<!-- Link to the bootstrap -->
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css"
rel="stylesheet"
/>
<link rel="stylesheet" href="assets/css/style.css" />
</head>
<body>
<header class="site-header" role="banner">
<div class="container">
<h1 class="logo">TypeRacer</h1>
<button
id="instructionsBtn"
class="btn btn-info"
data-bs-toggle="modal"
data-bs-target="#instructionsModal"
aria-label="Show instructions"
>
Instructions
</button>
<!-- Instructions Modal -->
<div
class="modal fade"
id="instructionsModal"
tabindex="-1"
aria-labelledby="instructionsModalLabel"
aria-hidden="true"
>
<div class="modal-dialog modal-lg modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="instructionsModalLabel">
How to take the TypeRacer test
</h5>
<button
type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close"
></button>
</div>
<div class="modal-body">
<p>Follow these steps to complete the typing test:</p>
<ol>
<li>
<strong>Select difficulty:</strong> Choose Easy, Medium, or
Hard to adjust paragraph length and complexity.
</li>
<li>
<strong>Start the test:</strong> Click <em>Start</em>. The
timer will begin when you start typing (or immediately if
your implementation starts on click).
</li>
<li>
<strong>Type the text:</strong> Type exactly what is shown
in the sample paragraph. Pay attention to punctuation,
spacing and capitalization. Use Backspace to correct
mistakes. Spellcheck is disabled to avoid interference.
</li>
<li>
<strong>Stop or retry:</strong> Click <em>Stop</em> to end
early. Click <em>Retry</em> to reset the text and timer for
the current difficulty.
</li>
<li>
<strong>View results:</strong> After finishing, check the
Results panel for Level, Time and WPM (words per minute).
WPM is calculated based on correctly typed characters/words
and elapsed time.
</li>
</ol>
<h6>Tips</h6>
<ul>
<li>
Place focus inside the typing box before you begin to ensure
keystrokes are captured.
</li>
<li>Avoid copy/paste for valid scoring.</li>
<li>
Practice with the Easy level to warm up, then increase
difficulty as you improve.
</li>
</ul>
</div>
<div class="modal-footer">
<button
type="button"
class="btn btn-primary"
data-bs-dismiss="modal"
>
Got it
</button>
</div>
</div>
</div>
</div>
</div>
</header>
<main class="main" id="main">
<div class="grid">
<section class="main-left" id="testArea" aria-labelledby="test-heading">
<h2 id="test-heading">Typing Test</h2>
<br />
<!-- Difficulty selector (Bootstrap input-group) -->
<div class="input-group mb-3">
<label class="input-group-text" for="difficultySelect"
>Select Difficulty</label
>
<select
class="form-select"
id="difficultySelect"
aria-label="Select difficulty"
>
<option value="easy">Easy</option>
<option value="medium">Medium</option>
<option value="hard">Hard</option>
</select>
</div>
<div class="sample-text" id="sampleText">
<!-- Sample paragraph for the test -->
</div>
<!-- Typing input area -->
<div class="typing-input">
<label for="typingInput" class="visually-hidden"
>Type the text</label
>
<textarea
id="typingInput"
spellcheck="false"
inputmode="text"
placeholder="Start typing here..."
aria-label="Typing input"
></textarea>
</div>
<!-- Start / Stop / Retry controls -->
<div class="controls" role="group" aria-label="Test controls">
<button id="startBtn" class="btn btn-primary">Start</button>
<button id="stopBtn" class="btn btn-secondary" disabled>
Stop
</button>
<button id="retryBtn" class="btn btn-outline-secondary">
Retry
</button>
</div>
</section>
<aside
class="main-right"
id="resultsArea"
aria-labelledby="results-heading"
role="region"
>
<div class="results-box">
<h2 id="results-heading">Results</h2>
<div class="results-panel">
<div class="result-row">
<strong>Level:</strong>
<span id="resultLevel">Easy</span>
</div>
<div class="result-row">
<strong>Time:</strong>
<span id="resultTime">0s</span>
</div>
<div class="result-row">
<strong>WPM:</strong>
<span id="resultWPM">0</span>
</div>
<div class="result-row">
<small class="muted"></small>
</div>
</div>
</div>
</aside>
</div>
</main>
<!-- Js for the bootstrap -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js"></script>
<!-- fontawesome -->
<script
src="https://kit.fontawesome.com/YOUR-KIT-CODE-HERE.js"
crossorigin="anonymous"
></script>
<script src="./assets/js/script.js"></script>
</body>
</html>