diff --git a/public/css/login_style.css b/public/css/login_style.css index 9d471b7..0d43f7e 100644 --- a/public/css/login_style.css +++ b/public/css/login_style.css @@ -219,3 +219,23 @@ button:hover { border: 1px solid #f5c6cb; display: none; } + + +.password-container { + position: relative; + width: 100%; + margin-bottom: 15px; +} + +#toggle-password { + position: absolute; + top: 0%; + right: 10px; + transform: translateY(50%); + cursor: pointer; +} + +#toggle-password img { + width: 20px; + height: 20px; +} \ No newline at end of file diff --git a/public/images/eye-closed.png b/public/images/eye-closed.png new file mode 100644 index 0000000..730a13b Binary files /dev/null and b/public/images/eye-closed.png differ diff --git a/public/images/eye-open.png b/public/images/eye-open.png new file mode 100644 index 0000000..48be14c Binary files /dev/null and b/public/images/eye-open.png differ diff --git a/public/login.html b/public/login.html index 963a83b..fa1bcd0 100644 --- a/public/login.html +++ b/public/login.html @@ -44,7 +44,12 @@

(for R - +
+ + + Show/Hide Password + +
Forgot Password?
@@ -77,6 +82,21 @@

(for R return allowedDomains.includes(domain); } + const togglePassword = document.getElementById('toggle-password'); + const passwordInput = document.getElementById('password'); + const eyeIcon = document.getElementById('eye-icon'); + + togglePassword.onclick = function () { + if (passwordInput.type === 'password') { + passwordInput.type = 'text'; + eyeIcon.src = 'images/eye-open.png'; + } else { + passwordInput.type = 'password'; + eyeIcon.src = 'images/eye-closed.png'; + } + } + + async function login() { let email = document.getElementById("email").value; let password = document.getElementById("password").value; diff --git a/public/signup.html b/public/signup.html index 45ab035..d24a997 100644 --- a/public/signup.html +++ b/public/signup.html @@ -76,7 +76,12 @@

(for R Icloud, or Tutanota. - +
+ + + Show/Hide Password + +
  • At least 8 characters long
  • At least 1 uppercase letter (A-Z)
  • @@ -199,6 +204,20 @@

    (for R }); }); + const togglePassword = document.getElementById('toggle-password'); + const passwordInput = document.getElementById('password'); + const eyeIcon = document.getElementById('eye-icon'); + + togglePassword.onclick = function () { + if (passwordInput.type === 'password') { + passwordInput.type = 'text'; + eyeIcon.src = 'images/eye-open.png'; + } else { + passwordInput.type = 'password'; + eyeIcon.src = 'images/eye-closed.png'; + } + } + document.getElementById('registrationForm').addEventListener('submit', async function (event) { event.preventDefault();