const carousel = document.querySelector(".carousel"); const arrowBtns = document.querySelectorAll(".weapper button"); const firstCardWidth = carousel.querySelector(".card").offsetWidth; arrowBtns.forEach(btn => { btn.addEventListener("click", () => { carousel.scrollLeft += btn.id === "left" ? -firstCardWidth : firstCardWidth; }) })