-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
80 lines (73 loc) · 1.92 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
// Header Scroll
let nav = document.querySelector(".navbar");
window.onscroll = function () {
if (document.documentElement.scrollTop > 50) {
nav.classList.add("header-scrolled");
} else {
nav.classList.remove("header-scrolled");
}
}
// nav hide
let navBar = document.querySelectorAll(".nav-link");
let navCollapse = document.querySelector(".navbar-collapse.collapse");
navBar.forEach(function (a) {
a.addEventListener("click", function () {
navCollapse.classList.remove("show");
})
})
// Swiper Slider
var swiper = new Swiper(".mySwiper", {
direction: "vertical",
loop: true,
pagination: {
el: ".swiper-pagination",
clickable: true,
},
autoplay: {
delay: 3500,
},
});
// counter design
document.addEventListener("DOMContentLoaded", () => {
function counter(id, start, end, duration) {
let obj = document.getElementById(id),
current = start,
range = end - start,
increment = end > start ? 1 : -1,
step = Math.abs(Math.floor(duration / range)),
timer = setInterval(() => {
current += increment;
obj.textContent = current;
if (current == end) {
clearInterval(timer);
}
}, step);
}
counter("count1", 0, 1287, 3000);
counter("count2", 100, 5786, 2500);
counter("count3", 0, 1440, 3000);
counter("count4", 0, 7110, 3000);
});
// Our Partner
var swiper = new Swiper(".our-partner", {
slidesPerView: 5,
spaceBetween: 30,
loop: true,
autoplay: {
delay: 2000,
},
breakpoints: {
'991': {
slidesPerView: 5,
spaceBetween: 10,
},
'767': {
slidesPerView: 3,
spaceBetween: 10,
},
'320': {
slidesPerView: 2,
spaceBetween: 8,
},
},
});