-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathindex.html
296 lines (272 loc) · 15.5 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
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
294
295
296
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hua-Ming's Sudoku Puzzle Game</title>
<link href="sudoku-icon.png" rel="icon">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet">
<link href="./CSSstyles/mybootstrap.css" rel="stylesheet">
<link href="./CSSstyles/social-media-panel.css" rel="stylesheet">
<link href="./CSSstyles/digital-timer.css" rel="stylesheet">
<link href="./CSSstyles/progress-bar.css" rel="stylesheet">
<link href="./CSSstyles/animated-countdown-timer.css" rel="stylesheet">
<link href="./CSSstyles/snackbar-and-alert.css" rel="stylesheet">
<link href="./CSSstyles/theme-toggle-button.css" rel="stylesheet">
<link href="./CSSstyles/styles.css" rel="stylesheet">
</head>
<body>
<header class="center-screen">
<div class="header light">
<div class="inner-header flex">
<h1>Welcome to My <span style="color:blue">S</span><span style="color:red">u</span><span style="color:orange">d</span><span style="color:black">o</span><span style="color:cyan">k</span><span style="color:indigo">u</span> Puzzle Game!</h1>
<div id="theme-btn-container">
<input type="checkbox" name="theme-btn" id="theme-btn">
<label for="theme-btn">
<span class="box">
<span class="ball"></span>
<span class="scenary">
<span class="moon">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-moon"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>
</span>
<span class="sun">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-sun"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg>
</span>
</span>
</span>
</label>
</div>
</div>
<div class="github">
<!-- GitHub Sponsors -->
<a class="github-button" href="https://github.com/sponsors/huaminghuangtw" data-color-scheme="no-preference: dark_high_contrast; light: dark_high_contrast; dark: dark_high_contrast;" data-icon="octicon-heart" data-size="large" aria-label="Sponsor @huaminghuangtw on GitHub">Sponsor</a>
<!-- View on GitHub -->
<a class="github-button" href="https://github.com/huaminghuangtw/Web-Sudoku-Puzzle-Game" data-color-scheme="no-preference: dark_high_contrast; light: dark_high_contrast; dark: dark_high_contrast;" data-size="large" aria-label="View huaminghuangtw/Web-Sudoku-Puzzle-Game on GitHub">View on GitHub</a>
<!-- GitHub Star -->
<a class="github-button" href="https://github.com/huaminghuangtw/Web-Sudoku-Puzzle-Game" data-color-scheme="no-preference: dark_high_contrast; light: dark_high_contrast; dark: dark_high_contrast;" data-icon="octicon-star" data-size="large" data-show-count="true"
aria-label="Star huaminghuangtw/Web-Sudoku-Puzzle-Game on GitHub">Star</a>
</div>
<!--Waves Container-->
<div>
<svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto">
<defs>
<path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z" />
</defs>
<g class="parallax">
<use xlink:href="#gentle-wave" x="48" y="0" fill="rgba(255,255,255,0.7" />
<use xlink:href="#gentle-wave" x="48" y="3" fill="rgba(255,255,255,0.5)" />
<use xlink:href="#gentle-wave" x="48" y="5" fill="rgba(255,255,255,0.3)" />
<use xlink:href="#gentle-wave" x="48" y="7" fill="#fff" />
</g>
</svg>
</div>
</div>
<table class="center-screen" style="max-width: 100%; border-spacing: 50px 0; padding-top: 10px; padding-bottom: 30px;">
<tr>
<td style="text-align: center; font-size: 24px; padding-bottom: 3px;">Choose difficulty</td>
<td style="text-align: center; font-size: 24px; padding-bottom: 3px;">Choose time</td>
</tr>
<tr>
<td style="text-align: center">
<div class="btn-group" role="group">
<input type="radio" class="btn-check" id="difficulty-easy" name="diff" value="easy" autocomplete="off" checked>
<label class="btn btn-outline-primary" for="difficulty-easy">
<i class="fas fa-dice-one"></i> Easy
</label>
<input type="radio" class="btn-check" id="difficulty-medium" name="diff" value="medium" autocomplete="off">
<label class="btn btn-outline-primary" for="difficulty-medium">
<i class="fas fa-dice-two"></i> Medium
</label>
<input type="radio" class="btn-check" id="difficulty-hard" name="diff" value="hard" autocomplete="off">
<label class="btn btn-outline-primary" for="difficulty-hard">
<i class="fas fa-dice-three"></i> Hard
</label>
<input type="radio" class="btn-check" id="difficulty-veryhard" name="diff" value="veryhard" autocomplete="off">
<label class="btn btn-outline-primary" for="difficulty-veryhard">
<i class="fas fa-dice-four"></i> Very Hard
</label>
</div>
</td>
<td style="text-align: center">
<div class="btn-group" role="group">
<input type="radio" class="btn-check" id="time-3mins" name="time" value="three" autocomplete="off" checked>
<label class="btn btn-outline-primary" for="time-3mins">
<i class="fas fa-hourglass-start"></i> 3 mins
</label>
<input type="radio" class="btn-check" id="time-5mins" name="time" value="five" autocomplete="off">
<label class="btn btn-outline-primary" for="time-5mins">
<i class="fas fa-hourglass-start"></i> 5 mins
</label>
<input type="radio" class="btn-check" id="time-10mins" name="time" value="ten" autocomplete="off">
<label class="btn btn-outline-primary" for="time-10mins">
<i class="fas fa-hourglass-start"></i> 10 mins
</label>
<input type="radio" class="btn-check" id="time-stopwatch" name="time" value="stopwatch" autocomplete="off">
<label class="btn btn-outline-primary" for="time-stopwatch">
<i class="fas fa-stopwatch"></i> Stopwatch
</label>
</div>
</td>
</tr>
</table>
<button type="button" id="start-btn" class="mybutton">New game!</button>
</header>
<div align="center" id="spinner-container" class="hidden">
<div class="row">
<div id="spinner-element-1" class="spinner-border" style="margin-top: 35px; width: 4rem; height: 4rem;" role="status"></div>
</div>
<br>
<div id="spinner-element-2" class="row" style="font-size: 20px;">
<strong>Loading puzzle...</strong>
</div>
</div>
<div id="game-container">
<div class="alert alert-warning center-screen hidden" id="alert-pause" role="alert">
<i class="far fa-pause-circle"></i> PAUSED
</div>
<div id="stats" class="center-screen">
<!-- Countdown timer -->
<div id="time-1">
<!-- Type 1 -->
<div id="animated-timer-container" class="hidden" style="margin-top: 35px"></div>
<!-- Type 2 -->
<div id="digital-timer-container" class="hidden" style="margin-top: 35px"></div>
<div id="progress-bar-container" class="hidden"></div>
</div>
<!-- Stopwatch -->
<div id="time-2">
<div id="stopwatch-container" class="hidden" style="margin-top: 35px"></div>
</div>
<p id="lives"></p>
<div class="snackbar" id="snackbar-win">You won!🏆</div>
<div class="snackbar" id="snackbar-lose">You lost!☹️</div>
</div>
<div id="game" class="center-screen">
<div id="board"></div>
<div id="number-container" class="hidden">
<p id="one">1</p>
<p id="two">2</p>
<p id="three">3</p>
<p id="four">4</p>
<p id="five">5</p>
<p id="six">6</p>
<p id="seven">7</p>
<p id="eight">8</p>
<p id="nine">9</p>
</div>
</div>
</div>
<div class="toast" id="myToast" style="position: absolute; top: 50%; right: 0;">
<div class="toast-header" style="font-size: 26px; background-color: #dfd8cf; color: black;">
<strong class="me-auto"><i class="fas fa-atom"></i> Tips</strong>
<button type="button" class="btn-close" data-bs-dismiss="toast"></button>
</div>
<div class="toast-body" style="font-size: 24px; background-color: #dfd8cf; color: black;"></div>
</div>
<p>
<div class="center-screen">
<div class="btn-group" role="group">
<button type="button" id="tips-btn" class="btn btn-secondary btn-sm" disabled rel="tooltip" title="Show all possible values for each empty cell." data-placement="bottom">
<i class="fas fa-atom"></i> Tips
</button>
<button type="button" id="solve-btn" class="btn btn-secondary btn-sm" disabled rel="tooltip" title="Solve the current Sudoku puzzle." data-placement="bottom">
<i class="far fa-lightbulb"></i> Show solution
</button>
<button type="button" id="solve-one-step-btn" class="btn btn-secondary btn-sm" disabled rel="tooltip" title="Solve one empty cell for the current Sudoku puzzle." data-placement="bottom">
<i class="fas fa-angle-double-right"></i> Solve one step
</button>
</div>
<div class="btn-group" role="group">
<button type="button" id="refresh-btn" class="btn btn-secondary btn-sm" disabled rel="tooltip" title="Refresh the Sudoku board with the same difficulty." data-placement="bottom">
<i class="fas fa-sync"></i> Refresh puzzle
</button>
<button type="button" id="restart-btn" class="btn btn-secondary btn-sm" disabled rel="tooltip" title="Restart the puzzle by clearing all cells you just tried to solve." data-placement="bottom">
<i class="fas fa-undo"></i> Restart puzzle
</button>
</div>
<div class="btn-group" role="group">
<button type="button" id="pause-btn" class="btn btn-secondary btn-sm" disabled>
<i class="fas fa-pause"></i> Pause
</button>
<button type="button" id="resume-btn" class="btn btn-secondary btn-sm" disabled>
<i class="fas fa-hourglass-half"></i> Resume
</button>
</div>
</div>
</p>
<hr style="width: 100%; margin-left: auto; margin-right: auto;">
<footer>
<p class="small text-center text-muted">Created by <a target="_blank" href="https://huaminghuangtw.github.io">Hua-Ming Huang</a>. ©
<script>
document.write(new Date().getFullYear());
</script>
</p>
</footer>
<div class="social-panel-container">
<div class="social-panel">
<p>
Created with <i class="fa fa-heart" id="heart"></i> by
<a target="_blank" href="https://huaminghuangtw.github.io">Hua-Ming Huang</a>
</p>
<button class="close-btn"><i class="fas fa-times"></i></button>
<h4>Reach me out on</h4>
<ul>
<li>
<a href="mailto:[email protected]" target="_blank">
<i class="fas fa-at"></i>
</a>
</li>
<li>
<a href="https://www.linkedin.com/in/huaminghuangtw" target="_blank">
<i class="fab fa-linkedin"></i>
</a>
</li>
<li>
<a href="https://github.com/huaminghuangtw" target="_blank">
<i class="fab fa-github"></i>
</a>
</li>
<li>
<a href="https://www.strava.com/athletes/huaminghuang" target="_blank">
<i class="fab fa-strava"></i>
</a>
</li>
<li>
<a href="https://www.facebook.com/huaming.huang.tw/" target="_blank">
<i class="fab fa-facebook"></i>
</a>
</li>
<li>
<a href="https://www.instagram.com/hmhuang__/" target="_blank">
<i class="fab fa-instagram"></i>
</a>
</li>
<!-- <li>
<a href="https://api.whatsapp.com/send?phone=491786042963&text=Hello!" target="_blank">
<i class="fab fa-whatsapp"></i>
</a>
</li> -->
</ul>
</div>
</div>
<button class="floating-btn">
Get in Touch
</button>
<!-- JavaScript (Placed at the bottom of body tag so that the DOM could load faster) -->
<script async defer src="https://buttons.github.io/buttons.js"></script>
<!-- jQuery first, then Popper.js, then Bootstrap Bundle JS -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin=" anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"></script>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script src="./JSscripts/helperSudoku.js"></script>
<script src="./JSscripts/utilitySudoku.js"></script>
<script src="./JSscripts/solveSudoku.js"></script>
<script src="./JSscripts/generateSudoku.js"></script>
<script src="./JSscripts/candidatesSudoku.js"></script>
<script src="./JSscripts/stopwatch.js"></script>
<script src="./JSscripts/countdown-timer.js"></script>
<script src="./JSscripts/progress-bar.js"></script>
<script src="./JSscripts/app.js"></script>
</body>
</html>