This commit is contained in:
2026-05-30 00:22:52 +02:00
parent 49828c9323
commit f83e01380c
4 changed files with 171 additions and 103 deletions
+20
View File
@@ -0,0 +1,20 @@
async function refreshGallery() {
const res = await fetch("/photos");
const files = await res.json();
const gallery = document.getElementById("gallery");
if (files.length === 0) return;
gallery.innerHTML = files
.map((f) => `<img src="/photo/${f}" alt="${f}" title="${f}">`)
.join("");
}
document.addEventListener("keydown", async (e) => {
if (e.key !== "c" && e.key !== "C") return;
await fetch("/capture");
refreshGallery();
});
refreshGallery();
setInterval(refreshGallery, 10000);