loading screen

This commit is contained in:
cjdenio committed 2026-11-22 19:42:43 -07:00
1 parent 65a66e552c
commit 323bc464fb
5 files changed
+83 -20

No files matched your search

+9 -2
View File
@@ -288,6 +288,8 @@ function renderVehicle(vehicle) {
});
}
let isLoaded = false
async function reload() {
const { vehicles = [], info } = await fetch("/api", { headers: { Accept: "application/json" } }).then((r) => r.json());
@@ -344,12 +346,17 @@ async function reload() {
currentVehicles.delete(key)
}
}
if (!isLoaded) {
document.getElementById("loader").classList.add("loader--hidden")
isLoaded = true
}
setTimeout(() => reload(), 5000);
}
reload();
setInterval(reload, 5000);
Alpine.data('app', () => ({
busLayer: true,
brtLayer: true,