-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
297 lines (253 loc) · 13.3 KB
/
index.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
294
295
296
297
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Population map</title>
<link rel="icon" href="images/faviconLogo.png" type="image/png" />
<!-- Import JQuery -->
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<!-- Import FullPage.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/3.0.4/fullpage.js"></script>
<!-- Import D3 -->
<script src="https://d3js.org/d3.v3.min.js"></script>
<!-- style.css -->
<link rel="stylesheet" type="text/css" media="screen" href="style.css">
<!-- Addons JS -->
<script src="js/materializeAddons.js"></script>
<!-- worldClock JS -->
<script src="js/worldClock.js"></script>
<!-- Handelbars js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.11/handlebars.js"></script>
<!-- Import Leaflet CSS -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.4.0/dist/leaflet.css"
integrity="sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA=="
crossorigin=""/>
<!-- Make sure you put this AFTER Leaflet's CSS -->
<script src="https://unpkg.com/leaflet@1.4.0/dist/leaflet.js"
integrity="sha512-QVftwZFqvtRNi0ZyCtsznlKSWOStnDORoefr1enyq5mVL4tmKB3S/EnC3rRJcxCPavG10IcrVGSmPh6Qw5lwrg=="
crossorigin=""></script>
<!-- Leaflet mobile -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<!-- Select2.js -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script>
<!-- Materialize -->
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
</head>
<body>
<!-- White square -->
<div id="whiteSquare">
<div class="preloader-wrapper big active" id="preloader">
<div class="spinner-layer spinner-green-only">
<div class="circle-clipper left">
<div class="circle"></div>
</div>
<div class="gap-patch">
<div class="circle"></div>
</div>
<div class="circle-clipper center">
<div class="circle"></div>
</div>
</div>
</div>
</div>
<div id="fullpage">
<!-- Header -->
<div class="section fp-auto-height-responsive gifBg" id="firstSection">
<!-- Navbar -->
<div class="center-align">
<img id="logo" src="images/Logo.png" alt="Logo">
</div>
<div class="valign-wrapper">
<div class="container" id="header">
<h2 class="white-text shadowText">Current world population: <div class="shadowText" id="worldClock"></div>
</h2>
<!-- Modal -->
<div id="modal" class="modal">
<div class="modal-content">
<p>
<h4> Welcome, </h4>
this site aims to make demography – the study of human populations – accessible
to a wider audience. Demographic data can play an important role in understanding the social and
economic developments of our time.
</p><br>
<div class="divider"></div>
<p>
<h4> Credits </h4>
This site is brougth to you by Alessandro Carboni, an Interacion Design student at Quasar Istitute
of Advanced Design, Rome. <br>
It's a project for <b>Web Technologies 2</b> exam. <br>
</p>
<p>
Thanks to:
<ul>
<li> <a href="http://api.population.io/"> Population.io </a> for the data of the current population </li>
<li> <a href="https://data.worldbank.org/"> World Bank Open Data </a> for countries and populations data </li>
<li> <a href="https://github.com/johan/world.geo.json"> Johan Sundström </a> for the data of countries borders for the map </li>
</ul>
</p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-close waves-effect waves-green btn-flat">Close</a>
</div>
</div>
<div class="centerAlign">
<a href="#modal" class="center waves-effect waves-light btn-large green modal-trigger">Description</a>
</div>
<div id="alignBottom">
<div class="white-text shadowText scrollDown">
<h5> Scroll down to the map </h5>
</div>
<div class="scrollDown">
<img src="images/scrollDown.gif" id="sdGif">
</div>
</div>
</div>
</div>
</div>
<!-- Map -->
<div class="section fp-auto-height-responsive">
<!-- Leaflet Map -->
<div id="mapid"></div>
<!-- Import map -->
<script src="js/leaflet.js"></script>
<!-- Help action -->
<div>
<div id="mapModal" class="modal">
<div class="modal-content">
<p>
<h4> How to use </h4>
<p> Just click on any of the countries on the map and a popup will appear, showing the <b>country</b> name and it's <b>population</b>. </p>
<div class="divider"></div>
<h4> Results </h4>
<p>
Normally the population will appear, but some times it whil appear <b>Undefined</b> because the JSON doesn't have that country data.
The color of the countries determines how big is the population. <br>
<div class="legend">
<div class="squareColor" id="fiftyMil"></div> <div class="legendText"> > 50 milion people </div>
</div>
<div class="legend">
<div class="squareColor" id="twoFiveMil"></div> <div class="legendText"> > 25 milion people </div>
</div>
<div class="legend">
<div class="squareColor" id="tenMil"></div> <div class="legendText"> > 10 milion people </div>
</div>
<div class="legend">
<div class="squareColor" id="fiveMil"></div> <div class="legendText"> > 5 milion people </div>
</div>
<div class="legend">
<div class="squareColor" id="oneMil"></div> <div class="legendText"> < 1 milion people </div>
</div>
<div class="legend">
<div class="squareColor" id="noMil"></div> <div class="legendText"> Undefined </div>
</div class="legend">
</p>
</p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-close waves-effect waves-green btn-flat">Close</a>
</div>
</div>
<a href="#mapModal" class="btn-floating btn-large waves-effect waves-light green left modal-trigger tooltipped" data-position="left" data-tooltip="Need help?" id="helpMap"><i class="large material-icons">help_outline</i></a>
</div>
</div>
<!-- Country code selection -->
<div class="section fp-auto-height-responsive">
<div class="container">
<!-- <form autocomplete="off">
<div class="autocomplete" style="width:300px;">
<input id="myInput" type="text" name="myCountry" placeholder="Country">
<p class="demo"></p>
</div>
<button onclick="search()">Search</button>
</form>
<script>
autocomplete(document.getElementById("myInput"), countries);
</script> -->
<h3 class="center">Country codes</h3>
<h5 class="center">
Select any country from the dropdown list and discover it's country code!
</h5>
<h6 class="center" id="title3">
Country codes are short alphabetic or numeric geographical codes developed to represent countries, for use in data processing and communications.
</h6>
<!-- Countries dropdown list -->
<div class="input-field">
<select id="countriesList" class="browser-default" onchange="myFunction();"></select>
</div>
<h2 id="result" class="center-align"></h2>
<!-- Handelbars -->
<script id="countriesTemplate" type="text/x-handlebars-template">s
<option value="{{ id }}" id="countryList">{{ country }}</option>
</script>
<!-- Get selected value -->
<script>
function myFunction() {
// Get current value
var selectedValue = document.getElementById('countriesList').value;
// Write new value in HTML
if ( selectedValue ) {
$("#result").text( 'The country code is: ' + selectedValue );
}
}
myFunction();
</script>
<!-- <div class="row">
<form class="col s12">
<div class="row">
<div class="input-field">
<input id="Country" type="text" class="validate">
<label for="Country">Country</label>
</div>
</div>
</form>
</div> -->
</div>
<footer class="page-footer green lighten-1">
<div class="container">
<div class="row">
<div class="col l6 s12">
<h5 class="white-text">Thank you for visiting</h5>
</div>
<div class="col l4 offset-l2 s12">
<h5 class="white-text">Links</h5>
<ul>
<li><a class="grey-text text-lighten-3" href="https://twitter.com/acarboni95">Twitter</a></li>
<li><a class="grey-text text-lighten-3" href="https://www.instagram.com/alessandrocarbonidesign/">Instagram</a></li>
<li><a class="grey-text text-lighten-3" href="https://www.pinterest.it/alexcarboni12/">Pinterest</a></li>
</ul>
</div>
</div>
<p class="grey-text text-lighten-4 center" id="bottomLove">Made with ❤ by <a href="https://alecarboni.myportfolio.com/">Alessandro Carboni</a> </p>
</div>
<!-- <div class="footer-copyright">
<div class="container">
© 2019 Alessandro Carboni
<a class="grey-text text-lighten-4 right" href="#!">More Links</a>
</div>
</div> -->
</footer>
</div>
</div>
<script>
// fullpage.js
$(document).ready(function () {
$('#fullpage').fullpage({
//options here
autoScrolling: true,
scrollHorizontally: true
});
//methods
$.fn.fullpage.setAllowScrolling(false);
});
new fullpage('#fullpage', {
anchors: ['firstPage', 'secondPage', 'thirdPage']
});
</script>
</body>
</html>