-
Notifications
You must be signed in to change notification settings - Fork 0
/
script3.js
29 lines (24 loc) · 837 Bytes
/
script3.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
let menu = document.querySelector('#menu-bars');
let navbar = document.querySelector('.navbar');
let cartIcon = document.querySelector('#cart-icon');
let cart = document.querySelector('.cart');
let closeCart = document.querySelector('#close-cart');
//Nav Bar Functions
menu.onclick = () =>{
menu.classList.toggle('fa-times');
navbar.classList.toggle('active');
}
window.onscroll = () => {
menu.classList.remove('fa-times');
navbar.classList.remove('active');
}
document.querySelector('#search-icon').onclick = () =>{
document.querySelector('#search-form').classList.toggle('active');
}
function loader() {
document.querySelector('.loader-container').classList.add('fade-out');
}
function fadeOut() {
setInterval(loader, 3000);
}
window.onload = fadeOut;