-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
69 lines (60 loc) · 2.73 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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>JAWASTE</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v2.0.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v2.0.0/mapbox-gl.css' rel='stylesheet' />
<script src="https://unpkg.com/[email protected]/intersection-observer.js"></script>
<script src="https://unpkg.com/scrollama"></script>
<link rel="stylesheet" href="styles.css">
<link href="https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;1,400&family=Lora:ital,wght@0,700;1,500&family=Martel+Sans:wght@400;800&family=Roboto+Condensed:ital,wght@0,300;0,400;0,700;1,400&display=swap" rel="stylesheet">
<link rel="icon" type="image/x-icon" href="images/favicon.png">
<style>
@import url('https://fonts.googleapis.com/css2?family=Frank+Ruhl+Libre&family=Lora:ital,wght@1,500&family=PT+Serif:wght@700&display=swap');
</style>
</head>
<body>
<div id="map"></div>
<div id='story'></div>
<script src='config.js'></script>
<script src="./map.js">
function enableFreeExplore() {
let exploreActive = document.getElementById('freeExplore');
let windowWidth = window.innerWidth;
if (exploreActive.classList.contains("active")) {
exploreActive.classList.remove("active");
if (windowWidth < 1050) {
document.getElementById('explore').style.visibility = 'visible';
exploreActive.style.visibility = 'visible';
} else {
if (map.hasControl(nav)) {
map.removeControl(nav);s
}
}
document.getElementById('map').style.zIndex = -1;
exploreActive.innerHTML = "Scroll Zoom";
map.scrollZoom.disable();
} else {
exploreActive.classList.add("active");
if (windowWidth < 1050) {
document.getElementById('explore').style.visibility = 'hidden';
exploreActive.style.visibility = 'visible';
} else {
map.addControl(nav, 'top-left');
}
document.getElementById('map').style.zIndex = 0;
exploreActive.innerHTML = "Back to story ↑";
map.scrollZoom.enable();
}
}
window.onload = function () {
setTimeout(function () {
scrollTo(0, 0);
// console.log('reset top');
}, 100); //100ms for example
}
</script>
</body>
</html>