refactored code for easy of reading

started on spicy
This commit is contained in:
2025-08-16 12:38:58 +02:00
parent 84bc80d921
commit 140a129114
5 changed files with 33 additions and 22 deletions

BIN
static/base.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 491 KiB

View File

@@ -22,18 +22,17 @@
</head>
<body>
<img id="images" src="img1.jpg" alt="images">
<img id="images" src="base.png" alt="images">
<script>
fetch("/files")
.then(res => res.json())
.then(files => {
console.log(files);
const images = files
let index = 0;
setInterval(() => {
index = (index + 1) % images.length;
document.getElementById("images").src = images[index];
}, 10000);
}, 1000);
});
</script>
</body>

View File

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB