-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
37 lines (31 loc) · 923 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
32
33
34
35
36
37
new Glide(".glide", {
type: "carousel",
startAt: 0,
perView: 1.1,
gap: 0,
autoPlay: false,
}).mount();
const updateLayout = () => {
const screenWidth = window.innerWidth;
const glideCarousel = document.querySelector(".second-slot-mob");
const cardsRow = document.querySelector(".second-slot-desk");
if (screenWidth < 768) {
cardsRow.style.display = "none";
} else {
glideCarousel.style.display = "none";
}
};
updateLayout();
const items = document.querySelectorAll(".qa-row").forEach((item) => {
const button = item.querySelector("#toggleButton");
const content = item.querySelector(".qa-content");
button.addEventListener("click", function showDetails() {
if (content.classList.contains("visible")) {
content.classList.remove("visible");
button.innerHTML = "﹀";
} else {
content.classList.add("visible");
button.innerHTML = "︿";
}
});
});