-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
102 lines (87 loc) · 2.57 KB
/
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
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
let searchBar = document.querySelector('.search-bar');
document.querySelector('#search-btn').onclick = () => {
searchBar.classList.toggle('active');
shoppingCart.classList.remove('active');
loginForm.classList.remove('active');
navBAr.classList.remove('active');
}
let shoppingCart = document.querySelector('.shopping-cart');
document.querySelector('#cart-btn').onclick = () => {
shoppingCart.classList.toggle('active');
searchBar.classList.remove('active');
loginForm.classList.remove('active');
navBAr.classList.remove('active');
}
let loginForm = document.querySelector('.login-form');
document.querySelector('#login-btn').onclick = () => {
loginForm.classList.toggle('active');
searchBar.classList.remove('active');
shoppingCart.classList.remove('active');
navBAr.classList.remove('active');
}
//Experimental not required---------------------
// let BTN = document.querySelector('.login-form');
// document.querySelector('#lbtn').onclick = () => {
// BTN.classList.toggle('active');
// searchBar.classList.remove('active');
// shoppingCart.classList.remove('active');
// navBAr.classList.remove('active');
// }
// let ABTN = document.querySelector('.login-form');
//----------------------------------------------
let navBAr = document.querySelector('.navbar');
document.querySelector('#menu-btn').onclick = () => {
navBAr.classList.toggle('active');
searchBar.classList.remove('active');
shoppingCart.classList.remove('active');
loginForm.classList.remove('active');
}
// for on mouse scroll remove
window.onscroll = () => {
searchBar.classList.remove('active');
shoppingCart.classList.remove('active');
loginForm.classList.remove('active');
navBAr.classList.remove('active');
}
//slider code for product
var swiper = new Swiper(".product-slider", {
loop: true,
spaceBetween: 20,
autoplay: {
delay: 5000,
disableOnInteraction: false,
},
breakpoints: {
0: {
slidesPerView: 1,
spaceBetween: 20,
},
768: {
slidesPerView: 2,
},
1024: {
slidesPerView: 3,
},
},
});
//slider code for review
var swiper = new Swiper(".review-slider", {
loop: true,
spaceBetween: 20,
autoplay: {
delay: 5000,
disableOnInteraction: false,
},
breakpoints: {
0: {
slidesPerView: 1,
spaceBetween: 20,
},
768: {
slidesPerView: 2,
},
1024: {
slidesPerView: 3,
},
},
});