diff --git a/themes/dracula/css/style.css b/themes/dracula/css/style.css index 99acd2e..43551a4 100644 --- a/themes/dracula/css/style.css +++ b/themes/dracula/css/style.css @@ -186,6 +186,10 @@ input:focus-visible { border: 0; outline: auto var(--fg0); } +input::-ms-reveal, +input::-ms-clear { + display: none; +} :focus { outline: auto var(--fg0) !important; } @@ -202,6 +206,23 @@ input:focus-visible { box-sizing: border-box; margin: 0; } +#input { + position: relative; +} +#input #pass-eye { + position: absolute; + right: 15px; + top: 0; + bottom: 0; + margin-top: auto; + margin-bottom: auto; + height: fit-content; + background-color: var(--bg2); +} +#input #pass-eye:hover, +#input #pass-eye:focus { + background-color: var(--bg3); +} #input-username { box-sizing: border-box; diff --git a/themes/dracula/index.html b/themes/dracula/index.html index 0bf306e..3deb9ae 100644 --- a/themes/dracula/index.html +++ b/themes/dracula/index.html @@ -65,14 +65,19 @@

20-05-2021

- +
+ + +
diff --git a/themes/dracula/js/authenticate.js b/themes/dracula/js/authenticate.js index f71b329..9758574 100644 --- a/themes/dracula/js/authenticate.js +++ b/themes/dracula/js/authenticate.js @@ -1,6 +1,9 @@ class Authenticate { constructor() { this._form = document.querySelector("#login-form"); + this._inputUser = document.querySelector("#input-username"); + this._inputPass = document.querySelector("#input-password"); + this._input_eye = document.querySelector("#pass-eye"); this._username = ""; this._password = ""; this._init(); @@ -17,14 +20,21 @@ class Authenticate { this._respond(); }); } + _setPasswordEye() { + this._input_eye.addEventListener("click", () => { + if (this._inputPass.type === "password") { + this._inputPass.type = "text"; + } else { + this._inputPass.type = "password"; + } + }); + } async _respond() { - let inputUser = document.querySelector("#input-username"); - let inputPass = document.querySelector("#input-password"); - inputUser.blur(); - inputUser.disabled = true; - inputPass.blur(); - inputPass.disabled = true; + this._inputUser.blur(); + this._inputUser.disabled = true; + this._inputPass.blur(); + this._inputPass.disabled = true; lightdm.cancel_authentication(); lightdm.authenticate(String(this._username)); @@ -89,13 +99,11 @@ class Authenticate { topbar.classList.remove("hide"); bottombar.classList.remove("hide"); - let inputUser = document.querySelector("#input-username"); - let inputPass = document.querySelector("#input-password"); - inputUser.blur(); - inputUser.disabled = false; - inputPass.blur(); - inputPass.disabled = false; - inputPass.value = ""; + this._inputUser.blur(); + this._inputUser.disabled = false; + this._inputPass.blur(); + this._inputPass.disabled = false; + this._inputPass.value = ""; body.classList.remove("failed"); } @@ -113,5 +121,6 @@ class Authenticate { _init() { this._setForm(); this._setAuthentication_done(); + this._setPasswordEye(); } } diff --git a/themes/gruvbox/css/style.css b/themes/gruvbox/css/style.css index abc2612..3bb1a70 100644 --- a/themes/gruvbox/css/style.css +++ b/themes/gruvbox/css/style.css @@ -195,6 +195,27 @@ input:focus-visible { border: 0; outline: auto var(--fg); } +#input { + position: relative; +} +#input #pass-eye { + position: absolute; + right: 15px; + top: 0; + bottom: 0; + margin-top: auto; + margin-bottom: auto; + height: fit-content; + background-color: var(--bg1); +} +#input #pass-eye:hover, +#input #pass-eye:focus { + background-color: var(--bg2); +} +input::-ms-reveal, +input::-ms-clear { + display: none; +} :focus { outline: auto var(--fg) !important; diff --git a/themes/gruvbox/index.html b/themes/gruvbox/index.html index 404ba32..74ff739 100644 --- a/themes/gruvbox/index.html +++ b/themes/gruvbox/index.html @@ -48,6 +48,9 @@ autofocus="true" placeholder="Enter your password" /> +