-
Notifications
You must be signed in to change notification settings - Fork 2
/
game-1.html
209 lines (187 loc) · 7.79 KB
/
game-1.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
<!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>Eclipse Quiz</title>
<!-- Include Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
body {
background-color: #fff;
color: #000;
}
.video-container {
position: relative;
padding-bottom: 56.25%; /* 16:9 aspect ratio */
padding-top: 25px;
height: 0;
}
.video-container iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
/* Add styles for questions and answers */
.question-container {
background-color: #FFA500;
color: #000;
padding: 20px;
border-radius: 10px;
margin-top: 20px;
}
/* Add styles for options */
.options {
display: flex;
gap: 10px;
margin-top: 10px;
}
.option {
cursor: pointer;
padding: 5px 10px;
border-radius: 5px;
background-color: #007bff;
color: #fff;
}
.option:hover {
background-color: #333;
}
/* Add styles for correct and incorrect feedback */
.correct {
background-color: #4CAF50;
}
.incorrect {
background-color: #F44336;
}
/* Add styles for points */
.points {
margin-top: 10px;
}
/* Adjust dropdown style with Bootstrap */
.custom-select {
width: 100%;
max-width: 100%;
}
/* Additional styling for answers */
.answer-container {
margin-top: 20px;
}
/* Add styles for Next Question button */
.next-question {
display: none;
margin-top: 20px;
background-color: #FFA500;
color: #000;
border: none;
border-radius: 5px;
padding: 10px 20px;
cursor: pointer;
}
</style>
</head>
<body>
<div class="container mt-5">
<!-- Video Player -->
<div class="video-container">
<!-- Replace 'VIDEO_ID' with your video URL -->
<iframe src="distance - Made with Clipchamp.mp4" frameborder="0" allowfullscreen></iframe>
</div>
<!-- Quiz Options -->
<div class="row mt-5">
<div class="col-lg-8">
<div class="options">
<div class="option" id="lunarOption">Lunar Eclipse</div>
<div class="option" id="solarOption">Solar Eclipse</div>
</div>
<!-- Feedback -->
<div class="points" id="points"></div>
<!-- Next Question Button -->
<button class="next-question" id="nextQuestion">Next Question</button>
</div>
<div class="col-lg-4">
<!-- Questions and Answers -->
<div class="question-container">
<h3>Select a Question:</h3>
<select class="form-select" id="questionDropdown">
<option value="" disabled selected>Select a question</option>
<option value="q1">How do eclipses occur?</option>
<option value="q2">Why do only some people on Earth see an eclipse at a given time?</option>
<option value="q3">What causes the Sun, Moon, and Earth to align?</option>
<option value="q4">How often do eclipses occur?</option>
<option value="q5">How do scientists know when and where eclipses will occur?</option>
<option value="q6">What is the difference between a lunar and solar eclipse?</option>
<option value="q7">What is an eclipse season and why do they occur approximately every six months?</option>
</select>
<!-- Question and Answer Display -->
<div class="mt-4">
<h3>Question:</h3>
<p id="questionText"></p>
<h3>Answer:</h3>
<p id="answerText"></p>
</div>
</div>
</div>
</div>
</div>
<!-- Include Bootstrap JS and jQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script>
<script>
// Define an object with answers to the questions
const answers = {
q1: "Eclipses occur when the Earth, Moon, and Sun align in a way that one celestial body casts a shadow on another.",
q2: "Only some people on Earth see an eclipse at a given time because eclipses have a specific path and are only visible from certain locations.",
q3: "The Sun, Moon, and Earth align due to the gravitational forces between them, causing the Moon to cast a shadow on the Earth during a solar eclipse.",
q4: "Eclipses occur several times a year, but not all of them are total eclipses. Total solar eclipses are rarer and happen less frequently.",
q5: "Scientists use astronomical calculations and models to predict when and where eclipses will occur. These predictions are highly accurate.",
q6: "A lunar eclipse occurs when the Earth comes between the Sun and the Moon, casting a shadow on the Moon. A solar eclipse happens when the Moon comes between the Sun and the Earth, casting a shadow on the Earth.",
q7: "Eclipse seasons occur when the Moon's orbit is aligned with the plane of the Earth's orbit around the Sun. This alignment causes eclipses to happen more frequently."
};
// Event listener for the question dropdown
$('#questionDropdown').change(function () {
const selectedQuestion = $(this).val();
const questionText = $('#' + selectedQuestion).text();
const answerText = answers[selectedQuestion];
$('#questionText').text(questionText);
$('#answerText').text(answerText);
});
// Quiz Logic
let points = 0;
$('#lunarOption').click(function () {
if ($('#questionDropdown').val() === 'q6') {
points++;
$('#points').html(`<p class="correct">Correct! Points: ${points}</p>`);
} else {
points--;
$('#points').html(`<p class="incorrect">Incorrect. Points: ${points}</p>`);
}
// Show the Next Question button
$('#nextQuestion').show();
});
$('#solarOption').click(function () {
if ($('#questionDropdown').val() === 'q6') {
points--;
$('#points').html(`<p class="incorrect">Incorrect. Points: ${points}</p>`);
} else {
points++;
$('#points').html(`<p class="correct">Correct! Points: ${points}</p>`);
}
// Show the Next Question button
$('#nextQuestion').show();
});
// Event listener for the Next Question button
$('#nextQuestion').click(function () {
// Clear question and answer text
$('#questionText').text('');
$('#answerText').text('');
// Reset dropdown
$('#questionDropdown').val('').change();
// Hide Next Question button
$(this).hide();
});
</script>
</body>
</html>