File size: 1,563 Bytes
f4d4510 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | document.addEventListener('DOMContentLoaded', function() {
// Password visibility toggle
const togglePassword = document.querySelector('#togglePassword');
const password = document.querySelector('#password');
togglePassword.addEventListener('click', function() {
const icon = this.querySelector('i');
const type = password.getAttribute('type') === 'password' ? 'text' : 'password';
password.setAttribute('type', type);
// Toggle eye icon
if (type === 'password') {
icon.setAttribute('data-feather', 'eye');
} else {
icon.setAttribute('data-feather', 'eye-off');
}
feather.replace();
});
// Form submission
const form = document.querySelector('form');
form.addEventListener('submit', function(e) {
e.preventDefault();
// Simple validation
const email = document.getElementById('email').value;
const password = document.getElementById('password').value;
if (!email || !password) {
alert('Please fill in all fields');
return;
}
// Here you would typically make an API call
console.log('Login attempt with:', { email, password });
// Simulate successful login with branded message
setTimeout(() => {
alert('✨ Welcome to AJ Studioz! ✨\nAccess granted to creative wonderland!');
// window.location.href = '/dashboard'; // Uncomment for real redirect
}, 1000);
});
}); |