-
Notifications
You must be signed in to change notification settings - Fork 58
/
incoperates-a-footer.html
567 lines (479 loc) · 18.5 KB
/
incoperates-a-footer.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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="description" content="GeoNarrative Template" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<title>GeoNarrative Template</title>
<!-- <link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Fira+Sans:ital,wght@0,400;0,500;1,400;1,500&display=swap" /> -->
<!-- <link rel="stylesheet" href="https://api.mapbox.com/mapbox-gl-js/v2.8.1/mapbox-gl.css"> -->
<!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.1/font/bootstrap-icons.css"> -->
<link rel="stylesheet" c href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/css/bootstrap.min.css" />
<link rel="stylesheet" href="css/main.css">
<style>
.site-footer {
background-color: #26272b;
padding: 45px 0 20px;
font-size: 15px;
line-height: 24px;
color: #737373;
}
.site-footer hr {
border-top-color: #bbb;
opacity: 0.5
}
.site-footer hr.small {
margin: 20px 0
}
.site-footer h6 {
color: #fff;
font-size: 16px;
text-transform: uppercase;
margin-top: 5px;
letter-spacing: 2px
}
.site-footer a {
color: #737373;
}
.site-footer a:hover {
color: #3366cc;
text-decoration: none;
}
.footer-links {
padding-left: 0;
list-style: none
}
.footer-links li {
display: block
}
.footer-links a {
color: #737373
}
.footer-links a:active,
.footer-links a:focus,
.footer-links a:hover {
color: #3366cc;
text-decoration: none;
}
.footer-links.inline li {
display: inline-block
}
.site-footer .social-icons {
text-align: right
}
.site-footer .social-icons a {
width: 40px;
height: 40px;
line-height: 40px;
margin-left: 6px;
margin-right: 0;
border-radius: 100%;
background-color: #33353d
}
.copyright-text {
margin: 0
}
@media (max-width:991px) {
.site-footer [class^=col-] {
margin-bottom: 30px
}
}
@media (max-width:767px) {
.site-footer {
padding-bottom: 0
}
.site-footer .copyright-text,
.site-footer .social-icons {
text-align: center
}
}
.social-icons {
padding-left: 0;
margin-bottom: 0;
list-style: none
}
.social-icons li {
display: inline-block;
margin-bottom: 4px
}
.social-icons li.title {
margin-right: 15px;
text-transform: uppercase;
color: #96a2b2;
font-weight: 700;
font-size: 13px
}
.social-icons a {
background-color: #eceeef;
color: #818a91;
font-size: 16px;
display: inline-block;
line-height: 44px;
width: 44px;
height: 44px;
text-align: center;
margin-right: 8px;
border-radius: 100%;
-webkit-transition: all .2s linear;
-o-transition: all .2s linear;
transition: all .2s linear
}
.social-icons a:active,
.social-icons a:focus,
.social-icons a:hover {
color: #fff;
background-color: #29aafe
}
.social-icons.size-sm a {
line-height: 34px;
height: 34px;
width: 34px;
font-size: 14px
}
.social-icons a.facebook:hover {
background-color: #3b5998
}
.social-icons a.twitter:hover {
background-color: #00aced
}
.social-icons a.linkedin:hover {
background-color: #007bb6
}
.social-icons a.dribbble:hover {
background-color: #ea4c89
}
@media (max-width:767px) {
.social-icons li.title {
display: block;
margin-right: 0;
font-weight: 600
}
}
</style>
<script src="https://unpkg.com/scrollama"></script>
<script src="https://api.mapbox.com/mapbox-gl-js/v2.8.1/mapbox-gl.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<!-- loading a video cover page -->
<section id="cover">
<!-- loading a video as the background -->
<video class="fullscreen canvas-center" playsinline="" autoplay="" muted="" loop="">
<source src="assets/intro.mp4" type="video/mp4">
</video>
<div id="intro">
<h1>A GeoNarrative Template</h1>
<h5>This line is a place holder for subtitle</h5>
<p>This section shows where active research is happening, and on what topics to communicate on-going nature of
scientific learning. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo
ligula
eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede
justo,
fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdet a, venenatis vitae, justo.
Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi.
Aenean
vulputate
eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante,
dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum.
Aenean imperdiet.
Etiam
ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus,
tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc,
blandit
vel,
luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero
venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla
mauris sit
amet
nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc.</p>
<div class="footnote">
<span> This line is a place holder for copyright note or other footnotes.</span>
<a target="_blank" href="https://www.uw.edu"> <img src="img/uw_logo.png" width="50px"></a>
</div>
</div>
</section>
<!-- a geonarrative will have two major components, a storyboard and a script panel of a series of scenes/actions -->
<section id="geonarrative">
<!-- a storymap can present differnt types of objects, like map, chart, diagram, etc. -->
<div id="storyboard">
<!-- create the place holder element for map -->
<div id="map"></div>
</div>
<article class="scene" data-scene="0">
<h2>STEP 1: Loading Polygons</h2>
</article>
<article class="scene" data-scene="1">
<h2>STEP 2: Loading Points</h2>
</article>
<article class="scene" data-scene="2">
<h2>STEP 3: Relocate to Place A (Seattle)</h2>
</article>
<article class="scene" data-scene="3">
<h2>STEP 4: Relocate to Place B (Portland)</h2>
</article>
<article class="scene" data-scene="4">
<h2>STEP 5: Text Script</h2>
<p>This section shows where active research is happening, and on what topics to communicate on-going nature of
scientific learning. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor.
Aenean massa.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis,
ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla
vel, aliquet nec,
vulputate eget, arcu. In enim justo, rhoncus ut, imperdet a, venenatis vitae, justo. Nullam dictum felis eu pede
mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate.
</p>
<hr>
<div>
<!-- loading bootstrap icons -->
<p><i class="bi bi-person"></i> <span>2,823</span>
</p>
<p><i class="bi bi-map"></i> <span>3,520</span>
</p>
</div>
</article>
<article class="scene" data-scene="5">
<h2>STEP 6: Image </h2>
<img src="img/portland.jpg"></img>
</article>
<article class="scene fullscreen" data-scene="6">
<h2>STEP 7: Ending Page</h2>
</article>
</section>
<section id="footer">
<footer class="site-footer">
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-6">
<h6>About</h6>
<p class="text-justify"> GeoNarrative, also being referred to as storymap, or map-based storytelling, is an visualization genre that primarily utilizes a series of maps or other types of geovisualizations to narrate a geographical event or phenomenon. In addition to geovisualization, there will be other form of information like scripts, images, or videos. </p>
</div>
<div class="col-xs-6 col-md-3">
<h6>Categories</h6>
<ul class="footer-links">
<li><a href="http://hgis.uw.edu/category/c-language/">StoryMap</a></li>
<li><a href="http://hgis.uw.edu/category/front-end-development/">Map Design</a></li>
<li><a href="http://hgis.uw.edu/category/back-end-development/">Cartography</a></li>
<li><a href="http://hgis.uw.edu/category/java-programming-language/">Web Mapping</a></li>
<li><a href="http://hgis.uw.edu/category/android/">Advanced Digital Geographies</a></li>
<li><a href="http://hgis.uw.edu/category/templates/">Templates</a></li>
</ul>
</div>
<div class="col-xs-6 col-md-3">
<h6>Quick Links</h6>
<ul class="footer-links">
<li><a href="http://hgis.uw.edu/about/">About Us</a></li>
<li><a href="http://hgis.uw.edu/contact/">Contact Us</a></li>
<li><a href="http://hgis.uw.edu/contribute-at-scanfcode/">Contribute</a></li>
<li><a href="http://hgis.uw.edu/privacy-policy/">Privacy Policy</a></li>
<li><a href="http://hgis.uw.edu/sitemap/">Sitemap</a></li>
</ul>
</div>
</div>
<hr>
</div>
<div class="container">
<div class="row">
<div class="col-md-8 col-sm-6 col-xs-12">
<p class="copyright-text">Copyright © 2021 All Rights Reserved by
<a href="#">Humanistic GIS Lab</a>.
</p>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<ul class="social-icons">
<li><a class="facebook" href="#"><i class="fa fa-facebook"></i></a></li>
<li><a class="twitter" href="#"><i class="fa fa-twitter"></i></a></li>
<li><a class="dribbble" href="#"><i class="fa fa-dribbble"></i></a></li>
<li><a class="linkedin" href="#"><i class="fa fa-linkedin"></i></a></li>
</ul>
</div>
</div>
</div>
</footer>
</section>
<script>
// 1. Declare the maps, script panels, and different thematic layers.
let map, scriptPanel = scrollama(), countiesLayer, cellTowersLayer;
// 2. Intialize the layout.
history.scrollRestoration = "manual"; // make sure the geo-narrative will be scrolled to the cover page even after a page refresh.
window.scrollTo(0, 0); // scroll the geo-narrative to the coverpage
adjustStoryboardlSize(); // force a browser window resize.
window.addEventListener("resize", adjustStoryboardlSize); // // ask the browser window listen to the resize event, thereby force a viewport resize whenever adjusting the window size.
// 3. Define Generic window resize listener event
function adjustStoryboardlSize() {
const scenes = document.getElementsByClassName("scene");
const storyboard = document.getElementById("storyboard");
// 3.1 determine the height of each scene element
let sceneH = Math.floor(window.innerHeight * 0.75);
for (const scene of scenes) {
scene.style.height = sceneH + "px";
}
// 3.2 determin the height of the storyboard.
let storyboardHeight = window.innerHeight;
let storyboardMarginTop = (window.innerHeight - storyboardHeight) / 2;
storyboard.style.height = storyboardHeight + "px";
storyboard.style.top = storyboardMarginTop + "px"
// 3.3 tell scrollama/script panel to update new element dimensions
scriptPanel.resize();
}
// 4. Initialize the mapbox
mapboxgl.accessToken =
'pk.eyJ1IjoiamFrb2J6aGFvIiwiYSI6ImNpcms2YWsyMzAwMmtmbG5icTFxZ3ZkdncifQ.P9MBej1xacybKcDN_jehvw'; // Assign the access token
map = new mapboxgl.Map({
container: 'map', // container ID
style: 'mapbox://styles/mapbox/light-v10',
zoom: 7, // starting zoom
minZoom: 3,
maxZoom: 10,
center: [-121.93, 47.33], // starting center
scrollZoom: false,
boxZoom: false,
doubleClickZoom: false
}); // Declare the map object
// An alternative way to disable map zoom when using scroll
// map.scrollZoom.disable();
// 5. define the asynchronous function to load geojson data and then performs the dependent actions.
async function geojsonFetch() {
// 6 wait till the data of washington counties and celltowers are fully loaded.
let response, counties, celltowers;
response = await fetch("assets/wacountydata.geojson");
counties = await response.json();
response = await fetch("assets/celltowers.geojson");
celltowers = await response.json();
// 7. Trigger operations inside of the the ()=> {} funciton while loading the map.
map.on('load', () => {
// 8. add map source and declare layers.
map.addSource('celltowers-src', {
type: 'geojson',
data: celltowers
});
map.addSource('counties-src', {
type: 'geojson',
data: counties
});
countiesLayer = {
'id': 'counties-polygons',
'type': 'fill',
'source': 'counties-src',
'minzoom': 5,
'paint': {
'fill-color': '#0080ff',
'fill-opacity': 0.5
}
};
cellTowersLayer = {
'id': 'celltowers-points',
'type': 'circle',
'source': 'celltowers-src',
'minzoom': 5,
'paint': {
'circle-color': 'red',
'circle-radius': 4,
'circle-opacity': 0.8,
}
};
// 9. Initialize the script panel
scriptPanel
.setup({
step: ".scene", // all the scenes.
offset: 0.33, // the location of the enter and exit trigger
debug: false // toggler on or off the debug mode.
})
.onStepEnter(handleSceneEnter)
.onStepExit(handleSceneExit);
// 10. This function performs when a scene enters the storyboard
function handleSceneEnter(response) {
var index = response.index; // capture the id of the current scene.
if (index === 0) { // When enter the first scene
map.flyTo({
center: [-121.93, 47.33],
zoom: 8,
pitch: 0,
speed: 0.5
}); // fly to a new location
if (typeof (map.getSource('counties-src')) == 'undefined') { //if the map source 'counties-src' does not exist
map.addSource('counties-src', {
type: 'geojson',
data: counties
}); // reload the map source of 'counties-src'
} else {
map.getSource('counties-src').setData(counties); // if the map source does not exist, relaod the data counties to the pre-defined map source 'counties-src'.
}
if (!map.getLayer("counties-polygons")) { // if the map layer 'counties-polygons' does not exit
map.addLayer(countiesLayer);
}
document.getElementById("cover").style.visibility = "hidden"; // Hide the cover page
} else if (index === 1) { // When enter the second scene.
map.flyTo({
center: [-121.93, 47.33],
zoom: 8,
pitch: 60,
speed: 0.5
});
if (typeof (map.getSource('celltowers-src')) == 'undefined') {
map.addSource('celltowers-src', {
type: 'geojson',
data: celltowers
});
} else {
map.getSource('celltowers-src').setData(celltowers);
}
if (!map.getLayer("celltowers-points")) {
map.addLayer(cellTowersLayer);
}
} else if (index === 2) {
//Relocate to Seattle
map.flyTo({
center: [-122.4121036, 47.6131229],
zoom: 12,
pitch: 0,
speed: 0.5
});
} else if (index === 3) {
//Relocate to Portland
map.flyTo({
center: [-122.724366, 45.5428119],
zoom: 12,
pitch: 60,
speed: 0.5
});
map.setStyle('mapbox://styles/mapbox/satellite-streets-v10'); // change the base map
} else if (index === 6) {
map.flyTo({
center: [-122.4121036, 47.6131229],
zoom: 12,
pitch: 0,
speed: 0.5
});
}
}
// 11. This function performs when a scene exists the storyboard
function handleSceneExit(response) {
var index = response.index;
if (index === 0) {
if (map.getLayer("counties-polygons")) {
map.removeLayer('counties-polygons');
}
if (response.direction == 'down') {
document.getElementById("cover").style.visibility = "hidden"; // when you scroll down, the cover page will be hided.
} else {
document.getElementById("cover").style.visibility = "visible"; // when you scroll up, the cover page will be shown.
}
} else if (index === 1) {
if (map.getLayer("celltowers-points")) {
map.removeLayer('celltowers-points');
}
} else if (index === 3) {
//exit to Portland
map.setStyle('mapbox://styles/mapbox/light-v10');
}
}
});
};
// 5 call the data loading function.
geojsonFetch();
</script>
</body>
</html>