generated from Code-Institute-Org/gitpod-full-template
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathgame.html
237 lines (203 loc) · 9.12 KB
/
game.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A Festive Quiz Game, test your knowledge of Christmas trivia">
<meta name="keywords" content="festive, quiz, game, christmas, trivia game">
<!-- Favicon -->
<link rel="apple-touch-icon" sizes="180x180" href="assets/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/favicon/favicon-16x16.png">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<!-- Font awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="assets/css/style.css">
<link rel="stylesheet" href="assets/css/game.css">
<title>Festive Quiz - Game Board</title>
</head>
<body class="game-image vh-100">
<div class="container">
<!-- Navbar row -->
<div id="navbar" class="row px-3">
<div class="col-6 p-0 m-0 d-flex justify-content-lg-center">
<a href="index.html" class="icon-btn user-centric">
<i class="fa-solid fa-circle-arrow-left fa-l"></i>
</a>
</div>
<div class="col-6 p-0 m-0 d-flex justify-content-end justify-content-lg-center">
<button id="sound-wrapper" class="icon-btn user-centric me-2">
<!-- switch to mute icon when clicked using JS -->
</button>
<button id="rulesButton" type="button" class="icon-btn user-centric" data-bs-toggle="modal" data-bs-target="#rulesModal">
<i class="fas fa-l fa-question-circle"></i>
</button>
</div>
</div>
<!-- ./Navbar row -->
<!-- Game Board Container -->
<div class="row mt-5 d-flex align-items-center justify-content-center">
<!-- Question -->
<div class="col-12">
<div class="row">
<div class="col">
<h1 id="topic" class="text-center user-centric">Topic</h1>
<h2 id="question" class="text-center user-centric">What is the answer to this question?</h2>
</div>
</div>
</div>
<!-- ./Question -->
<!-- Answers -->
<div class="col-12">
<div id="answers" class="row text-center py-3 py-md-4 user-centric">
<!-- Use JS to add the answer buttons here -->
</div>
</div>
<!-- ./Answers -->
<!-- Attempts, question count and progress bar ROW -->
<div class="row">
<!-- Attempts -->
<div class="col-12">
<div class="row">
<div class="col">
<h3 id="attempts-wrapper" class="text-center user-centric">
<span id="attempts-header">Attempts:</span>
<span id="attempts">
<!-- Use JS to update the number of attempts with id="attemts" -->
</span>
</h3>
</div>
<div class="col">
<h3 id="questions-wrapper" class="text-center user-centric">
<span class="user-centric" id="questions-header">Questions:</span>
<span id="question-count" class="fa-solid fa-beat">
<!-- Use JS to update the number of questions with id="questionNumber" -->
</span>
</div>
</div>
</div>
<!-- ./Attempts -->
<!-- Progress Bar -->
<div class="col-12 d-flex justify-content-center">
<div class="row mt-2 w-100 d-flex justify-content-center">
<div class="progress-wrapper col-10 ps-0 ps-sm-5">
<!-- To update bar use class="progress-bar". Update the aria-valuenow and style="width: "-->
<div class="progress user-centric" style="height: 35px;">
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar"
style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
</div>
<span id="sleigh">
<i class="fa-solid fa-sleigh fa-2xl"></i>
</span>
</div>
</div>
<div id="gifts" class="d-none d-sm-block col-2 user-centric">
<i class="fa-solid fa-gifts fa-2xl"></i>
</div>
</div>
</div>
<!-- ./Progress Bar -->
</div>
<!-- ./Attempts, question count and progress bar ROW -->
</div>
<!-- ./Game Board Container -->
</div>
<!-- Audio -->
<audio id="background-music" loop>
<source src="assets/media/indie-pop-jingle-bells-179299.mp3" type="audio/mp3">
Your browser does not support the audio tag.
</audio>
<!-- Win Game Modal -->
<div class="modal fade" id="winGameModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1"
aria-labelledby="winGameModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="winGameModalLabel">
<!-- Populate with JS -->
</h1>
</div>
<div id="win-trophy" class="modal-body">
<i class="fa-solid fa-trophy fa-bounce fa-2xl" style="color: #fbe709;"></i>
<!-- https://stackoverflow.com/questions/18622508/bootstrap-3-and-youtube-in-modal -->
</div>
<div class="modal-footer w-100">
<h6>Would you like to help Santa deliver some presents again?</h6>
<div id="btn-txt" class="text-end">
<!-- call seelectDifficultyModalToggle -->
<button type="button" class="btn btn-primary"
style="color: rgb(211, 3, 3); background-color: rgb(6, 214, 6); font-weight: bold;"
data-bs-target="#selectDifficultyModalToggle" data-bs-toggle="modal">Yes</button>
<!-- redirect to home page by click -->
<button type="button" class="btn btn-secondary"
style="background-color: #f83c3c; color: white; font-weight: bold;"
onclick="window.location.href='index.html'">No</button>
</div>
</div>
</div>
</div>
</div>
<!-- ./Win Game Modal -->
<!-- Game Over Modal -->
<div class="modal fade" id="gameOverModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1"
aria-labelledby="gameOverModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="gameOverModalLabel">
<!-- Populate with JS -->
</h1>
</div>
<div id="sad-smiley" class="modal-body">
<i class="fa-solid fa-face-sad-tear fa-flip-horizontal fa-2xl" style="color: #f5db2e;"></i>
<!-- https://stackoverflow.com/questions/18622508/bootstrap-3-and-youtube-in-modal -->
</div>
<div class="modal-footer w-100">
<h6>Would you like to help Santa deliver some presents again?</h6>
<div id="btn-txt" class="text-end">
<!-- call seelectDifficultyModalToggle -->
<button type="button" class="btn btn-primary"
style="color: white; background-color: #07947b; font-weight: bold;"
data-bs-target="#selectDifficultyModalToggle" data-bs-toggle="modal">Yes</button>
<!-- redirect to home page by click -->
<button type="button" class="btn btn-secondary"
style="background-color: #f83c3c; color: white; font-weight: bold;"
onclick="window.location.href='index.html'">No</button>
</div>
</div>
</div>
</div>
</div>
<!-- ./Win Game Modal -->
<!-- Modals wrapper -->
<div id="modals-container">
<!-- Use JS to populate the modals here -->
</div>
<!--
Snowflakes
Functionality in assets/js/script.js
Credits:
https://github.com/hcodes/snowflakes/
-->
<div id="snowflakes-container"></div>
<script src="https://unpkg.com/magic-snowflakes/dist/snowflakes.min.js"></script>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js"
integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r" crossorigin="anonymous">
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js"
integrity="sha384-BBtl+eGJRgqQAUMxJ7pMwbEyER4l1g+O15P+16Ep7Q9Q+zqX6gSbd85u4mG4QzX+" crossorigin="anonymous">
</script>
<!-- Custom JS -->
<script type="module" src="assets/js/script.js"></script>
<script type="module" src="assets/js/db.js"></script>
<script type="module" src="assets/js/game-storage.js"></script>
<script type="module" src="assets/js/game-display.js"></script>
<script type="module" src="assets/js/game.js"></script>
<script type="module" src="assets/js/modals.js"></script>
<script type="module" src="assets/js/gameSnowflakes.js"></script>
</body>
</html>