-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
632 lines (617 loc) · 25.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
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
<!DOCTYPE html>
<html lang="en-US">
<head>
<!-- Main Head Codes -->
<title>SwordyType</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="author" content="MoBakour" />
<meta name="description" content="SwordyType typing speed test" />
<meta
name="keywords"
content="Typing, Speed, Test, Swordax, SwordyType, SwordaxSy, MoBakour"
/>
<link rel="icon" href="./assets/images/website-logo.png" />
<!-- CSS Files Connections -->
<link rel="stylesheet" href="./styles/style.css" />
<link rel="stylesheet" href="./styles/responsive.css" />
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Baloo+Chettan+2&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Almarai:wght@300&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Nova+Mono&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@300&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Xanh+Mono&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=DM+Mono:wght@300&display=swap"
rel="stylesheet"
/>
<!-- Font Awesome CDN -->
<link
rel="stylesheet"
href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css"
integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p"
crossorigin="anonymous"
/>
<!-- JS Files Connections -->
<script src="./info.js" defer></script>
<script src="./scripts/words.js" defer></script>
<script src="./scripts/selectors.js" defer></script>
<script src="./scripts/script.js" defer></script>
<!-- fetch svg logo -->
<script>
fetch("/assets/images/logo.svg")
.then((res) => res.text())
.then((data) => {
document.querySelector(".logo").innerHTML = data;
});
</script>
</head>
<body>
<!-- Header -->
<header>
<div class="web-logo">
<div class="logo"></div>
<h1>SwordyType</h1>
</div>
<div class="menu-btn">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</header>
<!-- Main Body -->
<main>
<!-- Test Div -->
<div class="test">
<div class="timer">
<p class="time"><!-- Test time will be inserted here --></p>
</div>
<div class="words">
<!-- Words will dynamically be added here -->
</div>
<!-- Result Div -->
<div class="result">
<div class="wpm-div" title="Words Per Minute">
<aside>
<p class="results-format wpm">
<!-- WPM speed will be inserted here -->
</p>
</aside>
<p class="static-format">WPM</p>
</div>
<div class="acc-div" title="Accuracy">
<aside>
<p class="results-format acc">
<!-- Accuracy will be inserted here -->
</p>
</aside>
<p class="static-format">ACC</p>
</div>
<div class="type-div" title="Test Type">
<aside>
<p class="results-format test-duration">
<!-- Test duration will be inserted here -->
</p>
<p class="results-format test-mode">
<!-- Test mode will be inserted here -->
</p>
<p class="results-format test-type">
<!-- Test type will be inserted here -->
</p>
</aside>
<p class="static-format">Test Type</p>
</div>
<div class="details-div" title="Characters Details">
<aside>
<p class="results-format total-chars">
<!-- Total characters will be inserted here -->
</p>
<p class="results-format correct-chars">
<!-- Correct characters will be inserted here -->
</p>
<p class="results-format wrong-chars">
<!-- Wrong characters will be inserted here -->
</p>
</aside>
<p class="static-format">Characters</p>
</div>
</div>
<!-- Refresh Bar Div -->
<div class="refresh-div">
<div class="refresh-line"></div>
<i
class="fas fa-redo-alt refresh-btn"
onclick="refreshTest();"
title="Redo [Enter]"
></i>
<div class="refresh-line"></div>
</div>
</div>
</main>
<!-- Footer -->
<footer>
<p class="copyrights">
Made By
<span class="link" onclick="showDiscord()">MoBakour</span>
</p>
</footer>
<!-- Menu -->
<div class="menu">
<div class="menu-content">
<section class="test-mode">
<h1>Test Mode</h1>
<aside>
<div>
<div class="full-width test-modes buttons-format">
<div
onclick="changeMode(0)"
class="current-selected"
>
Cold
</div>
<div onclick="changeMode(1)">Hot</div>
<div onclick="changeMode(2)">Fire</div>
</div>
<article class="test-mode-notes">
<span
>Cold mode allows you to always use
backspace</span
>
<span>Hot mode disables the backspace</span>
<span
>Fire mode ends the test at the first
mistake</span
>
</article>
</div>
</aside>
</section>
<section class="test-type">
<h1>Test Type</h1>
<aside>
<div class="test-durations">
<p>Test Time</p>
<div class="durations buttons-format">
<div onclick="changeDuration(15)">15 sec</div>
<div onclick="changeDuration(30)">30 sec</div>
<div
onclick="changeDuration(60)"
class="current-selected"
>
60 sec
</div>
<div onclick="changeDuration(120)">120 sec</div>
</div>
</div>
</aside>
<aside>
<div class="test-language">
<p>Language</p>
<div class="dropdown-format test-language">
<div
class="opener"
onclick="dropdownAction('languages')"
>
English Medium
</div>
<div class="options languages">
<div
onclick="changeLanguage('engEasy', this)"
>
English Easy
</div>
<div
onclick="changeLanguage('engMedium', this)"
class="current-option"
>
English Medium
</div>
<div
onclick="changeLanguage('engHard', this)"
>
English Hard
</div>
<div
onclick="changeLanguage('arabic', this)"
>
Arabic
</div>
<div
onclick="changeLanguage('russian', this)"
>
Russian
</div>
</div>
</div>
</div>
</aside>
</section>
<section class="appearance">
<h1>Appearance</h1>
<aside>
<div class="theme">
<p>Theme</p>
<div class="themes buttons-format">
<!-- Themes will be inserted here -->
</div>
</div>
</aside>
<aside>
<div class="time-display">
<p>Timer</p>
<div class="timer-status buttons-format">
<div
onclick="timerDisplay(true, this)"
class="current-selected"
>
Show
</div>
<div onclick="timerDisplay(false, this)">
Hide
</div>
</div>
</div>
</aside>
<aside>
<div class="font-size">
<p>Font Size</p>
<div class="sizes buttons-format">
<div onclick="changeFontSize(1, this)">1</div>
<div onclick="changeFontSize(1.5, this)">
1.5
</div>
<div onclick="changeFontSize(2, this)">2</div>
<div
onclick="changeFontSize(2.5, this)"
class="current-selected"
>
2.5
</div>
<div onclick="changeFontSize(3, this)">3</div>
</div>
</div>
</aside>
<aside>
<div class="font-family">
<p>Font Family</p>
<div class="families buttons-format">
<div
onclick="changeFontFamily('Roboto Mono', this)"
style="font-family: 'Roboto Mono'"
class="current-selected"
>
Roboto Mono
</div>
<div
onclick="changeFontFamily('Nova Mono', this)"
style="font-family: 'Nova Mono'"
>
Nova Mono
</div>
<div
onclick="changeFontFamily('Xanh Mono', this)"
style="font-family: 'Xanh Mono'"
>
Xanh Mono
</div>
<div
onclick="changeFontFamily('DM Mono', this)"
style="font-family: 'DM Mono'"
>
DM Mono
</div>
</div>
</div>
</aside>
</section>
<section class="behavior">
<h1>Test Behavior</h1>
<aside>
<div class="behavior switch-format">
<p>Smooth Auto-Scrolling</p>
<div
onclick="smoothScroll_switch(this)"
class="switch-btn switch-opened"
>
<div>
<div class="status"></div>
</div>
</div>
</div>
</aside>
<aside>
<div class="behavior switch-format">
<p>Show Mistakes</p>
<div
onclick="showMistakes_switch(this)"
class="switch-btn switch-opened"
>
<div>
<div class="status"></div>
</div>
</div>
</div>
</aside>
<aside>
<div class="behavior switch-format">
<p>Enable Sound</p>
<div
onclick="enableSound_switch(this)"
class="switch-btn switch-opened"
>
<div>
<div class="status"></div>
</div>
</div>
</div>
</aside>
<aside>
<div class="behavior switch-format">
<p>Backspace to previous word</p>
<div
onclick="backWord_switch(this)"
class="switch-btn switch-opened"
>
<div>
<div class="status"></div>
</div>
</div>
</div>
</aside>
</section>
</div>
<div class="custom-theme">
<div class="custom-theme-box">
<i
class="fas fa-times custom-theme-close"
onclick="customTheme(false)"
></i>
<h2>Customize Theme</h2>
<div>
<p>Background Color</p>
<input
type="number"
placeholder="R"
min="0"
max="255"
class="app_bg_r"
/>
<input
type="number"
placeholder="G"
min="0"
max="255"
class="app_bg_g"
/>
<input
type="number"
placeholder="B"
min="0"
max="255"
class="app_bg_b"
/>
</div>
<div>
<p>Main Color</p>
<input
type="number"
placeholder="R"
min="0"
max="255"
class="logo_clr_r"
/>
<input
type="number"
placeholder="G"
min="0"
max="255"
class="logo_clr_g"
/>
<input
type="number"
placeholder="B"
min="0"
max="255"
class="logo_clr_b"
/>
</div>
<div>
<p>Text Color</p>
<input
type="number"
placeholder="R"
min="0"
max="255"
class="text_clr_r"
/>
<input
type="number"
placeholder="G"
min="0"
max="255"
class="text_clr_g"
/>
<input
type="number"
placeholder="B"
min="0"
max="255"
class="text_clr_b"
/>
</div>
<div>
<p>Current Character</p>
<input
type="number"
placeholder="R"
min="0"
max="255"
class="current_clr_r"
/>
<input
type="number"
placeholder="G"
min="0"
max="255"
class="current_clr_g"
/>
<input
type="number"
placeholder="B"
min="0"
max="255"
class="current_clr_b"
/>
</div>
<div>
<p>Correct Character</p>
<input
type="number"
placeholder="R"
min="0"
max="255"
class="correct_clr_r"
/>
<input
type="number"
placeholder="G"
min="0"
max="255"
class="correct_clr_g"
/>
<input
type="number"
placeholder="B"
min="0"
max="255"
class="correct_clr_b"
/>
</div>
<div>
<p>Wrong Character</p>
<input
type="number"
placeholder="R"
min="0"
max="255"
class="wrong_clr_r"
/>
<input
type="number"
placeholder="G"
min="0"
max="255"
class="wrong_clr_g"
/>
<input
type="number"
placeholder="B"
min="0"
max="255"
class="wrong_clr_b"
/>
</div>
<div>
<p>Wrong Background</p>
<input
type="number"
placeholder="R"
min="0"
max="255"
class="wrong_bg_r"
/>
<input
type="number"
placeholder="G"
min="0"
max="255"
class="wrong_bg_g"
/>
<input
type="number"
placeholder="B"
min="0"
max="255"
class="wrong_bg_b"
/>
</div>
<div>
<p>Menu Background</p>
<input
type="number"
placeholder="R"
min="0"
max="255"
class="menu_bg_r"
/>
<input
type="number"
placeholder="G"
min="0"
max="255"
class="menu_bg_g"
/>
<input
type="number"
placeholder="B"
min="0"
max="255"
class="menu_bg_b"
/>
</div>
<div class="custom-theme-btns">
<input
type="button"
value="Set Theme"
onclick="setCustomTheme()"
/>
<!-- <input type="button" value="Reset Colors"> -->
</div>
</div>
</div>
</div>
<!-- Fake Input for Mobile Users -->
<input type="text" autocomplete="off" class="fake-input" />
<!-- Discord Div -->
<div class="discord-div">
<div class="discord-div-content">
<p>My discord username:</p>
<p class="discord-id">
<span class="my-discord">swordax</span
><span class="hover-note">Click to copy</span>
</p>
</div>
</div>
<!-- HTML Style Tags for Dynamic CSS -->
<style class="theme-root">
/* Theme will be selected from JS and inserted here */
</style>
<style class="test-size-css">
/* Defined in JS */
</style>
<style class="mistakes-display">
.wrong {
color: var(--wrong);
background-color: var(--wrong-bg);
}
</style>
</body>
</html>