From 8ef809be5cf5cac2717662f795167ae6c1aa0480 Mon Sep 17 00:00:00 2001 From: HorizonCode Date: Mon, 17 Oct 2022 16:37:12 +0200 Subject: [PATCH] add loading page on startup --- app.js | 22 ++++++- assets/launcher.css | 138 ++++++++++++++++++++++++++++++++++++++++++++ html/index.html | 21 ++++++- preload/preload.js | 25 ++++---- 4 files changed, 192 insertions(+), 14 deletions(-) diff --git a/app.js b/app.js index 703d0bc..f752f8f 100644 --- a/app.js +++ b/app.js @@ -21,7 +21,8 @@ const run = () => { mainWindow = createWindow(); mainWindow.on('show', async () => { - await doUpdateCheck(mainWindow); + await updateConfigVars(mainWindow); + await tryLogin(mainWindow); }) app.on('activate', function () { if (BrowserWindow.getAllWindows().length === 0) mainWindow = createWindow(); @@ -89,6 +90,25 @@ const run = () => { }) } +async function updateConfigVars(window) { + const osuPath = JSON.stringify(config.get("osuPath", "")); + window.webContents.send('config_update', { + osuPath: osuPath + }) +} + +async function tryLogin(window) { + const username = config.get("username", ""); + const password = config.get("password", ""); + if ((username && username.length > 0) && (password && password.length > 0)) { + + } else { + window.webContents.send('account_update', { + type: "not-loggedin" + }) + } +} + async function doUpdateCheck(window) { const osuPath = await config.get("osuPath", ""); const isValid = await osuUtil.isValidOsuFolder(osuPath); diff --git a/assets/launcher.css b/assets/launcher.css index d12c0df..c00eb22 100644 --- a/assets/launcher.css +++ b/assets/launcher.css @@ -23,6 +23,7 @@ width: 100%; } +.loading-section, .login-section { margin-top: 35px; display: flex; @@ -31,6 +32,21 @@ align-items: center; } +.loading-section { + margin-top: 0; +} + +.loading-section {} + +.loading-indicator {} + +.loading-indicator-text { + display: flex; + flex-flow: column; + justify-content: center; + align-items: center; +} + .folder-section { margin-top: 80px; display: flex; @@ -164,4 +180,126 @@ .clickable { cursor: pointer; +} + +.loader { + position: relative; + margin: 0px auto; + width: 200px; + height: 200px; + transform: scale(0.5); +} + +.loader:before { + content: ''; + display: block; + padding-top: 100%; +} + +.circular-loader { + -webkit-animation: rotate 2s linear infinite; + animation: rotate 2s linear infinite; + height: 100%; + -webkit-transform-origin: center center; + -ms-transform-origin: center center; + transform-origin: center center; + width: 100%; + position: absolute; + top: 0; + left: 0; + margin: auto; +} + +.loader-path { + stroke-dasharray: 150, 200; + stroke-dashoffset: -10; + -webkit-animation: dash 1.5s ease-in-out infinite, color 6s ease-in-out infinite; + animation: dash 1.5s ease-in-out infinite, color 6s ease-in-out infinite; + stroke-linecap: round; +} + +@-webkit-keyframes rotate { + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@keyframes rotate { + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@-webkit-keyframes dash { + 0% { + stroke-dasharray: 1, 200; + stroke-dashoffset: 0; + } + + 50% { + stroke-dasharray: 89, 200; + stroke-dashoffset: -35; + } + + 100% { + stroke-dasharray: 89, 200; + stroke-dashoffset: -124; + } +} + +@keyframes dash { + 0% { + stroke-dasharray: 1, 200; + stroke-dashoffset: 0; + } + + 50% { + stroke-dasharray: 89, 200; + stroke-dashoffset: -35; + } + + 100% { + stroke-dasharray: 89, 200; + stroke-dashoffset: -124; + } +} + +@-webkit-keyframes color { + 0% { + stroke: #fff; + } + + 40% { + stroke: #fff; + } + + 66% { + stroke: #fff; + } + + 80%, + 90% { + stroke: #fff; + } +} + +@keyframes color { + 0% { + stroke: #fff; + } + + 40% { + stroke: #fff; + } + + 66% { + stroke: #fff; + } + + 80%, + 90% { + stroke: #fff; + } } \ No newline at end of file diff --git a/html/index.html b/html/index.html index 130cc96..1c38867 100644 --- a/html/index.html +++ b/html/index.html @@ -25,7 +25,26 @@
-
+
+
+ +
EZPPLauncher
+
+
+
+
+ + + +
+
+
Loading... Please wait
+
+
+