-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
117 lines (116 loc) · 4.13 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ATLA Typing Game</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="typingGame">
<div id="header">
<h1>Avatar The Last Airbender
<br>Typing Game
</h1>
<span><em>The game will <b>Start</b> once you <b>Start Typing</b></em></span>
</div>
<div>
<input
ref="userInput"
v-model="userInput"
type="text"
:disabled="correctlyTypedWords.length === quoteWords.length"
>
<div v-if="isLoading" class="loading-spinner"></div>
<p id="pContentId" class="pContent">
<span
v-for="(charObj, index) in quoteCharacters"
:key="index"
class="p-span"
:class="{
'default': charObj.isDefault,
'correct': charObj.isDefault ? false : charObj.isCorrect,
'incorrect': charObj.isDefault ? false : charObj.isIncorrect,
}"
>
{{ charObj.char }}
</span>
<br>
<button @click="changeImg" id="byWhoId" class="byWho">
{{ randomQuoteByWho }}
</button>
<img src="./copy-text.svg" class="copyTextButton" @click="copyText">
<span id="copyMsgId" class="copyMsg">Copied!</span>
</br>
<button @click="getRandomQuote" class="newQuoteButton">New Quote!</button>
<button @click="getHighScores" class="highScoresButton">Highscores</button>
</p>
</div>
<div id="byWhoModalId" class="byWhoModal" @click="closeModal">
<div class="byWhoModal-content" @click="insideClick">
<span @click="closeModal" class="close-btn">×</span>
<img :src="imageSource">
</div>
</div>
<div id="highScoresModalId" class="highScoresModal" @click="closeModal">
<div class="highScoresModal-content" @click="insideClick">
<span @click="closeModal" class="close-btn">×</span>
<h1>Highscores:</h1>
<span v-if="!highScoreListMapped.length">
No highscores yet :(
<br><br>
</span>
<span v-for="(highScoreItem, index2) in highScoreListMapped">
<div class="hsiQuote-container">
<span class ="hsiQuote">
"{{ highScoreItem.quote }}"
<br>
</span>
<span class="hsiByWho">
<b>{{ highScoreItem.byWho }}</b>
</span>
</div>
<span class="hsiScore">
<em><b>{{ highScoreItem.score }} wpm</b></em>
</span>
<button class="deleteHSQuoteButton" @click="deleteHSQuote(index2)">Delete</button>
<hr class="separationLine">
</span>
<button @click="saveHighScore" class="saveHighScoreButton">Save Highscores</button>
<span id="savedMsgId" class="savedMsg">Saved!</span>
<span id="deletedMsgId" class="deletedMsg">Deleted!</span>
</div>
</div>
<div id="endModalId" class="endModal" @click="closeModal">
<div class="endModal-content" @click="insideClick">
<span @click="closeModal" class="close-btn">×</span>
<h2>You finished!</h2>
<span>
You have a <em><b>{{ typingSpeed }} wpm</b></em> average!
<span v-if="quoteHighScoreMsg === 'New Quote Highscore!'">
<br><br>
<em><b>{{ quoteHighScoreMsg }}</b></em>
</span>
<span v-else>
<br><br>
{{ quoteHighScoreMsg }} <em><b>{{ highScoreQuote }} wpm</b></em>
</span>
<span v-if="highScoreMsg === 'New Overall Highscore!'">
<br><br>
<em><b>{{ highScoreMsg }}</b></em>
</span>
<span v-else>
<br><br>
{{ highScoreMsg }}<em><b>{{ highScore }} wpm</b></em>
</span>
<br><br>
<button @click="getRandomQuote" class="newQuoteButton2">New Quote!</button>
</span>
</div>
</div>
</div>
<script src="https://unpkg.com/vue@3"></script>
<script src="app.js"></script>
</body>
</html>