js bug fix compiled again

This commit is contained in:
Bachir Soussi Chiadmi 2024-09-25 16:59:16 +02:00
parent a6d6c9d268
commit 935b2ceeab
2 changed files with 8 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -320,10 +320,13 @@
// Calculate the offset for the transform // Calculate the offset for the transform
const offset = currentSlide * -50 / visibleSlides; const offset = currentSlide * -50 / visibleSlides;
const offsetmobile = currentSlide * -10 / visibleSlides; const offsetmobile = currentSlide * -10 / visibleSlides;
if (window.innerWidth <= 600){ let timeline = document.querySelector('.__timeline-content');
document.querySelector('.__timeline-content').style.transform = `translateX(${offsetmobile}%)`; if (timeline) {
} else { if (window.innerWidth <= 600){
document.querySelector('.__timeline-content').style.transform = `translateX(${offset}%)`; timeline.style.transform = `translateX(${offsetmobile}%)`;
} else {
timeline.style.transform = `translateX(${offset}%)`;
}
} }
// Enable/disable arrows based on the current slide // Enable/disable arrows based on the current slide