Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ const loginForm = document.getElementById('loginForm');
+ const loginBtn = document.querySelector('.login-btn');
+
+ // Ripple effect
+ loginBtn.addEventListener('click', function(e) {
+ const ripple = document.createElement('div');
+ ripple.classList.add('ripple');
+
+ const rect = this.getBoundingClientRect();
+ const size = Math.max(rect.width, rect.height);
+
+ ripple.style.width = ripple.style.height = `${size}px`;
+ ripple.style.left = `${e.clientX - rect.left - size/2}px`;
+ ripple.style.top = `${e.clientY - rect.top - size/2}px`;
+
+ this.appendChild(ripple);
+
+ setTimeout(() => ripple.remove(), 600);
+ });
+
+ // Form submission
+ loginForm.addEventListener('submit', (e) => {
+ e.preventDefault();
+
+ const email = document.getElementById('email').value;
+ const password = document.getElementById('password').value;
+
+ // Add your login logic here
+ console.log('Login attempt:', { email, password });
+
+ // Animate button
+ loginBtn.classList.add('loading');
+
+ // Simulate API call
+ setTimeout(() => {
+ loginBtn.classList.remove('loading');
+ // Add success/error handling here
+ }, 1500);
+ });
+
+ // Float label animation
+ const inputs = document.querySelectorAll('input');
+ inputs.forEach(input => {
+ input.addEventListener('focus', () => {
+ input.parentElement.classList.add('focused');
+ });
+
+ input.addEventListener('blur', () => {
+ if (!input.value) {
+ input.parentElement.classList.remove('focused');
+ }
+ });
+ });
+ });