Fix slideshow transition

This commit is contained in:
2025-09-22 23:06:18 +02:00
parent 95e6fff98b
commit 4701c0804b
3 changed files with 38 additions and 5 deletions

View File

@@ -12,11 +12,13 @@ document.addEventListener("alpine:init", () => {
elapsed: 0,
current: 0,
previous: 0,
init() {
this.$watch("elapsed", () => {
const displayTime = this.posters[this.current].displayTime * 1000;
if (this.elapsed > displayTime) {
this.previous = this.current;
this.current = this.getNext();
this.elapsed = 0;
}