-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
31 lines (27 loc) · 873 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
let menu = document.querySelector('#menu-bars')
let navbar = document.querySelector('.navbar')
menu.addEventListener('click' , () => {
menu.classList.toggle('fa-times');
navbar.classList.toggle('active');
})
let searchIcon = document.querySelector('#search-icon')
let close = document.querySelector('#close')
let searchForm = document.querySelector('#search-form')
searchIcon.addEventListener('click' , () => {
searchForm.classList.toggle('active')
})
close.addEventListener('click' , () => {
searchForm.classList.toggle('active')
})
window.onscroll = () => {
navbar.classList.remove('active');
menu.classList.remove('fa-times');
searchForm.classList.remove('active')
}
function loader(){
document.querySelector('.loader-container').classList.add('fade-out')
}
function fadeOut(){
setInterval(loader , 3000)
}
window.onload = fadeOut