generated from Code-Institute-Org/gitpod-full-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
game.html
293 lines (279 loc) · 17.4 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
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 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">
<title>Derby Duel</title>
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<!-- 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">
<!-- Main Stylesheet -->
<link href="assets/css/styles.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://kit.fontawesome.com/2d6908b6f2.js" crossorigin="anonymous"></script>
</head>
<body>
<!-- MODAL 1 -->
<!-- Displays rules and starts game play -->
<div class="modal" tabindex="-1" id="myModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">How to Play</h5>
</div>
<div class="modal-body">
<ul>
<li>Answer correctly, goal scored! = <strong>1 point</strong></li>
<li>Win a match = <strong>3 points</strong></li>
<li>Draw a match = <strong>1 point</strong></li>
</ul>
<br>
<ul>
<li>Results after 3 matches:
<ul>
<li><strong>3 points or less</strong> - relegated!</li>
<li><strong>4 - 9 points</strong> - Premiership champions!</li>
<li><strong>10 - 18 points</strong> - Europa League winners!</li>
<li><strong>19 + points</strong> - Champions League winners!</li>
</ul>
</li>
</ul>
<p>Are you ready to play?</p>
</div>
<div class="modal-footer">
<!-- Button links to second modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#myModal2">Pick
My Team</button>
</div>
</div>
</div>
</div>
<!-- MODAL 2 -->
<!-- Displays team logos for user to pick team questions to answer -->
<div class="modal" tabindex="-1" id="myModal2">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Pick Your Team</h5>
</div>
<div class="modal-body">
<div class="row">
<!-- Arsenal Logo -->
<div class="col-6 team-selector" id="modal-arsenal-logo">
<span class="d-inline-block" tabindex="0" data-bs-toggle="tooltip"
data-bs-title="Disabled tooltip">
<button type="button" class="btn start-quiz" data-bs-dismiss="modal">
<img class="img-fluid" src="assets/images/arsenal-logo.webp"
alt="Arsenal football team logo" id="modal-arsenal-image">
</button>
</span>
</div>
<!-- Spurs Logo -->
<div class="col-6 team-selector" id="modal-spurs-logo">
<span class="d-inline-block" tabindex="0" data-bs-toggle="tooltip"
data-bs-title="Disabled tooltip">
<button type="button" class="btn start-quiz" data-bs-dismiss="modal">
<img class="img-fluid" src="assets/images/spurs-logo.webp"
alt="Tottenham Hotspurs team logo" id="modal-spurs-image">
</button>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- MATCH TOASTS -->
<!-- Displays match results after every 4 questions -->
<div class="toast-container position-fixed top-50 start-50 translate-middle p-3">
<div id="match-toast" class="toast vh-100 vw-100" data-bs-autohide="false" data-bs-delay="2" role="alert" aria-live="assertive"
aria-atomic="true">
<div class="toast-header">
<strong class="me-auto center-text">Match <span id="toast-header-match">2</span></strong>
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
<div class="toast-body vertical-center center-text">
<span id="match-quote">Take a bow, son!</span>
<p class="fs-3 txt-color-3">You <span id="toast-body-result">won/lost</span> match <span id="toast-body-match">2</span></p>
<button type="button" class="btn btn-primary txt-color-2 mt-5" id="toast-button" data-bs-dismiss="toast" aria-label="Close">Next Match</button>
</div>
</div>
</div>
<!-- GAME DISPLAY -->
<div id="game-display">
<!-- HEADER -->
<header>
<div class="container-fluid">
<div class="row text-center">
<div class="col-12 col-md-6">
<div class="row">
<div class="col-2 border-end border-danger border-1">
<img class="img-fluid header-logo pt-1 pb-1 pe-2" src="assets/images/arsenal-header-logo.webp"
alt="Arsenal football team logo" id="arsenal-logo">
</div>
<!-- Displays users results in Premiership styling -->
<div class="col-8">
<div class="row h-50">
<!-- Single letters displayed for small medium and large devices -->
<div class="col-2 border-end border-danger border-1 game-header">P<span class="d-none d-xxl-inline-block">layed</span></div>
<div class="col-2 border-end border-danger border-1 game-header">W<span class="d-none d-xxl-inline-block">on</span></div>
<div class="col-2 border-end border-danger border-1 game-header">D<span class="d-none d-xxl-inline-block">rawn</span></div>
<div class="col-2 border-end border-danger border-1 game-header">L<span class="d-none d-xxl-inline-block">ost</span></div>
<div class="col-2 border-end border-danger border-1 game-header">G<span class="d-none d-xxl-inline-block">oals</span></div>
<div class="col-2 border-end border-danger border-1 game-header">P<span class="d-none d-xxl-inline-block">oints</span></div>
</div>
<div class="row h-50">
<div class="col-2 border-end border-danger border-1 game-header" id="played">0</div>
<div class="col-2 border-end border-danger border-1 game-header" id="won">0</div>
<div class="col-2 border-end border-danger border-1 game-header" id="drawn">0</div>
<div class="col-2 border-end border-danger border-1 game-header" id="lost">0</div>
<div class="col-2 border-end border-danger border-1 game-header" id="score">0</div>
<div class="col-2 border-end border-danger border-1 game-header" id="points">0</div>
</div>
</div>
<div class="col-2">
<img class="img-fluid header-logo pt-1 pb-1" src="assets/images/spurs-header-logo.webp"
alt="Tottenham Hotspurs team logo" id="spurs-logo">
</div>
</div>
</div>
<!-- Indicates progress and correct answers in each match -->
<div class="col-12 col-md-6">
<div class="row border-start border-danger border-1 h-100 match-header">
<div class="col-12 col-md-9">
<div class="row border-top border-bottom border-danger border-1 h-50">
<div class="col-4 border-end border-danger border-3 game-header">Match 1</div>
<div class="col-4 border-end border-danger border-3 game-header">Match 2</div>
<div class="col-4 game-header"> Match 3</div>
</div>
<!-- Match 1 indicators -->
<div class="row h-50">
<div class="col-4 border-end border-danger border-3">
<div class="row h-100" id="match-one">
<div class="col-3 question-indicator" data-game="0">
<i class="fa-solid fa-futbol vertical-center center-text"></i>
</div>
<div class="col-3 border-start border-danger border-1 question-indicator"
data-game="1">
<i class="fa-solid fa-futbol vertical-center center-text"></i>
</div>
<div class="col-3 border-start border-danger border-1 question-indicator"
data-game="2">
<i class="fa-solid fa-futbol vertical-center center-text"></i>
</div>
<div class="col-3 border-start border-danger border-1 question-indicator"
data-game="3">
<i class="fa-solid fa-futbol vertical-center center-text"></i>
</div>
</div>
</div>
<!-- Match 2 indicators -->
<div class="col-4 border-end border-danger border-3">
<div class="row h-100">
<div class="col-3 question-indicator" data-game="4">
<i class="fa-solid fa-futbol vertical-center center-text"></i>
</div>
<div class="col-3 border-start border-danger border-1 question-indicator"
data-game="5">
<i class="fa-solid fa-futbol vertical-center center-text"></i>
</div>
<div class="col-3 border-start border-danger border-1 question-indicator"
data-game="6">
<i class="fa-solid fa-futbol vertical-center center-text"></i>
</div>
<div class="col-3 border-start border-danger border-1 question-indicator"
data-game="7">
<i class="fa-solid fa-futbol vertical-center center-text"></i>
</div>
</div>
</div>
<!-- Match 3 indicators -->
<div class="col-4">
<div class="row h-100">
<div class="col-3 question-indicator" data-game="8">
<i class="fa-solid fa-futbol vertical-center center-text"></i>
</div>
<div class="col-3 border-start border-danger border-1 question-indicator"
data-game="9">
<i class="fa-solid fa-futbol vertical-center center-text"></i>
</div>
<div class="col-3 border-start border-danger border-1 question-indicator"
data-game="10">
<i class="fa-solid fa-futbol vertical-center center-text"></i>
</div>
<div class="col-3 border-start border-danger border-1 question-indicator"
data-game="11">
<i class="fa-solid fa-futbol vertical-center center-text"></i>
</div>
</div>
</div>
</div>
</div>
<div class="d-none d-md-inline-block col-3 border-start border-danger border-3 position-relative">
<a href="index.html">
<h6 class="d-inline pe-2 game-header vertical-center center-text title">Derby Duel</h6>
</a>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- GAME SECTION -->
<!-- Displays questions and answers -->
<section class="game-section">
<div class="container-fluid quiz-section">
<div class="row game-area">
<!-- Questions displayed on the left for medium and larger devices -->
<!-- Questions displayed on top for small devices -->
<div class="col-12 col-md-6 border border-bottom-danger border-1 position-relative p-0 bg-color-2 txt-color-2">
<div class="col-12">
<h2 class="text-end me-5 question-number">Q<span id="question-counter">0</span></h2>
<p class="vertical-center m-5" id="question-paragraph"></p>
</div>
</div>
<!-- Answers displayed on the right for medium and larger devices -->
<!-- Answers displayed on bottom for small devices -->
<div class="col-12 col-md-6 p-0 border border-1 text-center bg-color-1 txt-color-2">
<div class="col-12 bg-color-2 txt-color-2 ps-2 h-13 answer-section border-bottom border-1 position-relative">
<h3 class="select-answer vertical-center center-text">SELECT YOUR ANSWER</h3>
</div>
<div class="col-12 border-bottom border-1 ps-2 h-29 choice-text hover-color position-relative" data-number="1">
</div>
<div class="col-12 border-bottom border-1 ps-2 h-29 choice-text hover-color position-relative" data-number="2">
</div>
<div class="col-12 ps-2 h-29 choice-text hover-color position-relative" data-number="3">
</div>
</div>
</div>
</div>
</section>
<!-- FOOTER SECTION -->
<footer>
<div class="container-fluid">
<div class="row pt-5 pb-5 txt-color-1">
<div class="col-12 col-md-6 mb-2">
<p>© Abby Humphreys 2023</p>
</div>
<div class="col-12 col-md-6 text-md-end">
<p>Site created for educational purposes only</p>
</div>
</div>
</div>
</footer>
</div>
<!-- Bootstrap Script Tag -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" crossorigin="anonymous">
</script>
<!-- game.js Script Tag -->
<script defer src="./assets/js/game.js"></script>
<!-- modal.js Script Tag -->
<script defer src="./assets/js/modal.js"></script>
</body>
</html>