generated from Code-Institute-Org/gitpod-full-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path404.html
261 lines (243 loc) · 14.4 KB
/
404.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
<!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">
<!-- DMcC 28/05/23 include Roboto slab font for title -->
<meta name="description" content="Humble Numble">
<meta name="keywords"
content="wordle, Wordle, Josh Wardle, puzzle, number puzzle, numble, Numble, equation, solve, daily puzzle, codeword, solver, free">
<style>
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Roboto+Slab:wght@400;690&display=swap');
</style>
<link rel="stylesheet" href="./assets/css/style.css">
<title>Humble Numble</title>
</head>
<body>
<div id="helpOverLay" class="noDisplay">
<div id="helpText" class="noDisplay">
<!-- This is a pop up window/ modal of help text -->
<!-- DMcC 28/05/23 add button to close the pop-up help window-->
<div> <!-- DMcC 28/05/23 created a separate div as want this element to right-align -->
<button id="closeHelpText-btn" onclick="hideHelp();" aria-label="Hide Help button">X</button>
</div>
<!-- DMcC 28/05/23 This is help text section -->
<h2>How to Play</h2>
<h3>Guess the equation, to reach a target result, in 6 tries.</h3>
<ul>
<li>* All guesses are in the form <em>num1 op num2 op num3</em> where</li>
<li> - num is a number between 1 and 20 </li>
<li> - op is a mathematical operator + - * / (add subtract multiply divide) </li>
<li>* The colour of the tiles will change to show how close your guess was to the solution.</li>
<li></li>
<li><b>Examples</b></li>
</ul>
<img src="assets/images/help_example1.jpg"
alt="Example of guess row with all columns greyed out(not present)">
<p>15, 1, 6, +, - are not in the equation in any spot</p>
<img src="assets/images/help_example2.jpg"
alt="Example of guess with orange (wrong position) and green(correct position)">
<ul>
<li><em>5</em> is in the equation but not at 3rd position (so must be 1st or 5th position)</li>
<li>Multiply * is correctly guessed at the 2nd position, as is divide / at the 4th position.</li>
<li></li>
<li>Equations are evaluated as follows:</li>
<li> * any multiply operation(s) are calculated first</li>
<li> / any divide operation(s) are calculated next</li>
<li> + any add operation(s) are calculated next</li>
<li> – any minus operation(s) are calculated last</li>
<li>e.g. 3+2*5 is calculated as 3+(2*5) = 3+10 = 13 (grrrr)</li>
<li></li>
<li><b>Notes:</b></li>
<li>the current version of Humble Numble WILL permit you to enter an equation that does not
calculate to the required total...this may help when you are REALLY stuck!</li>
<li>The <em>exact</em> equation is required, ie 1+2+3=6 will not accept 3+1+2 as a solution (grrrr
again)
</li>
<li>(and yes, the same number can appear twice grrrrr)</li>
<li>Happy calculating!</li>
</ul>
</div> <!-- end div 'helpText'-->
</div> <!-- end div helpOverLay -->
<div id="statsOverLay" class="noDisplay">
<div id="statsText" class="noDisplay">
<!-- This is a pop up window/ modal of Statistics -->
<div> <!-- DMcC 28/05/23 created a separate div as want this element to right-align -->
<button id="closeStatsText-btn" onclick="hideStats();" aria-label="Hide Stats button">X</button>
</div>
<!-- DMcC 28/05/23 This is player statistics section -->
<h2>STATISTICS</h2>
<h3>Played Win% Current Streak Max Streak<br>
GUESS DISTRIBUTION</h3>
<button id="shareStats-btn" onclick="shareStats();" aria-label="Share Stats button">X</button>
</div> <!-- end div 'statsText'-->
</div> <!-- end div statsOverLay -->
<!-- DMcC 29/05/23 error page for when it all goes wrong-->
<div id="gameHead" class="yesDisplay">
<header>
<div id="headerContainer">
<h1>Humble Numble</h1>
<nav id="navbar">
<!-- Add list items for navbar-->
<ul id="menu">
<li> <button class="navButton" onclick="displayHelp();" aria-label="Show Help button">
<img src="./assets/images/help-icon.jpg"
alt="Question mark type icon to access game help"></button>
</li>
<li>
<button class="navButton" onclick="displayStats();" aria-label="Show Stats button">
<img src="./assets/images/stats-icon.jpg"
alt="Graph type symbol to access player Statistics"></button>
</li>
<li>
<button class="navButton" onclick="displayStats();" aria-label="Show Settings button">
<img src="./assets/images/settings-icon.jpg"
alt="Cog symbol to access game settings"></button>
</li>
</ul>
</nav> <!-- end navbar -->
</div> <!-- end div headerContainer -->
</header>
<p id="sorry" class="yesDisplay"></p>
<p class="noDisplay">Target: <span class="targetValue noDisplay">0</span> Attempt: <span
id="attemptNum">1</span>
<span id="colNum" class="noDisplay">0</span>
</p>
</div> <!-- end div gameHead-->
<div id="container" class="yesDisplay">
<div id="game">
<div id="gamePanel">
<!-- DMcC c. 10/05/23: The solutionRow below will be populated and used for comparison and for testing purposes -->
<!-- but will not be displayed in the live game -->
<div class="row" id="solutionRow">
<div class="tile solutionRow">?</div>
<div class="tile solutionRow">+-*/</div>
<div class="tile solutionRow">?</div>
<div class="tile solutionRow">+-*/</div>
<div class="tile solutionRow">?</div>
<div class="tile">=</div>
<div class="tile solutionRow targetValue">0</div>
</div>
<!-- DMcC 28/05/23 The resultOverlay below is a placeholder for positioning game result once the player has reached the solution -->
<!-- or exceeded 6 tries -->
<div class="noDisplay" id="resultOverLay">
<div class="noDisplay" id="resultText">
Example</div>
</div>
<!-- 08/05/23 DMcC: Code to create grid below was based on https://laracasts.com/series/wordle-workshop/episodes/2 -->
<!-- to create a display grid of 6 rows with 7 entries in each: -->
<!-- For this Numble game, 2 rightmost entries will be pre-populated with '=' and targetValue -->
<!-- 5 leftmost entries on each row represent the user guess fields -->
<!-- DMcC 17/05/23 Add a class per tile, this can be dynamically altered by js and styled by CSS to change background colour-->
<!-- according to match status of the guessed number/operation ie present (orange)/ correct (green)/ absent (dark gray) -->
<div class="row" id="row1">
<div class="tile row1">E</div>
<div class="tile row1">R</div>
<div class="tile row1">R</div>
<div class="tile row1">O</div>
<div class="tile row1">R</div>
<div class="tile">=</div>
<div class="tile row1 targetValue">!</div>
</div>
<!-- <div class="row" id="row2">
<div class="tile row2">E</div>
<div class="tile row2">R</div>
<div class="tile row2">R</div>
<div class="tile row2">O</div>
<div class="tile row2">R</div>
<div class="tile">=</div>
<div class="tile row2 targetValue">!</div>
</div>
<div class="row" id="row3">
<div class="tile row3">E</div>
<div class="tile row3">R</div>
<div class="tile row3">R</div>
<div class="tile row3">O</div>
<div class="tile row3">R</div>
<div class="tile">=</div>
<div class="tile row3 targetValue">!</div>
</div>
<div class="row" id="row4">
<div class="tile row4">E</div>
<div class="tile row4">R</div>
<div class="tile row4">R</div>
<div class="tile row4">O</div>
<div class="tile row4">R</div>
<div class="tile">=</div>
<div class="tile row4 targetValue">!</div>
</div>
<div class="row" id="row5">
<div class="tile row5">E</div>
<div class="tile row5">R</div>
<div class="tile row5">R</div>
<div class="tile row5">O</div>
<div class="tile row5">R</div>
<div class="tile">=</div>
<div class="tile row5 targetValue">!</div>
</div>
<div class="row" id="row6">
<div class="tile row6">E</div>
<div class="tile row6">R</div>
<div class="tile row6">R</div>
<div class="tile row6">O</div>
<div class="tile row6">R</div>
<div class="tile">=</div>
<div class="tile row6 targetValue">!</div>
</div>
</div> --><!-- end div gamePanel -->
<br>
<h2>Oops, something went wrong.</h2>
<h2>Please try again later.</h2>
<!-- Code below based on Ian Lenehan 'Build a Wordle clone using HTML, CSS & Javascript' -->
<!-- DMcC 17/05/23 Extended to include class (letter status) which will become an attribute modifiable by js and colour-styled-->
<!-- using CSS ie background colour of numbers/operators present(but in the wrong position) will be styled orange; absent dark-grey; -->
<!-- and present in correct position styled green background colour -->
<!-- DMcC 17/05/23 Expanded to include id=key value as struggling somewhat with understanding the data-key fiunctionality -->
<!-- no need for selection panel on this 404 page
<div id="selectionPanel">
<div class="selection-row">
<div class="spacer-half"></div>
<button id="1" data-key="1" onClick="keyClick(this.id)">1</button>
<button id="2" data-key="2" onClick="keyClick(this.id)">2</button>
<button id="3" data-key="3" onClick="keyClick(this.id)">3</button>
<button id="4" data-key="4" onClick="keyClick(this.id)">4</button>
<button id="5" data-key="5" onClick="keyClick(this.id)">5</button>
<button id="6" data-key="6" onClick="keyClick(this.id)">6</button>
<button id="7" data-key="7" onClick="keyClick(this.id)">7</button>
<button id="8" data-key="8" onClick="keyClick(this.id)">8</button>
<button id="9" data-key="9" onClick="keyClick(this.id)">9</button>
<button id="10" data-key="10" onClick="keyClick(this.id)">10</button>
<div class="spacer-half"></div>
</div> -->
<!-- End selection-row -->
<!-- DMcC 29/05/23: no need for selection panel on this 404 page
<div class="selection-row">
<button id="11" data-key="11" onClick="keyClick(this.id)">11</button>
<button id="12" data-key="12" onClick="keyClick(this.id)">12</button>
<button id="13" data-key="13" onClick="keyClick(this.id)">13</button>
<button id="14" data-key="14" onClick="keyClick(this.id)">14</button>
<button id="15" data-key="15" onClick="keyClick(this.id)">15</button>
<button id="16" data-key="16" onClick="keyClick(this.id)">16</button>
<button id="17" data-key="17" onClick="keyClick(this.id)">17</button>
<button id="18" data-key="18" onClick="keyClick(this.id)">18</button>
<button id="19" data-key="19" onClick="keyClick(this.id)">19</button>
<button id="20" data-key="20" onClick="keyClick(this.id)">20</button>
</div> -->
<!-- End selection-row -->
<!-- <div class="selection-row">
<button id="enter" data-key="enter" class="wide-button" onclick="checkSolution();">Enter</button>
<button id="+" data-key="+" class="wide-button" onClick="keyClick(this.id)">+</button>
<button id="-" data-key="-" class="wide-button" onClick="keyClick(this.id)">-</button>
<button id="*" data-key="*" class="wide-button" onClick="keyClick(this.id)">*</button>
<button id="/" data-key="/" class="wide-button" onClick="keyClick(this.id)">/</button>
<button id="del" data-key="del" class="wide-button" onclick="backSpace();">Del</button>
</div> -->
<!-- End div selection-row -->
</div> <!-- End div selectionPanel-->
</div> <!-- End div game -->
</div> <!-- end div container -->
<!-- Add js script to run last thing (ie after the DOM is loaded)-->
<script src="./assets/js/game.js"></script>
</body>
</html>