forked from DesislavaNaydenova/2405-hackathon-team1-StarWars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
quiz.html
241 lines (226 loc) · 14.1 KB
/
quiz.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
<!DOCTYPE html>
<html lang="en-gb">
<head>
<!--Meta Tags -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
content="The ultimate fan page dedicated to Darth Vader, the iconic Sith Lord from Star Wars. Explore his history, quiz, and more.">
<meta name="keywords"
content="Darth Vader, Star Wars, Sith Lord, Anakin Skywalker, Vader quotes, Vader quiz, Star Wars characters">
<link rel="canonical" href="https://desislavanaydenova.github.io/2405-hackathon-team1-StarWars/">
<meta name="robots" content="index, follow">
<!-- Social Integration: Facebook, LinkedIn, Google -->
<meta property="og:type" content="website">
<meta property="og:title" content="The Darth Side - The Darth Quiz">
<meta property="og:description" content="The ultimate fan page dedicated to Darth Vader, the iconic Sith Lord from Star Wars. Explore his history, quiz, and more.">
<meta name="image" property="og:image" content="URL TO IMAGE">
<meta property="og:image:alt" content="The Darth Side Website shown on a variety of devices">
<meta property="og:url" content="#">
<meta property="og:site_name" content="The Darth Side">
<meta name="author" content="Team ChewHakkas">
<!-- Favicon -->
<link type="image/png" sizes="16x16" rel="icon" href="assets/favicon/icons8-darth-vader-ios-17-filled-16.png">
<link type="image/png" sizes="32x32" rel="icon" href="assets/favicon/icons8-darth-vader-ios-17-filled-32.png">
<link type="image/png" sizes="96x96" rel="icon" href="assets/favicon/icons8-darth-vader-ios-17-filled-96.png">
<link type="image/png" sizes="120x120" rel="icon" href="assets/favicon/icons8-darth-vader-ios-17-filled-120.png">
<link rel="icon" type="image/png" sizes="72x72" href="assets/favicon/icons8-darth-vader-ios-17-filled-72.png">
<link rel="icon" type="image/png" sizes="96x96" href="assets/favicon/icons8-darth-vader-ios-17-filled-96.png">
<link rel="icon" type="image/png" sizes="144x144" href="assets/favicon/icons8-darth-vader-ios-17-filled-144.png">
<link rel="icon" type="image/png" sizes="192x192" href="assets/favicon/icons8-darth-vader-ios-17-filled-192.png">
<link rel="icon" type="image/png" sizes="512x512" href="assets/favicon/icons8-darth-vader-ios-17-filled-512.png">
<link rel="apple-touch-icon" type="image/png" sizes="57x57"
href="assets/favicon/icons8-darth-vader-ios-17-filled-57.png">
<link rel="apple-touch-icon" type="image/png" sizes="60x60"
href="assets/favicon/icons8-darth-vader-ios-17-filled-60.png">
<link rel="apple-touch-icon" type="image/png" sizes="72x72" href="assets/favicon/icons8-darth-vader-72.png">
<link rel="apple-touch-icon" type="image/png" sizes="76x76" href="assets/favicon/icons8-darth-vader-76.png">
<link rel="apple-touch-icon" type="image/png" sizes="114x114" href="assets/favicon/icons8-darth-vader-114.png">
<link rel="apple-touch-icon" type="image/png" sizes="120x120" href="assets/favicon/icons8-darth-vader-120.png">
<link rel="apple-touch-icon" type="image/png" sizes="144x144" href="assets/favicon/icons8-darth-vader-144.png">
<link rel="apple-touch-icon" type="image/png" sizes="152x152" href="assets/favicon/icons8-darth-vader-152.png">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="assets/favicon/icons8-darth-vader-180.png">
<link color="#26E07F" rel="mask-icon" href="assets/favicon/icons8-darth-vader-50.svg">
<meta name="msapplication-square70x70logo" content="assets/favicon/icons8-darth-vader-70.png">
<meta name="msapplication-TileImage" content="assets/favicon/icons8-darth-vader-144.png">
<meta name="msapplication-square150x150logo" content="assets/favicon/icons8-darth-vader-150.png">
<meta name="msapplication-square310x310logo" content="assets/favicon/icons8-darth-vader-310.png">
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap" rel="stylesheet">
<!-- jQuery CDN -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<!-- Stylesheets -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css"
integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css" integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A==" crossorigin="anonymous" referrerpolicy="no-referrer">
<link rel="stylesheet" type="text/css" href="assets/css/style.css">
<title>The Darth Side - The Darth Quiz</title>
</head>
<body>
<header>
<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-dark">
<a class="navbar-brand d-none d-lg-block" href="index.html" aria-label="click to go to home-page">The Darth Side</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02"
aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo02">
<ul class="navbar-nav mr-auto mt-2 mt-lg-0">
<li class="nav-item">
<a class="nav-link" href="index.html" aria-label="click to go to home-page">Home</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="quiz.html" aria-label="click to go to quiz page">Quiz <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="wiki.html" aria-label="click to go wiki page">Wiki</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about.html" aria-label="click to go to about us page">About</a>
</li>
</ul>
</div>
</nav>
</header>
<!-- Placeholder for the heading -->
<main>
<section class="container-fluid">
<div class="row justify-content-center mt-4">
<div class="col-sm-10 col-md-8 col-lg-8 mb-4 mt-4">
<div class="gameArea bg-dark quiz-box-shadow" role="none" aria-hidden="true">
<!-- quiz and scoreboard container -->
<!-- quiz container -->
<div id="quiz-container" class="hero-image container-fluid inner-gameArea">
<!-- question container -->
<div class="questions" role="presentation" aria-label="This is the questions area for the quiz. There are ten multiple-choice questions">
<!-- Countdown timer -->
<div class='text-center quiz-text' id="countdown" role="presentation" aria-label="This is the countdown timer">
</div>
<h1 class='text-center quiz-text-title' id="welcome-text" aria-label="This is a h1">DARTH QUIZ</h1>
<h2 class="text-center quiz-text-caption main-caption" id="welcome-text-2" role="presentation" aria-labelledby="welcome-text">Give yourself to the Dark Side</h2>
<div id="question-buttons">
<!-- Quiz questions -->
<div class="text-center quiz-text question">
<div id="question">
</div>
</div>
<ol class="options-container" type="A">
<li class="option"><span id="option0" onclick="calcScore(this)"></span></li>
<li class="option"><span id="option1" onclick="calcScore(this)"></span></li>
<li class="option"><span id="option2" onclick="calcScore(this)"></span></li>
<li class="option"><span id="option3" onclick="calcScore(this)"></span></li>
</ol>
<!-- Question count -->
<div class='text-center quiz-text' id="questionCount" role="presentation" aria-label="This is the question counter, counting up to ten">
</div>
</div>
</div>
<!-- Quiz Control Buttons -->
<div class="buttons text-center">
<button type="button" id="gameStart" class="gameStart btn btn-danger quiz-text game-buttons" aria-labelledby="gameStart" aria-label="Start the timer">Start</button>
<button type="button" class="btn btn-danger quiz-text game-buttons" id="Refresh" value="Refresh" onClick="refresh(this)" aria-label="Reset quiz">Restart</button>
<!-- Trigger the modal with a button -->
<button type="button" id="show-modal-btn" class="btn btn-danger quiz-text game-buttons" data-toggle="modal" data-target="#htpModal" aria-labelledby="show-modal-btn" aria-label="Click for instructions">How to play</button>
<!-- Modal -->
<div class="modal fade" id="htpModal" tabindex="-1" aria-labelledby="htpModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title" id="htpModalLabel">Join me and play</h2>
<button class="game-buttons close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body quiz-text">
<p>How well do you know the Dark Lord?<br> Test your knowledge and get ten questions correct before the timer runs out.<br> You have 60 seconds. It is your destiny!</p>
<h3>Controls:</h3>
<p>'START' to start the quiz.</p>
<p>'RESTART' to reset the quiz.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger quiz-text game-buttons" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- scoreboard section -->
<div id="scoreboard">
<h2 class="quiz-text-caption text-center" role="presentation" id="score-message">You did well my young apprentice</h2>
<div class="score-points">
<h2 class="quiz-text text-center" id="score-title">Your Score</h2>
<!-- Score Points Placeholder -->
<div class="quiz-text text-center" id="score" role="presentation" aria-label="Your final score for the quiz">
</div>
</div>
<div class="buttons text-center">
<button class="quiz-text btn btn-danger" type="button" id="score-btn-one" value="Refresh" onClick="refresh(this)" aria-label="Click or tap to go back to the quiz">Restart</button>
<button class="quiz-text btn btn-danger game-buttons" type="button" id="check-answer" onclick="checkAnswer()" aria-label="Click or tap to check your answers">Check Answers</button>
</div>
</div>
<!-- Answers section -->
<div id="answerBank" role="presentation" aria-label="Your answers">
<h2 class="quiz-text-caption text-center">Your Answers</h2>
<ol class="text-left" type="1" id="answers">
</ol>
<div class="buttons text-center">
<button class="btn btn-danger quiz-text game-buttons" type="button" id="score-btn-two" value="Refresh" onClick="refresh(this)" aria-label="Click or tap to go back to the quiz">Return to Quiz</button>
</div>
</div>
</div>
</div>
</div>
<!-- Times Up Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog" id="timeupmodal">
<!-- Times Up Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Time is up!</h4>
<button type="button" value="Refresh" onClick="refresh(this)" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<p class="text-center quiz-text">You have not failed me yet my young apprentice.</p>
</div>
<div class="modal-footer">
<button type="button" value="Refresh" onClick="refresh(this)" class="btn btn-danger quiz-text" data-dismiss="modal">Try Again</button>
</div>
</div>
</div>
</div>
</section>
</main>
<!-- FOOTER -->
<footer class="container-fluid footer-container fixed-bottom">
<div class="row">
<div class="col">
<a href="https://github.com/DesislavaNaydenova/2405-hackathon-team1-StarWars" target="_blank" rel="noopener" aria-label="click to open GitHub repository on a new tab">
<i class="fa-brands fa-github"><span class="sr-only">View our project on GitHub</span></i>
</a>
</div>
<div class="col">
<a href="about.html" aria-label="click to go to about us page">
<i class="fa-solid fa-people-group"><span class="sr-only">Meet the Team</span></i>
</a>
</div>
<div class="col">
<p onmouseover="PlaySound('chewieSoundEffect')" onmouseout="StopSound('chewieSoundEffect')">© Team ChewHakkas</p>
<audio id="chewieSoundEffect">
<source src="assets/audio/chewbacca.mp3">
</audio>
</div>
</div>
</footer>
<!-- Scripts -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct"
crossorigin="anonymous"></script>
<script src="assets/js/quiz.js"></script>
<script src="assets/js/script.js"></script>
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> -->
</body>
</html>