-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
40 lines (33 loc) · 1021 Bytes
/
Copy pathmain.js
File metadata and controls
40 lines (33 loc) · 1021 Bytes
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
const init = () => {
navSide();
changeColor();
};
const navSide = () => {
const elBurger = document.querySelector('.burger');
const elNavLink = document.querySelector('.nav-links');
const elNavLinks = document.querySelectorAll('.nav-links div');
elNavLink.classList.toggle('nav-active');
elNavLink.style.opacity = 1;
elNavLink.style.transition = `transform .9s ease-in`;
elNavLinks.forEach((link, idx) => {
if (link.style.animation) {
link.style.animation = '';
} else {
link.style.animation = `navSlide .9s ease forwards ${idx / 7 + 0.5}s`;
}
});
elBurger.classList.toggle('toggle');
};
function onUserPrefs() {
window.open('../pages/user-prefs.html', '_self');
}
function onMapNav() {
window.open('../pages/map.html', '_self');
}
function changeColor() {
let userData = loadFromStorage('userData');
if (!userData) return;
var body = document.querySelector('body');
body.style.background = userData.colors.bgc;
body.style.color = userData.colors.txt;
}