-
Notifications
You must be signed in to change notification settings - Fork 0
/
huedle2.html
293 lines (286 loc) · 15.6 KB
/
huedle2.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
<!DOCTYPE html>
<html>
<head>
<title>Huedle</title>
<link rel="stylesheet" href="huedle2.css">
<script src = "huedle2.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
display: none;}
</style>
</head>
<body>
<div class = "header">
<h2>HUEDLE</h2>
<a href="index.html">home</a>
<button id="instructions" onclick="instructions()">instructions</button>
</div>
<!--<p id="yum"></p>
<input class="input" id="INPUTPUTPUT" placeholder="enter some stuff">-->
<div id="circle">
<canvas id="circleCanvas" width="780" height="2150"></canvas>
</div>
<div id = "color-guide"></div>
<div id="input-div">
<div class="guess1">
<input class="input" id="r1a" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g1a" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b1a" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess2">
<input class="input" id="r2a" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g2a" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b2a" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess3">
<input class="input" id="r3a" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g3a" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b3a" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess4">
<input class="input" id="r4a" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g4a" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b4a" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess5">
<input class="input" id="r5a" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g5a" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b5a" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess6">
<input class="input" id="r6a" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g6a" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b6a" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess7">
<input class="input" id="r7a" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g7a" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b7a" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess8">
<input class="input" id="r8a" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g8a" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b8a" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess9">
<input class="input" id="r9a" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g9a" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b9a" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess10">
<input class="input" id="r10a" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g10a" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b10a" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<br><br><br>
<div class="guess1">
<input class="input" id="r1b" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g1b" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b1b" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess2">
<input class="input" id="r2b" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g2b" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b2b" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess3">
<input class="input" id="r3b" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g3b" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b3b" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess4">
<input class="input" id="r4b" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g4b" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b4b" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess5">
<input class="input" id="r5b" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g5b" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b5b" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess6">
<input class="input" id="r6b" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g6b" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b6b" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess7">
<input class="input" id="r7b" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g7b" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b7b" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess8">
<input class="input" id="r8b" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g8b" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b8b" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess9">
<input class="input" id="r9b" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g9b" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b9b" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess10">
<input class="input" id="r10b" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g10b" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b10b" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<br><br>
<div class="guess1">
<input class="input" id="r1c" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g1c" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b1c" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess2">
<input class="input" id="r2c" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g2c" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b2c" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess3">
<input class="input" id="r3c" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g3c" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b3c" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess4">
<input class="input" id="r4c" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g4c" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b4c" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess5">
<input class="input" id="r5c" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g5c" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b5c" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess6">
<input class="input" id="r6c" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g6c" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b6c" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess7">
<input class="input" id="r7c" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g7c" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b7c" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess8">
<input class="input" id="r8c" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g8c" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b8c" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess9">
<input class="input" id="r9c" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g9c" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b9c" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div class="guess10">
<input class="input" id="r10c" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g10c" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b10c" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<button id="click-to-check" type="submit" onclick="guess()">click to check</button>
</div>
<!-- Win Modal -->
<div id="winModal" class="modal">
<div class="modal-content">
<p id = "win">YOU WIN!</p>
<p id="win-message"></p>
<a href="menu.html" id="play-again">play again</a>
<a href="index.html" id="quit">quit</a>
</div>
</div>
<!-- Lose Modal -->
<div id="loseModal" class="modal">
<div class="modal-content">
<p id = "lose">YOU LOSE</p>
<p id="lose-message"></p>
<a href="menu.html" id="play-again">play again</a>
<a href="index.html" id="quit">quit</a>
</div>
</div>
<!-- Instructions Modal -->
<div id="instructionModal" class="modal">
<div class="modal-content">
<span class="close">×</span>
<div id = "instructions-color-guide"></div>
<div class = "ticks" id="tick1">
|
|
|
|
|
|
|
|
</div>
<div class = "tick-labels">
correct
< 15 away
< 25 away
< 50 away
< 100 away
< 150 away
< 200 away
> 200 away
<!--moog! correct
15 away
25 away
50 away
100 away
150 away
200 away
> 200 away-->
</div>
<!--<div class = "ticks" id="tick2">|</div>
<div class = "ticks" id="tick3">|</div>
<div class = "ticks" id="tick4">|</div>
<div class = "ticks" id="tick5">|</div>
<div class = "ticks" id="tick6">|</div>
<div class = "ticks" id="tick7">|</div>
<div class = "ticks" id="tick8">|</div>-->
<p id="instruction-message">
✧ The objective of this game is to
guess the RGB value of the randomly generated
colors within ten guesses<br><br>
✧ You will know how close your RGB values are to
the actual answer by the coloring of the input
values after they are entered <br><br>
✧ The diagram above demonstrates the colors that the
input boxes will turn depending on how far your guess
is from the actual answer<br><br>
✧ The colors are similar to a hot-cold game in which
blues and purples are far away from the answer, but
pinks and reds are closer<br><br>
✧ You can always refer to it on the game page by clicking
the "instructions" button at the top or by looking at the
"color guide" on the right
<br><br>
✧ When an RGB input that you guessed is within
5 of the actual value, that square will turn green
<br><br>
✧ When all the input squares are green, you've won
the game!
</p>
</div>
</div>
<!-- Error Modal -->
<div id="errorModal" class="modal">
<div class="modal-content">
<p id = "error">ERROR</p>
<p id = "error-message">invalid input</p>
<p id="error-message-continued"></p>
</div>
</div>
<script>
run();
</script>
<br>
<p id="message"></p>
<p class="brbr">. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .</p>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<p class="brbr">. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .</p>
</body>
</html>