Skip to content

Commit 0ccd712

Browse files
committed
add hide/show option to the password input
1 parent b447de2 commit 0ccd712

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

web/dashboard/settings.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
<meta name="description" content="OpenFi Settings Page">
88
<link rel="stylesheet" type="text/css" href="../styles/main-default.css">
99
<link rel="stylesheet" type="text/css" href="../styles/pages/settings.css">
10+
11+
<!-- Google Fonts -->
12+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&icon_names=mystery" />
1013
</head>
1114

1215
<body>
@@ -52,7 +55,7 @@ <h2>Account</h2>
5255
<button onclick="window.top.location.href = '../login.html'" type="button" class="btn logout-btn">Log Out</button>
5356
</div>
5457
<div class="option">
55-
<p>Change Password</p> <span id="show-password">👁️</span> <br>
58+
<p>Change Password</p> <span class="material-symbols-outlined clickable" id="show-password">mystery</span> <br>
5659
<input type="password" id="new-passwd" placeholder="new password">
5760
<button onclick="changeValueSHA(0, 'new-passwd', 'password')" type="button" class="btn">Change</button>
5861
</div>

web/scripts/pages/settings.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ async function populate(user_id) {
1212
console.log(account[user_id].email)
1313
}
1414

15+
document.getElementById('show-password').addEventListener('click', () => {
16+
const element = document.getElementById('new-passwd')
17+
element.type = element.type === 'password' ? 'text' : 'password'
18+
})
1519

1620
// Funcion usada para cambiar contraseña
1721
function changePasswordSHA(user_id, element, db_value) {

web/styles/main-default.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ tbody tr:hover {
196196
}
197197
/* more at devices.css and login.css */
198198

199+
.clickable {
200+
cursor: pointer;
201+
}
199202

200203
/* CARDS */
201204
.cards {

0 commit comments

Comments
 (0)