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
const offset = currentSlide * -50 / visibleSlides;
const offsetmobile = currentSlide * -10 / visibleSlides;
if (window.innerWidth <= 600){
document.querySelector('.__timeline-content').style.transform = `translateX(${offsetmobile}%)`;
} else {
document.querySelector('.__timeline-content').style.transform = `translateX(${offset}%)`;
let timeline = document.querySelector('.__timeline-content');
if (timeline) {
if (window.innerWidth <= 600){
timeline.style.transform = `translateX(${offsetmobile}%)`;
} else {
timeline.style.transform = `translateX(${offset}%)`;
}
}
// Enable/disable arrows based on the current slide