-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
65 lines (58 loc) · 2.37 KB
/
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
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
var menu = document.querySelector('.burger'),
iconMenu = document.querySelector('header .burger'),
firstNav = document.querySelector('.fr-nav'),
secondLogo = document.querySelector('.logo-main'),
othertLogo = document.querySelector('.fr-logo'),
menuOpen = document.querySelector('header nav ul'),
contact = document.querySelector('header .fr-contact'),
headerColor = document.querySelector('header'),
burgerDiv = document.querySelector('header .burger-div')
const button = document.querySelector('.zakaz button'),
overlay = document.querySelector('.overlay'),
closeModal = document.querySelector('.modal-close'),
showModal = document.querySelector('.modal-box')
menu.addEventListener('click', function () {
if (iconMenu.getAttribute("src") == 'src/burger.svg') {
iconMenu.setAttribute("src", 'src/close.svg')
menu.style.float = 'right'
firstNav.style.flexDirection = 'row-reverse'
menuOpen.style.display = 'flex'
contact.style.opacity = '0'
headerColor.style.backgroundColor = 'var(--header-color)'
secondLogo.setAttribute("src", 'src/images/logo2.png')
burgerDiv.style.width = '110px'
document.body.style.padding = '0'
overlay.style.display = 'block'
overlay.style.zIndex = '9'
secondLogo.style.display = 'none'
othertLogo.style.display = 'block'
contact.style.width = ''
} else {
iconMenu.setAttribute("src", 'src/burger.svg')
firstNav.style.flexDirection = 'row'
menu.style.float = 'left'
secondLogo.setAttribute("src", 'src/images/logo.png')
menuOpen.style.display = 'none'
contact.style.opacity = '1'
headerColor.style.backgroundColor = '#fff'
overlay.style.display = 'none'
secondLogo.style.marginLeft = '.6rem'
secondLogo.style.display = 'block'
othertLogo.style.display = 'none'
}
menu.classList.toggle('active')
})
button.addEventListener('click', function () {
overlay.style.display = 'block'
overlay.style.position = 'fixed'
overlay.style.top = '0'
showModal.style.display = 'block'
})
overlay.addEventListener('click', function () {
overlay.style.display = 'none'
showModal.style.display = 'none'
})
closeModal.addEventListener('click', function () {
overlay.style.display = 'none'
showModal.style.display = 'none'
})