Added quality of life functions

* Ability to use full path for image path
*  Ability to configure the wait time between images
*  Added protection from escaping the image directory
This commit is contained in:
brammp committed 2026-09-21 23:13:19 +02:00
1 parent d0564914e8
commit f6c2b9dd5b
4 files changed
+65 -7

No files matched your search

+5 -4
View File
@@ -134,6 +134,7 @@
</div>
</div>
<script src="/config.js"></script>
<script>
// --- Slideshow ---
@@ -149,7 +150,7 @@
const photoB = document.getElementById('photoB');
// Start with A visible
photoA.style.backgroundImage = 'url(' + images[index] + ')';
photoA.style.backgroundImage = 'url(' + "/img?file=" + images[index] + ')';
photoA.classList.add('visible');
photoInfo(images[index])
document.getElementById('photo-Date').textContent = ""
@@ -157,17 +158,17 @@
setInterval(() => {
index = (index + 1) % images.length;
if (showingA) {
photoB.style.backgroundImage = 'url(' + images[index] + ')';
photoB.style.backgroundImage = 'url(' + "/img?file=" + images[index] + ')';
photoB.classList.add('visible');
photoA.classList.remove('visible');
} else {
photoA.style.backgroundImage = 'url(' + images[index] + ')';
photoA.style.backgroundImage = 'url(' + "/img?file=" + images[index] + ')';
photoA.classList.add('visible');
photoB.classList.remove('visible');
}
photoInfo(images[index])
showingA = !showingA;
}, 5 * 60 * 1000);
}, ImgDuration * 60 * 1000);
}
start();