Added fade transition between pages

This commit is contained in:
Pax1601
2024-01-28 15:14:30 +01:00
parent f0ab43d320
commit 4f5023b45c
5 changed files with 60 additions and 23 deletions

View File

@@ -29,8 +29,6 @@ class ManagerPage {
}
});
this.element.classList.remove("hide");
this.previousPage = ignorePreviousPage ? this.previousPage : this.manager.activePage;
this.manager.activePage = this;
@@ -39,11 +37,23 @@ class ManagerPage {
}
hide() {
this.element.classList.add("hide");
this.element.style.opacity = "0%";
window.setTimeout(() => {
this.element.classList.add("hide");
}, 200);
}
render(str) {
render(str) {
this.element.innerHTML = str;
this.element.style.opacity = "0%";
window.setTimeout(() => {
this.element.classList.remove("hide");
}, 200)
window.setTimeout(() => {
this.element.style.opacity = "100%";
}, 300)
/* Connect all the collapsable buttons */
let buttons = document.querySelectorAll(".button.collapse");