Skip to content

Commit

Permalink
chore: fix Swiper
Browse files Browse the repository at this point in the history
  • Loading branch information
DissNik committed Nov 12, 2023
1 parent 38ef4a2 commit ab2d786
Showing 1 changed file with 37 additions and 35 deletions.
72 changes: 37 additions & 35 deletions resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,43 @@ import.meta.glob(["../images/**", "../fonts/**"])
window.Alpine = Alpine

/* Document ready */
document.addEventListener("DOMContentLoaded", () => {
const testimonialsSwiper = new Swiper(".testimonials-slider", {
modules: [Navigation],
slidesPerView: 1,
spaceBetween: 20,
navigation: {
prevEl: ".testimonials-navigation .swiper-button-prev",
nextEl: ".testimonials-navigation .swiper-button-next",
},
watchSlidesProgress: true,
grabCursor: true,
breakpoints: {
375: {
slidesPerView: 1.1,
spaceBetween: 20,
},
720: {
slidesPerView: 1.25,
spaceBetween: 30,
},
960: {
slidesPerView: 2.25,
spaceBetween: 30,
},
1140: {
slidesPerView: 2.5,
spaceBetween: 40,
},
1550: {
slidesPerView: 3,
spaceBetween: 40,
},
},
})
})
document.onreadystatechange = function () {
if (document.readyState === "interactive") {
const testimonialsSwiper = new Swiper(".testimonials-slider", {
modules: [Navigation],
slidesPerView: 1,
spaceBetween: 20,
navigation: {
prevEl: ".testimonials-navigation .swiper-button-prev",
nextEl: ".testimonials-navigation .swiper-button-next",
},
watchSlidesProgress: true,
grabCursor: true,
breakpoints: {
375: {
slidesPerView: 1.1,
spaceBetween: 20,
},
720: {
slidesPerView: 1.25,
spaceBetween: 30,
},
960: {
slidesPerView: 2.25,
spaceBetween: 30,
},
1140: {
slidesPerView: 2.5,
spaceBetween: 40,
},
1550: {
slidesPerView: 3,
spaceBetween: 40,
},
},
})
}
};

/* Alpine.js */
document.addEventListener("alpine:init", () => {
Expand Down

0 comments on commit ab2d786

Please sign in to comment.