-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
256 lines (256 loc) · 7.48 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
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
<!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" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"
/>
<link rel="stylesheet" href="styles.css" />
<script src="script.js" defer></script>
<title>Mastermind</title>
</head>
<body>
<header>
<h1>Mastermind</h1>
</header>
<main>
<section>
<aside>
<p>
"What if I told you none of it was accidental? ... It was all by
design, 'cause I'm a mastermind." —Taylor Swift,
<span class="italics">Mastermind</span>
</p>
<audio src="assets/taylorswiftmastermind.mp3" controls></audio>
</aside>
<h2>Turn Number:<span id="turn"></span></h2>
<p class="result-msg"></p>
<p class="guess-text">Make your guess:</p>
<div id="choice-container">
<div class="color1" data-index="0"></div>
<div class="color2" data-index="1"></div>
<div class="color3" data-index="2"></div>
<div class="color4" data-index="3"></div>
<div class="color5" data-index="4"></div>
<div class="color6" data-index="5"></div>
</div>
<p class="error-msg"></p>
<button id="delete-btn">Delete</button>
<button id="clear-btn">Clear</button>
<button id="submit-btn">Submit</button>
<br />
<button id="reset-btn">Reset Game</button>
<button id="show-btn">Show Code</button>
<div id="code-box">
<p>The code:</p>
<div class="colors-container">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
</section>
<section id="gameboard">
<div class="guess-container" id="1">
<div class="colors-container">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="miniboard">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="guess-container" id="2">
<div class="colors-container">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="miniboard">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="guess-container" id="3">
<div class="colors-container">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="miniboard">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="guess-container" id="4">
<div class="colors-container">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="miniboard">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="guess-container" id="5">
<div class="colors-container">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="miniboard">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="guess-container" id="6">
<div class="colors-container">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="miniboard">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="guess-container" id="7">
<div class="colors-container">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="miniboard">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="guess-container" id="8">
<div class="colors-container">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="miniboard">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="guess-container" id="9">
<div class="colors-container">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="miniboard">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="guess-container" id="10">
<div class="colors-container">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="miniboard">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="guess-container" id="11">
<div class="colors-container">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="miniboard">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="guess-container" id="12">
<div class="colors-container">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div class="miniboard">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
</section>
<section class="instructions">
<h1>How to play the game:</h1>
<p>
A randomized "code" of four colors (including duplicates) has been
generated. You have <span class="bold-text">12 tries</span> to guess
the secret code by selecting a combination of colors from the box on
the furthest left.
</p>
<p>
Clicking a color will add the color to your guess. You can edit your
guess by deleting a color or clearing the guess entirely. You can also
choose to reset the game during or after play, and you can toggle the
hidden code if you want to admit you're not a mastermind.
</p>
<p>
Once you submit your guess, the mini-board to the right of your guess
will display how accurate it was. A
<span class="yellow">yellow</span> circle means your guess contains
one of the correct colors but in an incorrect position. A
<span class="green">green</span> circle means your guess contains one
of the correct colors in the correct position.
<span class="bold-text"
>The mini-board does not confirm the order of your guess.</span
>
</p>
<p>Four green circles means you've won the game!</p>
</section>
</main>
</body>
</html>