-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
161 lines (150 loc) · 10.7 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<link rel="icon" type="image/png" href="favicon.png">
<link href="https://fonts.googleapis.com/css?family=Cutive+Mono" rel="stylesheet">
<title>Typing Speed Test</title>
</head>
<body>
<section class="mt-4 p-4">
<div class="row">
<div class="col-sm-6 col-md-2 order-md-0">
<div class="results">
<ul class="list-unstyled right-stats text-center small">
<li class="list-item">Total Words <span id="totalWords" class="d-block stats">0</span></li>
<hr class="hr-x">
<li class="list-item">Written Words <span id="writtenWords" class="d-block stats">0</span></li>
<hr class="hr-x">
<li class="list-item">Errors <span id="errors" class="d-block stats">0</span></li>
</ul>
</div>
</div>
<div class="col-sm-6 col-md-2 order-md-2">
<div class="results">
<ul class="list-unstyled left-stats text-center small">
<li class="list-item">Timer <span id="timer" class="d-block stats">0</span></li>
<hr class="hr-x">
<li class="list-item">WPM <span id="wpm" class="d-block stats">0</span></li>
<hr class="hr-x">
<li class="list-item last-result">Last WPM <span id="result" class="d-block stats text-success">0</span></li>
</ul>
</div>
</div>
<div class="col-sm-12 col-md-8 order-md-1">
<div class="container">
<div class="header text-center mt-4">
<p class="info lead">How fast is your typing?<br>Click on the <strong>start</strong> button
below to start the one-minute typing test and find out!
</p>
<div class="control">
<button id="btnPlay" class="btn-control">
<svg enable-background="new 0 0 40 40" id="iconPlay" class="control-icon icon-play"
version="1.1" viewBox="0 0 40 40" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<g>
<path d="M15.1,30.5c-0.3,0-0.7-0.1-1-0.2c-0.7-0.4-1.1-1.1-1.1-1.9V10.8c0-0.8,0.4-1.5,1.1-1.9c0.7-0.4,1.5-0.3,2.2,0.1l3.6,2.5 c0.5,0.3,0.6,0.9,0.3,1.4c-0.3,0.5-0.9,0.6-1.4,0.3l-3.6-2.5c0,0-0.1,0-0.1,0c-0.1,0-0.1,0.1-0.1,0.1v17.6c0,0,0,0.1,0.1,0.1 c0.1,0,0.1,0,0.1,0L28,19.7v-0.2l-4.5-3.1c-0.5-0.3-0.6-0.9-0.3-1.4c0.3-0.5,0.9-0.6,1.4-0.3l4.5,3.1c0.6,0.4,0.9,1,0.9,1.7 s-0.3,1.3-0.9,1.7l-12.8,8.8C16,30.4,15.6,30.5,15.1,30.5z" />
</g>
<g>
<path d="M19.7,40c-11,0-20-9-20-20s9-20,20-20s20,9,20,20S30.7,40,19.7,40z M19.7,2c-9.9,0-18,8.1-18,18s8.1,18,18,18s18-8.1,18-18 S29.6,2,19.7,2z" />
</g>
</svg>
<span class="d-block x-small text-muted pt-1">start</span>
</button>
<button id="btnRefresh" class="btn-control">
<svg enable-background="new 0 0 40 40" id="iconRefresh" class="control-icon icon-refresh"
version="1.1" viewBox="0 0 40 40" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<g>
<path d="M20,40C9,40,0,31,0,20S9,0,20,0c4.5,0,8.7,1.5,12.3,4.2c0.4,0.3,0.5,1,0.2,1.4c-0.3,0.4-1,0.5-1.4,0.2C27.9,3.3,24,2,20,2 C10.1,2,2,10.1,2,20s8.1,18,18,18s18-8.1,18-18c0-3.2-0.9-6.4-2.5-9.2c-0.3-0.5-0.1-1.1,0.3-1.4c0.5-0.3,1.1-0.1,1.4,0.3 C39,12.9,40,16.4,40,20C40,31,31,40,20,40z" />
</g>
<g>
<path d="M30.5,20c0,0.6-0.4,1-1,1c-0.5,0-1-0.4-1-1c0-4.7-3.8-8.6-8.5-8.6c-4.7,0-8.5,3.8-8.5,8.6c0,4.7,3.8,8.6,8.5,8.6l-1.7-1.7 c-0.4-0.4-0.4-1,0-1.4c0.4-0.4,1-0.4,1.4,0l3.1,3.1l0.2,0.1l0.2,0.2c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-3.4,3.4 C19.5,33.9,19.2,34,19,34s-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.7-1.7c-5.8,0-10.5-4.7-10.5-10.6S14.2,9.4,20,9.4 S30.5,14.2,30.5,20z" />
</g>
</svg>
<span class="d-block x-small text-muted pt-1">Refresh</span>
</button>
</div>
</div>
<hr>
<p class="small text-muted">Just start typing and dont use Backslash to correct your
mistakes. Your mistakes will be marked and shown below the writing box. Good luck!</p>
<div class="bg-dark text-light mono text-input" id="textInput" tabindex="0" disabled></div>
<div class="bg-dark text-light mono p-4 lead d-none" id="textFull"></div>
<div class="mono text-input" id="textOutput"></div>
<hr class="hr-x">
<hr class="mt-5">
<div title="Average typing speed" class="my-4">
<h6 class="py-2">Average typing speed</h6>
<div class="meter-gauge text-light">
<span class="col" style="background: #eb4841">0 - 20 Slow</span>
<span class="col" style="background: #f48847">20 - 40 Average</span>
<span class="col" style="background: #ffc84a">40 - 60 Fast</span>
<span class="col" style="background: #a6c34c">60 - 80 Professional</span>
<span class="col" style="background: #4ec04e">80 - 100+ Top</span>
</div>
</div>
<hr>
</div>
</div>
<!-- Modal -->
<div class="modal" id="ModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="modal-close close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body text-center"></div>
<div class="modal-footer">
<button type="button" class="btn btn-success btn-sm modal-repeat-btn" id="modalReload">Run
again</button>
<button type="button" class="btn btn-danger btn-sm modal-close" id="modalCloseBtn">Close</button>
</div>
</div>
</div>
</div>
<div class="sound-control">
<svg enable-background="new 0 0 40 40" id="iconSoundOn" class="control-icon icon-sound-on" version="1.1"
viewBox="0 0 40 40" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g>
<path d="M20,0C9,0,0,9,0,20c0,11,9,20,20,20c11,0,20-9,20-20C40,9,31,0,20,0z M20,38c-9.9,0-18-8.1-18-18c0-9.9,8.1-18,18-18 s18,8.1,18,18C38,29.9,29.9,38,20,38z" />
</g>
<g>
<path d="M31.6,21h-6.3c-0.6,0-1-0.4-1-1s0.4-1,1-1h6.3c0.6,0,1,0.4,1,1S32.1,21,31.6,21z" />
</g>
<g>
<path d="M24,17.1c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l4.6-4.6c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-4.6,4.6 C24.5,17,24.3,17.1,24,17.1z" />
</g>
<g>
<path d="M28.6,29.6c-0.3,0-0.5-0.1-0.7-0.3l-4.6-4.6c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l4.6,4.6c0.4,0.4,0.4,1,0,1.4 C29.1,29.5,28.8,29.6,28.6,29.6z" />
</g>
<g>
<path d="M17.8,15v-2.3l-4,4.5c-0.2,0.2-0.5,0.3-0.7,0.3H9.7c-0.6,0-1.1,0.5-1.1,1.1v3c0,0.6,0.5,1.1,1.1,1.1H12v-2.4 c0-0.6,0.4-1,1-1c0.5,0,1,0.4,1,1v3l3.8,4.2v-8.5c0-0.5,0.5-1,1-1s1,0.5,1,1v9.1c0,0.9-0.4,1.6-1.1,1.9c-0.2,0.1-0.3,0.1-0.5,0.1 c-0.4,0-0.8-0.2-1.1-0.5l-4.5-5H9.7c-1.7,0-3.1-1.4-3.1-3.1v-3c0-1.7,1.4-3.1,3.1-3.1h2.9l4.5-5c0.4-0.5,1-0.6,1.6-0.4 c0.7,0.3,1.1,1,1.1,1.9v3c0,0.6-0.5,1-1,1S17.8,15.6,17.8,15z" />
</g>
</svg>
<svg enable-background="new 0 0 40 40" id="iconSoundOff" class="control-icon icon-sound-off d-none"
version="1.1" viewBox="0 0 40 40" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<g>
<path d="M20,0C9,0,0,9,0,20c0,11,9,20,20,20c11,0,20-9,20-20C40,9,31,0,20,0z M20,38c-9.9,0-18-8.1-18-18c0-9.9,8.1-18,18-18 s18,8.1,18,18C38,29.9,29.9,38,20,38z" />
</g>
<g>
<g>
<path d="M22.6,15v-2.3l-4,4.5c-0.2,0.2-0.5,0.3-0.8,0.3h-3.3c-0.6,0-1.1,0.5-1.1,1.1v3c0,0.6,0.5,1.1,1.1,1.1h2.3v-2.4 c0-0.6,0.5-1,1-1c0.6,0,1,0.4,1,1v3l3.8,4.2v-8.5c0-0.5,0.5-1,1-1s1,0.5,1,1v9.1c0,0.9-0.4,1.6-1.1,1.9c-0.2,0.1-0.3,0.1-0.5,0.1 c-0.4,0-0.8-0.2-1.1-0.5l-4.5-5h-2.9c-1.7,0-3.1-1.4-3.1-3.1v-3c0-1.7,1.4-3.1,3.1-3.1h2.9l4.5-5c0.4-0.5,1-0.6,1.6-0.4 c0.7,0.3,1.1,1,1.1,1.9v3c0,0.6-0.5,1-1,1S22.6,15.6,22.6,15z" />
</g>
</g>
</svg>
</div>
<audio id="keyClick" src="sound/button.wav" hidden></audio>
<audio id="keyBeep" src="sound/beep.wav" hidden></audio>
</section>
<script src="js/speedTyping.js"></script>
</body>
</html>