-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
77 lines (60 loc) · 1.8 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
66
67
68
69
70
71
72
73
74
75
var thumbsSwiper = new Swiper(".thumbsSwiper", {
spaceBetween: 10,
slidesPerView: 3,
breakpoints: {
200: {
slidesPerView: 2,
},
400: {
slidesPerView: 3,
}
},
});
const swiper = new Swiper(".bannerSwiper", {
spaceBetween: 0,
allowTouchMove: false,
speed: 1000,
thumbs: {
swiper: thumbsSwiper,
},
});
var explore = document.querySelectorAll(".explore");
var thumbs = document.querySelector(".thumbs");
var headers = document.querySelectorAll(".title");
var contents = document.querySelectorAll(".content");
var slideBtns = document.querySelectorAll(".slide-btn");
var closeBtns = document.querySelectorAll(".close-btn");
explore.forEach((el) => {
el.addEventListener("click", function () {
thumbs.classList.add("hide");
headers.forEach((e) => {
e.classList.add("hide");
});
el.classList.add("hide");
document.querySelector(".swiper-slide-active").classList.add("hide");
contents.forEach((e) => {
e.classList.add("hide");
})
});
});
slideBtns.forEach(el => {
el.addEventListener("click", function () {
document.querySelector(".swiper-slide-active").classList.remove("hide");
document.querySelector(".swiper-slide-active").classList.add("details");
});
});
closeBtns.forEach(el => {
el.addEventListener("click", function () {
thumbs.classList.remove("hide");
document.querySelector(".swiper-slide-active").classList.remove("details");
contents.forEach(e => {
e.classList.remove("hide");
});
headers.forEach(e => {
e.classList.remove("hide");
});
explore.forEach(e => {
e.classList.remove("hide");
});
});
});