/
celebration quiz.html
225 lines (200 loc) · 8.7 KB
/
celebration 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
<!DOCTYPE html>
<html>
<head>
<title>Canvas</title>
<meta charset = "utf-8">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="css/mystyles.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$(document).ready(function(){
$( ".flag" ).draggable();
function showBorder(jqEl, className) {
if(jqEl.hasClass(className)){
$(jqEl).css("border", "3px solid green");
} else {
$(jqEl).css("border", "3px solid red");
}
}
//China
$( "#china-drop" ).droppable({
accept: ".flag",
drop: function( event, ui ) {
showBorder($(event.toElement), 'china');
}
});
//USA
$( "#usa-drop" ).droppable({
accept: ".flag",
drop: function( event, ui ) {
showBorder($(event.toElement), 'usa');
}
});
//India
$( "#india-drop" ).droppable({
accept: ".flag",
drop: function( event, ui ) {
showBorder($(event.toElement), 'india');
}
});
//Venice
$( "#venice-drop" ).droppable({
accept: ".flag",
drop: function( event, ui ) {
showBorder($(event.toElement), 'italy');
}
});
//Brazil
$( "#rio-drop" ).droppable({
accept: ".flag",
drop: function( event, ui ) {
showBorder($(event.toElement), 'brazil');
}
});
//India
$( "#rus-drop" ).droppable({
accept: ".flag",
drop: function( event, ui ) {
showBorder($(event.toElement), 'russia');
}
});
})
</script>
</head>
<body>
<header>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Geographical Quizes</a>
</div>
<ul class="nav navbar-nav">
<li><a href="#">Home</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Capital quizes
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Capitals of Latin America</a></li>
<li><a href="#">Capitals of Asia</a></li>
<li><a href="#">Capitals of Europe</a></li>
<li><a href="#">Capitals of Africa</a></li>
</ul>
</li>
<li>
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Envelope quizes
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="dinamic.html">Envelopes from BRICS countries</a></li>
<li><a href="eu_quiz.html">Envelopes from EU countries</a></li>
<li><a href="cis.html">Envelopes from CIS countries</a></li>
</ul>
</li>
<li class = "active">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Culture quizes
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="food_quiz.html">Ethnic food quiz</a></li>
<li><a href="celebration%20quiz.html">Celebrations quiz</a></li>
<li><a href="clothes_quiz.html">Traditional clothes quiz</a></li>
</ul>
</li>
</ul>
</div>
</nav>
</header>
<h1 class = 'h1'>Celebrations quiz</h1>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Home</a></li>
<li class="breadcrumb-item"><a href="#">Culture quizes</a></li>
<li class="breadcrumb-item active">Celebrations quiz</li>
</ol>
<div class = "container">
<div class = "row">
<div class = 'col-sm-5 col-xs-12'>
<img src = "img/celebrations/chinese.new.year.jpg" alt = "Lunar new year" width = '400' height = '400'>
<h4 class = 'h4'>In what country does this celebration occur?</h4>
<h5 class = 'h5'>Fill the rectangle by the right flag</h5>
<canvas class = "quizCanvas" id = "china-drop"></canvas>
</div>
<div class = 'col-sm-offset-2 col-sm-5 col-xs-12'>
<img src ="img/celebrations/halloween.jpg" alt = "Halloween" width = '400' height = '400'>
<h4 class = 'h4'>In what country does this celebration occur?</h4>
<h5 class = 'h5'>Fill the rectangle by the right flag</h5>
<canvas class = "quizCanvas" id = "usa-drop"></canvas>
</div>
<div class = 'col-sm-5 col-xs-12'>
<img src ="img/celebrations/venice.jpg" alt = "Venice carnival" width = '400' height = '400'>
<h4 class = 'h4'>In what country does this celebration occur?</h4>
<h5 class = 'h5'>Fill the rectangle by the right flag</h5>
<canvas class = "quizCanvas" id = "venice-drop"></canvas>
</div>
<div class = 'col-sm-offset-2 col-sm-5 col-xs-12'>
<img src ="img/celebrations/holi.jpg" alt = 'Happy holi' width = '400' height = '400'>
<h4 class = 'h4'>In what country does this celebration occur?</h4>
<h5 class = 'h5'>Fill the rectangle by the right flag</h5>
<canvas class = "quizCanvas" id = "india-drop"></canvas>
</div>
<div class = 'col-sm-5 col-xs-12'>
<img src ="img/celebrations/rio-de-janeiro.jpg" alt = "Rio carnival" width = '400' height = '400'>
<h4 class = 'h4'>In what country does this celebration occur?</h4>
<h5 class = 'h5'>Fill the rectangle by the right flag</h5>
<canvas class = "quizCanvas" id = "rio-drop"></canvas>
</div>
<div class = 'col-sm-offset-2 col-sm-5 col-xs-12'>
<img src ="img/celebrations/whiterussiannights.jpeg" alt = 'Russia' width = '400' height = '400'>
<h4 class = 'h4'>In what country does this celebration occur?</h4>
<h5 class = 'h5'>Fill the rectangle by the right flag</h5>
<canvas class = "quizCanvas" id = "rus-drop"></canvas>
</div>
</div>
</div>
<hr style = "height:3;">
<img src = "img/flags/Flag_of_the_People's_Republic_of_China.svg.png" alt = "Chinese flag" width = "90" height = "80" class = "flag china">
<img src = "img/flags/united_states_of_america_texture.gif" alt = "American flag" width = "90" height = "80" class = "flag usa">
<img src = "img/flags/1280px-Flag_of_Germany.svg.png" alt = "German flag" width = "90" height = "80" class = "flag germany">
<img src = "img/flags/1280px-Flag_of_Japan.svg.png" alt = "Japanese flag" width = "90" height = "80" class = "flag japan">
<img src = "img/flags/russian-flag9.jpg" alt = "Russian flag" width = "90" height = "80" class = "flag russia">
<img src = "img/flags/Flag_of_Spain.svg.png" alt = "Spanish flag" width = "90" height = "80" class = "flag spain">
<img src ="img/flags/indian-flag.png" alt = "Indian flag" width = "90" height = "80" class = "flag india">
<img src = "img/flags/brazil_flag_MED.gif" alt = "Brazilian flag" width = "90" height = "80" class = "flag brazil">
<img src = "img/flags/italy-flag11.gif" alt = "Italian flag" width = "90" height = "80" class = "flag italy">
<img src = "img/flags/Flag_of_South_Korea.svg.png" alt = "Korean flag" width = "90" height = "80" class = "flag korea">
<img src ="img/flags/Flag_of_the_Netherlands.svg.png" alt = "Holland flag" width = "90" height = "80" class = "flag holland">
<img src ="img/flags/mongolian.gif" alt = "Mongolian flag" width = "90" height = "80" class = "flag mongolia">
<script>
//China
var c = document.getElementById("china-drop");
var ctx = c.getContext("2d");
ctx.rect(0,0,298,149);
ctx.stroke();
//USA
var c = document.getElementById("usa-drop");
var ctx = c.getContext("2d");
ctx.rect(0,0,298,149);
ctx.stroke();
//Venice
var c = document.getElementById("venice-drop");
var ctx = c.getContext("2d");
ctx.rect(0,0,298,149);
ctx.stroke();
//Holi India
var c = document.getElementById("india-drop");
var ctx = c.getContext("2d");
ctx.rect(0,0,298,149);
ctx.stroke();
//Brazil
var c = document.getElementById("rio-drop");
var ctx = c.getContext("2d");
ctx.rect(0,0,298,149);
ctx.stroke();
//Russia
var c = document.getElementById("rus-drop");
var ctx = c.getContext("2d");
ctx.rect(0,0,298,149);
ctx.stroke();
</script>
</body>
</html>