Sweet dashboard for self-hosted services has just arrived

This commit is contained in:
Daniel
2023-01-13 22:59:03 +01:00
commit 635689e7fb
15 changed files with 412 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
function get(id) {
return document.getElementById(id);
}
function for_all(class_name, func) {
let a = document.getElementsByClassName(class_name);
for (let i = 0; i < a.length; i++) {
func(a[i]);
}
}
function load_img(img) {
img.classList.remove("unloaded");
}
+19
View File
@@ -0,0 +1,19 @@
function onload() {
for_all("back", (btn) => {
btn.onclick = back;
});
back();
}
function show(id) {
for_all("page", (page) => {
page.classList.add("hidden");
});
get(id).classList.remove("hidden");
get(id).scrollTop = 0;
get("background").classList.remove("scaled");
}
function back() {
show("page-home");
get("background").classList.add("scaled");
}