From f8c75c0adc37409081f7257d145d34a7de885c08 Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Sat, 30 Apr 2022 01:58:58 -0700 Subject: [PATCH] translation section for update notification --- languages/en.json | 4 +++- resources/js/helpers.js | 4 ++-- resources/js/translation.js | 3 +++ resources/style/index.css | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/languages/en.json b/languages/en.json index c0d8cf7..a7ecafe 100644 --- a/languages/en.json +++ b/languages/en.json @@ -61,5 +61,7 @@ "alertUserTaken": "Username is taken", "alertPassMismatch": "Password and password confirmation do not match", "alertAuthNoRegister": "Authentication is disabled, no need to register!", - "alertRegisterSuccess": "Registration successful!" + "alertRegisterSuccess": "Registration successful!", + + "updateNotifText": "A new update is available! Newest version: " } diff --git a/resources/js/helpers.js b/resources/js/helpers.js index f4b9139..c0b31c0 100644 --- a/resources/js/helpers.js +++ b/resources/js/helpers.js @@ -66,12 +66,12 @@ async function checkForUpdates() { return latest } -async function displayUpdate(version) { +async function displayUpdate() { const latest = await checkForUpdates() const versionDisplay = document.querySelector('#newestVersion') const notif = document.querySelector('#downloadNotif') - //if (latest === `v${NL_APPVERSION}`) return + if (latest === `v${NL_APPVERSION}`) return versionDisplay.innerText = latest diff --git a/resources/js/translation.js b/resources/js/translation.js index 3fab70b..986b03c 100644 --- a/resources/js/translation.js +++ b/resources/js/translation.js @@ -89,4 +89,7 @@ async function doTranslation() { set('loginPopupContentBodyBtnLogin', 'authLoginBtn') set('loginPopupContentBodyBtnRegister', 'authRegisterBtn') set('noLoginBtn', 'launchWithoutAuth') + + // update notification + set('updateNotifText', 'updateNotifText') } \ No newline at end of file diff --git a/resources/style/index.css b/resources/style/index.css index ba41cd8..24e8e7c 100644 --- a/resources/style/index.css +++ b/resources/style/index.css @@ -551,13 +551,13 @@ a { padding: 1em; top: 80%; - left: 110%; + left: 120%; width: 20%; border-radius: 5px; text-align: center; - transition: left 0.4s ease-in-out; + transition: left 0.5s ease-in-out; } #downloadNotif:hover {