-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
35 lines (31 loc) · 990 Bytes
/
index.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
let header = document.querySelector('.header');
let menu = document.querySelector('.header__menu');
let logo = document.querySelector('.header__logo');
let nav = document.querySelector('.header__nav')
let opened = false;
menu.onclick = menuHandler;
function menuHandler() {
if(opened) {
header.style.backgroundColor = 'transparent';
header.style.height = '120px'
nav.style.display = 'none';
logo.src = "img/logo.svg"
menu.src = 'img/navbar.svg'
opened = false;
} else {
header.style.backgroundColor = '#010000';
header.style.height = '100vh'
nav.style.display = 'flex';
logo.src = "img/logo_opened.svg"
menu.src = "img/Group 1.svg";
opened = true;
}
}
function closeMenu() {
header.style.backgroundColor = 'transparent';
header.style.height = '120px'
nav.style.display = 'none';
logo.src = "img/logo.svg"
menu.src = 'img/navbar.svg'
opened = false;
}