-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
39 lines (35 loc) · 880 Bytes
/
index.js
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
/*
MAPPING
COPYRIGHT CARTO, COPYRIGHT OpenStreetMap contributors
*/
const map = new maplibregl.Map({
container: "map",
style: "https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",
center: [-75.4057828769, 43.225158266],
zoom: 15,
});
// TOGGLE THEME FN
function toggleTheme() {
let element = document.body;
element.classList.toggle("toggle-theme");
if (element.classList.contains("toggle-theme")) {
map.setStyle(
"https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json"
);
} else {
map.setStyle(
"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"
);
}
}
/*
SUBPAGES
*/
function showSubpage(pageId) {
let page = document.getElementById(pageId);
page.classList.add("active");
}
function hideSubpage(pageId) {
let page = document.getElementById(pageId);
page.classList.remove("active");
}