-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
38 lines (31 loc) · 1010 Bytes
/
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
const navbar = document.getElementById("navbar");
const backgroundimage = document.getElementById("background-image");
var alias, portfolio, blog;
window.onload = () => {
navbar.style.visibility = "hidden";
alias = (backgroundimage.childNodes[1]);
portfolio = (backgroundimage.childNodes[5]);
blog = (backgroundimage.childNodes[7]);
}
window.onscroll = () => {
var y = document.body.scrollTop;
console.log(y);
if(document.body.scrollTop > 70 || document.documentElement.scrollTop > 70){
navbar.style.visibility = "visible";
alias.style.visibility = "hidden";
portfolio.style.visibility = "hidden";
blog.style.visibility = "hidden";
}else{
navbar.style.visibility = "hidden";
alias.style.visibility = "visible";
portfolio.style.visibility = "visible";
blog.style.visibility = "visible";
}
}
const burgerAnimate = () => {
const burger = document.querySelectorAll('.hamburger');
burger.addEventListner('click', () =>{
burger.classList.toggle('toggle');
});
}
burgerAnimate();