From 4f5023b45cc6380395301671e7f09de7a2da5eaa Mon Sep 17 00:00:00 2001 From: Pax1601 Date: Sun, 28 Jan 2024 15:14:30 +0100 Subject: [PATCH 1/6] Added fade transition between pages --- manager/index.html | 2 +- manager/javascripts/manager.js | 20 ++++++++++++++---- manager/javascripts/managerpage.js | 18 ++++++++++++---- manager/javascripts/popup.js | 34 +++++++++++++++++++----------- manager/stylesheets/style.css | 9 ++++++-- 5 files changed, 60 insertions(+), 23 deletions(-) diff --git a/manager/index.html b/manager/index.html index b51718a2..76337237 100644 --- a/manager/index.html +++ b/manager/index.html @@ -34,7 +34,7 @@ -
+
Loading, please wait...
diff --git a/manager/javascripts/manager.js b/manager/javascripts/manager.js index 8e7d7c56..ba2157b0 100644 --- a/manager/javascripts/manager.js +++ b/manager/javascripts/manager.js @@ -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; \ No newline at end of file diff --git a/manager/javascripts/managerpage.js b/manager/javascripts/managerpage.js index c27bbeda..14470d65 100644 --- a/manager/javascripts/managerpage.js +++ b/manager/javascripts/managerpage.js @@ -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"); diff --git a/manager/javascripts/popup.js b/manager/javascripts/popup.js index dd36efa2..1c98056a 100644 --- a/manager/javascripts/popup.js +++ b/manager/javascripts/popup.js @@ -1,8 +1,7 @@ // TODO: we can probably refactor this to be a bit cleaner function showInfoPopup(message, onCloseCallback) { - document.getElementById("grayout").classList.remove("hide"); - document.getElementById("popup").classList.remove("hide"); + showPopup(); document.getElementById("popup").querySelector(".error").classList.add("hide"); document.getElementById("popup").querySelector(".wait").classList.add("hide"); document.getElementById("popup").querySelector(".confirm").classList.remove("hide"); @@ -20,8 +19,7 @@ function showInfoPopup(message, onCloseCallback) { function showErrorPopup(message, onCloseCallback) { - document.getElementById("grayout").classList.remove("hide"); - document.getElementById("popup").classList.remove("hide"); + showPopup(); document.getElementById("popup").querySelector(".error").classList.remove("hide"); document.getElementById("popup").querySelector(".wait").classList.add("hide"); document.getElementById("popup").querySelector(".confirm").classList.add("hide"); @@ -38,8 +36,7 @@ function showErrorPopup(message, onCloseCallback) { } function showWaitPopup(message) { - document.getElementById("grayout").classList.remove("hide"); - document.getElementById("popup").classList.remove("hide"); + showPopup(); document.getElementById("popup").querySelector(".error").classList.add("hide"); document.getElementById("popup").querySelector(".wait").classList.remove("hide"); document.getElementById("popup").querySelector(".confirm").classList.add("hide"); @@ -49,8 +46,7 @@ function showWaitPopup(message) { } function showWaitLoadingPopup(message) { - document.getElementById("grayout").classList.remove("hide"); - document.getElementById("popup").classList.remove("hide"); + showPopup(); document.getElementById("popup").querySelector(".error").classList.add("hide"); document.getElementById("popup").querySelector(".wait").classList.remove("hide"); document.getElementById("popup").querySelector(".confirm").classList.add("hide"); @@ -60,8 +56,7 @@ function showWaitLoadingPopup(message) { } function showConfirmPopup(message, onAcceptCallback, onCloseCallback) { - document.getElementById("grayout").classList.remove("hide"); - document.getElementById("popup").classList.remove("hide"); + showPopup(); document.getElementById("popup").querySelector(".error").classList.add("hide"); document.getElementById("popup").querySelector(".wait").classList.add("hide"); document.getElementById("popup").querySelector(".confirm").classList.remove("hide"); @@ -85,9 +80,24 @@ function showConfirmPopup(message, onAcceptCallback, onCloseCallback) { document.getElementById("popup").querySelector(".content").innerHTML = message; } +function showPopup() { + document.getElementById("grayout").classList.remove("hide"); + document.getElementById("popup").classList.remove("hide"); + + window.setTimeout(() => { + document.getElementById("grayout").style.opacity = "100%"; + document.getElementById("popup").style.opacity = "100%"; + }, 100); +} + function hidePopup() { - document.getElementById("grayout").classList.add("hide"); - document.getElementById("popup").classList.add("hide"); + document.getElementById("grayout").style.opacity = "0%"; + document.getElementById("popup").style.opacity = "0%"; + + window.setTimeout(() => { + document.getElementById("grayout").classList.add("hide"); + document.getElementById("popup").classList.add("hide"); + }, 200); } function setPopupLoadingProgress(message, percent) { diff --git a/manager/stylesheets/style.css b/manager/stylesheets/style.css index 0b831d0d..47d09dca 100644 --- a/manager/stylesheets/style.css +++ b/manager/stylesheets/style.css @@ -275,9 +275,10 @@ input { left: 0px; width: 100%; height: 100%; - background-color: black; - opacity: 30%; + background-color: rgba(0, 0, 0, 0.30); z-index: 999; + transition: opacity 0.2s linear; + opacity: 0%; /* By default has 0% opacity to allow for fade transition */ } #popup { @@ -295,6 +296,8 @@ input { padding: 20px 40px; align-items: start; z-index: 999; + transition: opacity 0.2s linear; + opacity: 0%; /* By default has 0% opacity to allow for fade transition */ } #popup img { @@ -331,6 +334,8 @@ input { .manager-page { min-width: 1200px; overflow-y: auto; + transition: opacity 0.2s linear; + opacity: 0%; /* By default has 0% opacity to allow for fade transition */ } .input-group { From c2f6edfd749c0e8972819d99dc2bb8020b9399fb Mon Sep 17 00:00:00 2001 From: Pax1601 Date: Sun, 28 Jan 2024 16:37:29 +0100 Subject: [PATCH 2/6] Minor refactoring of css, fixed graphical inconsistencies --- manager/ejs/connections.ejs | 2 +- manager/ejs/instances.ejs | 250 +----------- manager/ejs/menu.ejs | 6 +- manager/ejs/passwords.ejs | 2 +- manager/ejs/result.ejs | 14 +- manager/ejs/settings.ejs | 242 +----------- manager/ejs/welcome.ejs | 2 +- manager/ejs/wizard.ejs | 32 +- manager/index.html | 2 +- manager/javascripts/dcsinstance.js | 7 +- manager/javascripts/manager.js | 8 +- manager/javascripts/preload.js | 2 +- manager/stylesheets/style.css | 614 +++++++++++++++++++++-------- 13 files changed, 515 insertions(+), 668 deletions(-) diff --git a/manager/ejs/connections.ejs b/manager/ejs/connections.ejs index d661c03b..cc8df545 100644 --- a/manager/ejs/connections.ejs +++ b/manager/ejs/connections.ejs @@ -22,7 +22,7 @@ #connections-page .error span { font-weight: 600; - font-size: 12px; + font-size: var(--small); color: var(--red); height: fit-content; } diff --git a/manager/ejs/instances.ejs b/manager/ejs/instances.ejs index d2fdbbaa..86f46e34 100644 --- a/manager/ejs/instances.ejs +++ b/manager/ejs/instances.ejs @@ -1,243 +1,14 @@ -
+
-
- +
+ View and manage installs - + The following DCS installations have been identified.
You can start an Olympus server, modify settings and uninstall below.
@@ -246,7 +17,10 @@ <% for (let i = 0; i < instances.length; i++) {%>
- <%= instances[i].name %> + <%= instances[i].name %> + + <%= instances[i].folder %> +
ACTIVE
OFFLINE
@@ -259,11 +33,11 @@
- + <%= instances[i].installed? (instances[i].error? 'Corrupted/outdated Olympus installation': 'Olympus installed'): 'Olympus not installed' %> - <%= instances[i].folder %> -
+ +
Client port
<%= instances[i].installed? instances[i].clientPort: "N/A" %>
@@ -293,7 +67,7 @@
Open in browser
Stop Olympus
-
Open logs
diff --git a/manager/ejs/menu.ejs b/manager/ejs/menu.ejs index 3454555e..5c7e444a 100644 --- a/manager/ejs/menu.ejs +++ b/manager/ejs/menu.ejs @@ -20,7 +20,7 @@ height: 110px; color: var(--offwhite); display: flex; - font-size: 18px; + font-size: var(--large); font-weight: 600; padding-left: 15px; align-items: start; @@ -36,7 +36,7 @@ } #manager-menu .option>div { - font-size: 14px; + font-size: var(--normal); font-weight: normal; } @@ -79,7 +79,7 @@
INSTALL WIZARD AND MANAGER
-
+
Using this manager, you can install Olympus, update settings, and view and manage instances
diff --git a/manager/ejs/passwords.ejs b/manager/ejs/passwords.ejs index 9d9907d6..d592a7c6 100644 --- a/manager/ejs/passwords.ejs +++ b/manager/ejs/passwords.ejs @@ -33,7 +33,7 @@ ">
-
" style="color: var(--offwhite); font-size: 14px; color: var(--lightgray);"> +
" style="color: var(--offwhite); font-size: var(--normal); color: var(--lightgray);"> Note: to keep the old passwords, click Next without editing any value.
diff --git a/manager/ejs/result.ejs b/manager/ejs/result.ejs index d13fb87f..1a7d0cf9 100644 --- a/manager/ejs/result.ejs +++ b/manager/ejs/result.ejs @@ -15,7 +15,7 @@ #result-page .result-summary .title { font-weight: bold; - font-size: 15px; + font-size: var(--big); display: flex; align-items: center; } @@ -25,7 +25,7 @@ } #result-page .result-summary .description { - font-size: 13px; + font-size: var(--normal); } #result-page .result-summary.success{ @@ -62,7 +62,7 @@ row-gap: 5px; justify-items: center; align-items: start; - font-size: 13px; + font-size: var(--normal); } #result-page .usage-instructions>div>img { @@ -91,10 +91,10 @@
See the manager log located in <%= logLocation %> for more information.
-
+
How to launch Olympus
-
+
To launch Olympus, there are shortcuts available on the desktop and in the <%= activeInstance["name"] %> folder under Saved Games.
<% if (activeInstance["installationType"] === "singleplayer") { %> @@ -113,7 +113,7 @@
-
+
Alternatively, you can run the Olympus Server instead and visit in a web browser (Google Chrome recommended) to replace the first step above.
<% } else { %> @@ -139,7 +139,7 @@
-
+
To access Olympus from this PC, you need to visit in a web browser (Google Chrome recommended) instead.
<% } %> diff --git a/manager/ejs/settings.ejs b/manager/ejs/settings.ejs index 2b964070..31e2f3fc 100644 --- a/manager/ejs/settings.ejs +++ b/manager/ejs/settings.ejs @@ -1,233 +1,18 @@ -
-
+
+
Back to menu
-
- - View and manage installs +
+ + Change settings - - The following Olympus installations have been identified.
You can modify settings and uninstall below. + + Here you can see the DCS instances on your computer that have Olympus installed.
+ You can edit settings and uninstall Olympus from this screen.
@@ -236,10 +21,13 @@ <% if (instances[i].installed) { %>
- <%= instances[i].name %> - <%= instances[i].folder %> + <%= instances[i].name %> + <%= instances[i].folder %>
-
+ + <%= instances[i].installed? (instances[i].error? 'Corrupted/outdated Olympus installation': 'Olympus installed'): 'Olympus not installed' %> + +
Client port
<%= instances[i].installed? instances[i].clientPort: "N/A" %>
@@ -253,7 +41,7 @@
<%= instances[i].installed? instances[i].backendAddress: "N/A" %>
-
Open logs
diff --git a/manager/ejs/welcome.ejs b/manager/ejs/welcome.ejs index 814fe9d9..87384c41 100644 --- a/manager/ejs/welcome.ejs +++ b/manager/ejs/welcome.ejs @@ -22,7 +22,7 @@ height: 70px; color: var(--offwhite); display: flex; - font-size: 18px; + font-size: var(--very-large); font-weight: 600; padding-left: 15px; align-items: center; diff --git a/manager/ejs/wizard.ejs b/manager/ejs/wizard.ejs index dc5a4ef8..7267bdd7 100644 --- a/manager/ejs/wizard.ejs +++ b/manager/ejs/wizard.ejs @@ -7,40 +7,34 @@ max-height: 100%; } - .buttons-footer { - display: flex; - column-gap: 10px; - justify-content: start; - } - - .instructions { + .wizard-page .instructions { display: flex; flex-direction: column; row-gap: 15px; color: var(--offwhite); } - .instructions .step { - font-size: 14px; + .wizard-page .instructions .step { + font-size: var(--normal); color: var(--lightgray); } - .instructions .description { - font-size: 14px; + .wizard-page .instructions .description { + font-size: var(--normal); color: var(--lightgray); } - .instructions .title { + .wizard-page .instructions .title { font-size: 24px; font-weight: bold; } - .content { + .wizard-page .content { overflow-x: hidden; overflow-y: scroll; } - .content > div { + .wizard-page .content > div { height: 100%; width: 100%; display: flex; @@ -50,7 +44,7 @@ justify-content: center; } - .wizard-inputs { + .wizard-page .wizard-inputs { display: flex; flex-direction: column; row-gap: 10px; @@ -60,23 +54,23 @@ width: 300px; } - .note { + .wizard-page .note { width: 100%; background-color: var(--background-note); color: var(--offwhite); border-left: 5px solid var(--offwhite); - font-size: 14px; + font-size: var(--normal); padding: 15px; font-weight: 600; } - .warning { + .wizard-page .warning { background-color: var(--background-warning); border-left: 5px solid var(--orange); }
-
+
Cancel install
diff --git a/manager/index.html b/manager/index.html index 76337237..87bb62c7 100644 --- a/manager/index.html +++ b/manager/index.html @@ -37,7 +37,7 @@
Loading, please wait...
-
+