-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
122 lines (119 loc) · 15.2 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
<!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>Guesser</title>
<link rel="shortcut icon" href="https://upload.wikimedia.org/wikipedia/commons/thumb/5/55/Magnifying_glass_icon.svg/1024px-Magnifying_glass_icon.svg.png" type="image/x-icon">
<link rel="stylesheet" href="style.css">
<script src="https://kit.fontawesome.com/a55874067a.js" crossorigin="anonymous"></script>
<script src="script.js"></script>
</head>
<body onload="loadGame()">
<div class="navbar">
<div class="navbar-left">
<i class="fa-solid fa-trophy icon" onclick="showScore()"></i>
<p id="score">SCORE: 0</p>
</div>
<div class="navbar-middle">
<img class="navbar-logo no-select" src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/55/Magnifying_glass_icon.svg/1024px-Magnifying_glass_icon.svg.png">
<p class="navbar-title no-select" class="text title-text">Guesser</p>
</div>
<div class="navbar-right">
<i class="fa-solid fa-lightbulb icon" onclick="takeHint()"></i>
<p id="total-hints">2 HINTS LEFT</p>
</div>
</div>
<div class="container">
<div id="board">
<div class="column text" id="row-1" value="1">
<input type="text" class="tile" autocomplete="off" autofocus placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="1"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="2"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="3"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="4"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="5"></input>
</div>
<div class="column text" id="row-2" value="2">
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="6"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="7"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="8"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="9"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="10"></input>
</div>
<div class="column text" id="row-3" value="3">
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="11"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="12"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="13"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="14"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="15"></input>
</div>
<div class="column text" id="row-4" value="4">
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="16"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="17"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="18"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="19"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="20"></input>
</div>
<div class="column text" id="row-5" value="5">
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="21"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="22"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="23"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="24"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="25"></input>
</div>
<div class="column text" id="row-6" value="6">
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="26"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="27"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="28"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="29"></input>
<input type="text" class="tile" autocomplete="off" placeholder="" onkeydown="return /[a-z]/i.test(event.key)" oninput="this.value = this.value.toUpperCase(); goToNextInput(this.id); onChange(parseInt(this.id), this.value)" onfocus="setTypingState(parseInt(this.id))" onblur="setTypingState(null)" maxlength="1" value="" id="30"></input>
</div>
</div>
<div id="keyboard" draggable="false">
<div class="keyboard-row">
<button class="keyboard-button" onclick="buttonClicked(this)">Q</button>
<button class="keyboard-button" onclick="buttonClicked(this)">W</button>
<button class="keyboard-button" onclick="buttonClicked(this)">E</button>
<button class="keyboard-button" onclick="buttonClicked(this)">R</button>
<button class="keyboard-button" onclick="buttonClicked(this)">T</button>
<button class="keyboard-button" onclick="buttonClicked(this)">Y</button>
<button class="keyboard-button" onclick="buttonClicked(this)">U</button>
<button class="keyboard-button" onclick="buttonClicked(this)">I</button>
<button class="keyboard-button" onclick="buttonClicked(this)">O</button>
<button class="keyboard-button" onclick="buttonClicked(this)">P</button>
</div>
<div class="keyboard-row">
<button class="keyboard-button" onclick="buttonClicked(this)">A</button>
<button class="keyboard-button" onclick="buttonClicked(this)">S</button>
<button class="keyboard-button" onclick="buttonClicked(this)">D</button>
<button class="keyboard-button" onclick="buttonClicked(this)">F</button>
<button class="keyboard-button" onclick="buttonClicked(this)">G</button>
<button class="keyboard-button" onclick="buttonClicked(this)">H</button>
<button class="keyboard-button" onclick="buttonClicked(this)">J</button>
<button class="keyboard-button" onclick="buttonClicked(this)">K</button>
<button class="keyboard-button" onclick="buttonClicked(this)">L</button>
</div>
<div class="keyboard-row">
<button class="keyboard-button" onclick="buttonClicked(this)">ENTER</button>
<button class="keyboard-button" onclick="buttonClicked(this)">Z</button>
<button class="keyboard-button" onclick="buttonClicked(this)">X</button>
<button class="keyboard-button" onclick="buttonClicked(this)">C</button>
<button class="keyboard-button" onclick="buttonClicked(this)">V</button>
<button class="keyboard-button" onclick="buttonClicked(this)">B</button>
<button class="keyboard-button" onclick="buttonClicked(this)">N</button>
<button class="keyboard-button" onclick="buttonClicked(this)">M</button>
<button class="keyboard-button" onclick="buttonClicked(this)"><i class="fa-solid fa-delete-left"></i></button>
</div>
</div>
<div id="notification-box">
NOTIFICATION: ???
</div>
<div id="modal" style="visibility: hidden">
<h1>You <span id="result"></span>!</h1>
<p>The word was: <span id="word"></span></p>
<button class="button" onclick="restartGame()">PLAY AGAIN</button>
</div>
</div>
</body>
</html>