-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
54 lines (50 loc) · 1.62 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
var testimonialData = [
{
avatar: "https://img.freepik.com/free-photo/woman-with-long-hair-yellow-hoodie-with-word-music-it_1340-39068.jpg",
name: "Utkarsh Dwivedi",
review: "Mind-blowing discovery! changed my routine. Essential for everyone. A wise advice to all interested. Can't imagine without it!"
},
// ... (other testimonial data entries)
{
avatar: "https://img.freepik.com/free-photo/portrait-white-man-isolated_53876-40306.jpg",
name: "Pankhuri",
review: "Life-altering find! Indispensable now. Enthusiastically suggest to all. A game-changer for everyone!"
}
];
var slideHolder = document.querySelector("#slideHolder");
for (let i of testimonialData) {
slideHolder.innerHTML += `<div class="swiper-slide">
<div class="ImgHolder"><img src="${i.avatar}"></div>
<div class="ContentHolder"><h3>${i.name}</h3><p>${i.review}</p></div>
</div>`;
}
const swiper = new Swiper('#carouselContainer', {
grabCursor: true,
centeredSlides: true,
slidesPerView: 2.3,
loop: true,
spaceBetween: 30,
effect: "coverflow",
coverflowEffect: {
rotate: 0,
depth: 800,
slideShadows: true,
},
pagination: {
el: '.swiper-pagination',
clickable: true
},
autoplay: { delay: 5000 }
});
window.onresize = queryResizer;
queryResizer();
function queryResizer() {
if (window.innerWidth < 501) {
swiper.params.slidesPerView = 1;
} else if (window.innerWidth < 724) {
swiper.params.slidesPerView = 2;
} else {
swiper.params.slidesPerView = 2.3;
}
swiper.update();
}