Skip to content

Commit

Permalink
ProgressBar überarbeitet
Browse files Browse the repository at this point in the history
  • Loading branch information
pl0ss committed Oct 2, 2024
1 parent f2379a1 commit 871a05d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,20 @@ function updateSlideshow() {
imageElement.src = `imgs/${language}/${images[currentIndex].src}`;
textElement.textContent = images[currentIndex][`text_${language}`];

// Setzt alle Progress Bars zurück
if(currentIndex == 0) {
progressBars.forEach((bar, index) => {
bar.classList.remove('progressbar_current');
});

void progressBars[0].offsetWidth; // Dies erzwingt einen Reflow und startet die Animation neu
}

// Aktualisiert die Progress Bars
progressBars.forEach((bar, index) => {
if(index == currentIndex) {
bar.classList.add('progressbar_current');
} else {
} else if(index > currentIndex) {
bar.classList.remove('progressbar_current');
}
});
Expand Down

0 comments on commit 871a05d

Please sign in to comment.