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

@@ -61,8 +61,7 @@ class Manager {
}
if (!this.options.configLoaded) {
/* Hide the loading page */
document.getElementById("loader").classList.add("hide");
this.hideLoadingPage();
/* Show page to select basic vs expert mode */
this.welcomePage = new ManagerPage(this, "./ejs/welcome.ejs");
@@ -115,7 +114,7 @@ class Manager {
this.options.editEnabled = this.options.instances.find(instance => instance.installed);
/* Hide the loading page */
document.getElementById("loader").classList.add("hide");
this.hideLoadingPage();
this.options.singleInstance = this.options.instances.length === 1;
@@ -363,7 +362,12 @@ class Manager {
}
onCancelClicked() {
location.reload();
this.activePage.hide();
if (this.options.mode === "basic")
this.menuPage.show(true);
else
this.instancesPage.show(true);
this.updateInstances();
}
onGameMasterPasswordChanged(value) {
@@ -594,6 +598,14 @@ class Manager {
style.setProperty('--percent', `${percent}%`);
}
}
hideLoadingPage() {
/* Hide the loading page */
document.getElementById("loader").style.opacity = "0%";
window.setTimeout(() => {
document.getElementById("loader").classList.add("hide");
}, 200);
}
}
module.exports = Manager;