-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanimation.js
More file actions
22 lines (21 loc) · 834 Bytes
/
animation.js
File metadata and controls
22 lines (21 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
let sideBar = document.querySelector(".side_bar");
let menu = document.querySelector(".hum_burger");
let spanOne = document.querySelector(".hum_burger .one");
let spanTwo = document.querySelector(".hum_burger .two");
let spanThree = document.querySelector(".hum_burger .three");
let count =0;
menu.addEventListener("click", () => {
if(count === 0){
sideBar.style.transform = "translateX(0)";
spanOne.style.transform = "rotate(-45deg)";
spanTwo.style.transform = "translateX(6px)";
spanThree.style.transform = "rotate(45deg)";
count++;
} else if(count === 1){
sideBar.style.transform = "translateX(-80%)";
spanOne.style.transform = "rotate(0)";
spanTwo.style.transform = "translateX(0)";
spanThree.style.transform = "rotate(0)";
count--;
}
})