diff --git a/js files/script.js b/js files/script.js index 3f2f86b..9df2ef5 100644 --- a/js files/script.js +++ b/js files/script.js @@ -1,19 +1,25 @@ -const leftArrow = document.querySelector('.left-arrow'); -const rightArrow = document.querySelector('.right-arrow'); -const cardsWrapper = document.querySelector('.cards-wrapper'); - -leftArrow.addEventListener('click', () => { - cardsWrapper.scrollBy({ - top: 0, - left: -200, - behavior: 'smooth' - }); -}); - -rightArrow.addEventListener('click', () => { - cardsWrapper.scrollBy({ - top: 0, - left: 200, - behavior: 'smooth' +document.addEventListener("DOMContentLoaded", function () { + var swiper = new Swiper(".mySwiper", { + slidesPerView: 1, + spaceBetween: 20, + loop: true, + navigation: { + nextEl: ".swiper-button-next", + prevEl: ".swiper-button-prev", + }, + breakpoints: { + 640: { + slidesPerView: 2, + spaceBetween: 20, + }, + 768: { + slidesPerView: 2, + spaceBetween: 30, + }, + 1024: { + slidesPerView: 2, + spaceBetween: 40, + }, + }, }); });