From a97e65421dbdeba0638c1f7135fef60b26aae11a Mon Sep 17 00:00:00 2001 From: "Z. Cliffe Schreuders" Date: Wed, 2 Jul 2025 16:43:14 +0100 Subject: [PATCH] Implement password modal in index.html: replace direct password prompt with a modal for improved user experience, encapsulating password input logic and enhancing security. The modal includes show/hide password functionality and user-friendly design elements. --- index.html | 81 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 72 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 2c8d6a3..b883426 100644 --- a/index.html +++ b/index.html @@ -3851,15 +3851,16 @@ case 'password': debugLog('PASSWORD REQUESTED', null, 2); - const passwordInput = prompt(`Enter password:`); - if (passwordInput === lockRequirements.requires) { - unlockTarget(lockable, type, lockable.layer); // Pass the layer here - debugLog('PASSWORD SUCCESS', null, 1); - gameAlert(`Correct password! The ${type} is now unlocked.`, 'success', 'Password Accepted', 4000); - } else if (passwordInput !== null) { - debugLog('PASSWORD FAIL', null, 2); - gameAlert("Incorrect password.", 'error', 'Password Rejected', 3000); - } + showPasswordModal(function(passwordInput) { + if (passwordInput === lockRequirements.requires) { + unlockTarget(lockable, type, lockable.layer); // Pass the layer here + debugLog('PASSWORD SUCCESS', null, 1); + gameAlert(`Correct password! The ${type} is now unlocked.`, 'success', 'Password Accepted', 4000); + } else if (passwordInput !== null) { + debugLog('PASSWORD FAIL', null, 2); + gameAlert("Incorrect password.", 'error', 'Password Rejected', 3000); + } + }); break; case 'biometric': @@ -7477,5 +7478,67 @@ }, { passive: false }); }); + + + + \ No newline at end of file