-
Notifications
You must be signed in to change notification settings - Fork 0
/
huedle1.html
167 lines (162 loc) · 6.62 KB
/
huedle1.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
<!DOCTYPE html>
<html>
<head>
<title>Huedle</title>
<link rel="stylesheet" href="huedle1.css">
<script src = "huedle1.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>
<div id="circle">
<canvas id="circleCanvas" width="1000" height="660"></canvas>
</div>
<div id = "color-guide">
<div class = "color-guide-label">c</div>
<div class = "color-guide-label">o</div>
<div class = "color-guide-label">l</div>
<div class = "color-guide-label">o</div>
<div class = "color-guide-label">r</div>
<br>
<div class = "color-guide-label">g</div>
<div class = "color-guide-label">u</div>
<div class = "color-guide-label">i</div>
<div class = "color-guide-label">d</div>
<div class = "color-guide-label">e</div>
</div>
<div id="input-div">
<div id="guess1">
<input class="input" id="r1" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g1" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b1" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div id="guess2">
<input class="input" id="r2" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g2" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b2" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div id="guess3">
<input class="input" id="r3" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g3" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b3" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div id="guess4">
<input class="input" id="r4" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g4" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b4" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div id="guess5">
<input class="input" id="r5" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g5" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b5" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<div id="guess6">
<input class="input" id="r6" type="number" min="0" max="255" size="3" placeholder="R" disabled>
<input class="input" id="g6" type="number" min="0" max="255" size="3" placeholder="G" disabled>
<input class="input" id="b6" type="number" min="0" max="255" size="3" placeholder="B" disabled>
</div>
<!-- add error for invalid number -->
<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
</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 for you to
guess the RGB value of the randomly generated
color within six 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>
</body>
</html>