-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
40 lines (32 loc) · 1.22 KB
/
app.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
40
const navAppear = () => {
const burgerMenu = document.querySelector(".burgerMenu");
burgerMenu.addEventListener("click", toggleBurgerMenu);
};
const closeBurgerMenu = () => {
const burgerMenu = document.querySelector(".burgerMenu");
const nav = document.querySelector(".nav ul");
const content = document.querySelector(".content");
const bodyWrap = document.querySelector(".bodyWrap");
bodyWrap.classList.remove("nav-active-body");
content.classList.remove("nav-activeContent");
burgerMenu.classList.remove("line-change");
nav.classList.remove("nav-active");
};
const toggleBurgerMenu = () => {
const burgerMenu = document.querySelector(".burgerMenu");
const nav = document.querySelector(".nav ul");
const content = document.querySelector(".content");
const bodyWrap = document.querySelector(".bodyWrap");
bodyWrap.classList.toggle("nav-active-body");
content.classList.toggle("nav-activeContent");
burgerMenu.classList.toggle("line-change");
nav.classList.toggle("nav-active");
};
const redirectHttps = () => {
const host = "hellios-retreat.dk";
if (window.location.host == host && window.location.protocol != "https:") {
window.location.protocol = "https:";
}
};
redirectHttps();
navAppear();