mirror of
https://github.com/khairul169/honey.git
synced 2026-10-04 18:03:54 +07:00
Sweet dashboard for self-hosted services has just arrived
This commit is contained in:
@@ -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
@@ -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");
|
||||
}
|
||||
Reference in New Issue
Block a user