-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
49 lines (48 loc) · 1.87 KB
/
main.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
41
42
43
44
45
46
47
48
49
window.setInterval(function() {
if(window.scrollY > 10 || document.getElementById("menu-small") != null){
if (document.getElementById("navigation").className.includes("colored") == false) {
document.getElementById("navigation").classList.add("colored");
}
}
else {
if (document.getElementById("navigation").className.includes("colored") == true) {
document.getElementById("navigation").classList.remove("colored");
}
}
},100);
let x = document.getElementsByClassName("leader");
for (var i = 0; i < x.length; i++){
x[i].childNodes[5].childNodes[0].addEventListener("click", function(e){
if (e.target.id =="contact-isa"){
window.location="mailto:[email protected]";
}
else if (e.target.id =="contact-gabriel"){
window.location="mailto:[email protected]";
}
else if (e.target.id =="contact-daniel"){
window.location="mailto:[email protected]";
}
else if (e.target.id =="contact-armin"){
window.location="mailto:[email protected]";
}
});
}
document.getElementById("hamburger").addEventListener("click", function(){
if (document.getElementById("menu-small") == null){
var nav = document.getElementById("navigation");
var hamburger = document.getElementById("hamburger");
nav.classList.add("colored");
hamburger.className = "fa fa-close menu-item";
el = document.createElement("div");
el.id="menu-small";
el.innerHTML = hamburger.parentNode.innerHTML;
el.lastChild.remove();
el.lastChild.remove();
document.getElementById("navigation").parentNode.appendChild(el);
}
else{
var hamburger = document.getElementById("hamburger");
document.getElementById("menu-small").remove();
hamburger.className = "fa fa-bars menu-item";
}
});