1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-30 16:17:41 +01:00

Decrease scroll amount using buttons

This commit is contained in:
Cooper Ransom 2024-04-04 10:54:56 -04:00
parent 2655154ce9
commit 68ccddd171

View file

@ -163,7 +163,7 @@ export function Discover() {
if (movieElements.length > 0) { if (movieElements.length > 0) {
const movieWidth = movieElements[0].offsetWidth; const movieWidth = movieElements[0].offsetWidth;
const visibleMovies = Math.floor(carousel.offsetWidth / movieWidth); const visibleMovies = Math.floor(carousel.offsetWidth / movieWidth);
const scrollAmount = movieWidth * visibleMovies; const scrollAmount = movieWidth * visibleMovies * 0.69; // Silly number :3
if (direction === "left") { if (direction === "left") {
if (carousel.scrollLeft <= 5) { if (carousel.scrollLeft <= 5) {
carousel.scrollBy({ carousel.scrollBy({