From 3b48ce7b5e81d0e8472676fae16b1d7134030253 Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Wed, 5 Mar 2025 15:56:12 -0600 Subject: [PATCH] chg: Simplify how wrong password text is shown --- resources/index.html | 2 +- resources/static/script.js | 6 ++---- resources/static/styles.css | 4 ++++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/resources/index.html b/resources/index.html index 439d9d6..c8b5894 100644 --- a/resources/index.html +++ b/resources/index.html @@ -78,7 +78,7 @@

Please enter password to access this website

- + diff --git a/resources/static/script.js b/resources/static/script.js index 8911aad..7e7d2b6 100644 --- a/resources/static/script.js +++ b/resources/static/script.js @@ -234,12 +234,10 @@ const submitLogin = () => { document.getElementById("container").style.filter = "blur(0px)" document.getElementById("login-dialog").close(); password.value = ''; + document.getElementById("wrong-pass").hidden = true; refreshData(); } else { - const wrongPassBox = document.getElementById("wrong-pass"); - wrongPassBox.innerHTML = "Wrong password!"; - wrongPassBox.style.color = "light-dark(red, #ff1a1a)"; - wrongPassBox.hidden = false; + document.getElementById("wrong-pass").hidden = false; password.focus(); } }) diff --git a/resources/static/styles.css b/resources/static/styles.css index 56d8125..2dd87aa 100644 --- a/resources/static/styles.css +++ b/resources/static/styles.css @@ -139,6 +139,10 @@ div[name="links-div"] { text-align: center; } +#wrong-pass { + color: light-dark(red, #ff1a1a); +} + /* Settings for mobile devices */ @media (pointer:none), (pointer:coarse) {