const btn = document.getElementById('btn'); const progress = document.getElementById('progress'); let holdTimer = null; let holdTime = 0; const requiredTime = 3; const interval = 50; const redirectUrl = 'https://befjajh.cpofers.com/s/42cf1c2250951'; const startHold = () => { holdTime = 0; progress.style.width = '0'; holdTimer = setInterval(() => { holdTime += interval / 1000; const percent = Math.min((holdTime / requiredTime) * 100, 100); progress.style.width = percent + '%'; if (holdTime >= requiredTime) { clearInterval(holdTimer); window.location.href = redirectUrl; } }, interval); }; const stopHold = () => { clearInterval(holdTimer); if (holdTime < requiredTime) { progress.style.width = '0'; } }; btn.addEventListener('mousedown', startHold); btn.addEventListener('touchstart', startHold, { passive: true }); document.addEventListener('mouseup', stopHold); document.addEventListener('touchend', stopHold); document.addEventListener('touchcancel', stopHold); function toggleWhy() { const content = document.getElementById('whyContent'); content.style.display = content.style.display === 'block' ? 'none' : 'block'; }