26 lines
1016 B
JavaScript
26 lines
1016 B
JavaScript
// Authentication-related JavaScript functionality
|
|
|
|
// Password visibility toggle handler
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// Add click handlers to all password toggle buttons
|
|
document.querySelectorAll('.show-password-btn').forEach(button => {
|
|
button.addEventListener('click', function() {
|
|
const targetId = this.getAttribute('data-target');
|
|
const targetInput = document.getElementById(targetId);
|
|
const icon = this.querySelector('i');
|
|
|
|
if (targetInput && icon) {
|
|
if (targetInput.type === 'password') {
|
|
targetInput.type = 'text';
|
|
icon.classList.remove('bi-eye');
|
|
icon.classList.add('bi-eye-slash');
|
|
} else {
|
|
targetInput.type = 'password';
|
|
icon.classList.remove('bi-eye-slash');
|
|
icon.classList.add('bi-eye');
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|