-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
70 lines (58 loc) · 1.57 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
function print(word) {
console.log(word)
}
document.getElementById('promoclose').addEventListener('click', e => {
document.getElementById('promo').style.display = 'none'
})
document.getElementById("hamburger").addEventListener('click', e => {
const ddElement = document.getElementById("dd");
const isOn = ddElement.classList.contains("on");
ddElement.classList.toggle("on");
document.querySelectorAll("#myhamburger").forEach(item => {
if (isOn) {
item.style.backgroundColor = 'silver';
} else {
item.style.backgroundColor = 'dimgray';
}
});
});
const observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
console.log(entry)
if (entry.isIntersecting) {
entry.target.classList.add("show");
} else {
entry.target.classList.remove('show');
}
});
})
const hiddenElements = document.querySelectorAll('.hidden')
hiddenElements.forEach((el) => observer.observe(el))
var swiper = new Swiper(".card-holder", {
slidesPerView: 3,
spaceBetween: 25,
loop: true,
centerSlide: true,
fade: true,
grabCursor: true,
pagination: {
el: ".swiper-pagination",
clickable: true,
dynamicBullets: 'true'
},
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
breakpoints: {
0: {
slidesPerView: 1,
},
650: {
slidesPerView: 2,
},
950: {
slidesPerView: 3,
},
}
});