-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
24 lines (23 loc) · 979 Bytes
/
script.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
const hamburgerIcon = document.querySelector('.hamburger-icon')
const headerMobileLinks = document.querySelector('.header-mobile-links')
// const headerTextImageWrapper = document.querySelector('.header-text-image-wrapper')
// const header = document.querySelector('.header')
// const headerText = document.querySelector('.header-text')
// const imageIntro = document.querySelector('.image-intro-mobile')
hamburgerIcon.addEventListener('click', function() {
headerMobileLinks.classList.toggle('active')
// headerTextImageWrapper.classList.toggle('active')
// header.classList.toggle('active')
// headerText.classList.toggle('active')
// imageIntro.classList.toggle('active')
if (this.classList.contains('active')) {
this.innerHTML = `
<img src="./images/icon-hamburger.svg" alt="">
`
} else {
this.innerHTML = `
<img src="./images/icon-close.svg" alt="">
`
}
this.classList.toggle('active')
})