Chat & Earn
Connect, chat, and earn rewards today!
Incorrect answer. Try again!
let selectedOption = null; let correctAnswer = null;
// Handle option button clicks optionButtons.forEach(button => { button.addEventListener('click', () => { optionButtons.forEach(btn => btn.classList.remove('selected')); button.classList.add('selected'); selectedOption = button.dataset.url; startButton.disabled = false; }); });
// Handle start chatting button click startButton.addEventListener('click', () => { if (selectedOption) { captchaContainer.style.display = 'block'; startButton.disabled = true; generateCaptcha(); } });
// Generate a simple math captcha function generateCaptcha() { const num1 = Math.floor(Math.random() * 10) + 1; const num2 = Math.floor(Math.random() * 10) + 1; correctAnswer = num1 + num2; captchaQuestion.textContent = `What is ${num1} + ${num2}?`; captchaAnswer.value = ''; captchaError.style.display = 'none'; }
// Verify captcha verifyCaptcha.addEventListener('click', () => { const userAnswer = parseInt(captchaAnswer.value); if (userAnswer === correctAnswer) { window.location.href = selectedOption; } else { captchaError.style.display = 'block'; generateCaptcha(); } });
// Prevent bot clicks let clickCount = 0; const clickThreshold = 5; const clickWindow = 1000; // 1 second
document.addEventListener('click', () => { clickCount++; if (clickCount > clickThreshold) { alert('Too many clicks! Please slow down.'); document.body.style.pointerEvents = 'none'; setTimeout(() => { document.body.style.pointerEvents = 'auto'; clickCount = 0; }, 2000); } setTimeout(() => clickCount = 0, clickWindow); }); });