// // Initialize Lottie Animation // document.addEventListener('DOMContentLoaded', function() { // lottie.loadAnimation({ // container: document.getElementById('login_anim'), // renderer: 'svg', // loop: true, // autoplay: true, // path: 'assets/imbpg_img/loginanimationpage.json' // }); // // OTP input auto-focus // const otpInputs = document.querySelectorAll('.otp-input'); // otpInputs.forEach((input, index) => { // input.addEventListener('input', (e) => { // if (e.target.value.length === 1 && index < otpInputs.length - 1) { // otpInputs[index + 1].focus(); // } // }); // input.addEventListener('keydown', (e) => { // if (e.key === 'Backspace' && index > 0 && !e.target.value) { // otpInputs[index - 1].focus(); // } // }); // }); // // OTP timer functionality // let timeLeft = 30; // const timerElement = document.getElementById('timer'); // const resendBtn = document.getElementById('resendOtpBtn'); // const timer = setInterval(() => { // timeLeft--; // timerElement.textContent = timeLeft; // if (timeLeft <= 0) { // clearInterval(timer); // resendBtn.classList.remove('disabled'); // timerElement.style.display = 'none'; // } // }, 1000); // resendBtn.addEventListener('click', function() { // if (!this.classList.contains('disabled')) { // // Add resend OTP logic here // timeLeft = 30; // timerElement.textContent = timeLeft; // timerElement.style.display = 'inline'; // this.classList.add('disabled'); // // Show success message // Swal.fire({ // icon: 'success', // title: 'OTP Resent', // text: 'A new OTP has been sent to your mobile number', // timer: 2000, // showConfirmButton: false // }); // // Restart timer // const newTimer = setInterval(() => { // timeLeft--; // timerElement.textContent = timeLeft; // if (timeLeft <= 0) { // clearInterval(newTimer); // resendBtn.classList.remove('disabled'); // timerElement.style.display = 'none'; // } // }, 1000); // } // }); // });