Sorteios profissionais para as suas redes sociais
"${winner.text}"
`; modal.classList.remove('hidden'); // Confetes const duration = 3 * 1000; const end = Date.now() + duration; (function frame() { confetti({ particleCount: 3, angle: 60, spread: 55, origin: { x: 0 }, colors: ['#fcc419', '#ffffff', '#1a2332'] }); confetti({ particleCount: 3, angle: 120, spread: 55, origin: { x: 1 }, colors: ['#fcc419', '#ffffff', '#1a2332'] }); if (Date.now() < end) { requestAnimationFrame(frame); } }()); } /** * NOVA FUNÇÃO DE RESET: * Em vez de recarregar a página, resetamos o estado do DOM. */ function resetApp() { // Esconder o modal document.getElementById('winner-modal').classList.add('hidden'); // Voltar para o ecrã inicial document.getElementById('setup-panel').classList.remove('hidden'); document.getElementById('raffle-panel').classList.add('hidden'); // Limpar input document.getElementById('post-link').value = ''; // Resetar botão de carregamento const btnLoad = document.getElementById('btn-load'); btnLoad.disabled = false; document.getElementById('btn-text').innerText = "CARREGAR COMENTÁRIOS"; document.getElementById('loading-spinner').classList.add('hidden'); // Resetar barra de progresso document.getElementById('progress-container').classList.add('hidden'); document.getElementById('progress-bar').style.width = '0%'; document.getElementById('progress-percent').innerText = '0%'; // Resetar botão de sorteio const btnRaffle = document.getElementById('btn-raffle'); btnRaffle.disabled = false; btnRaffle.classList.remove('opacity-50', 'cursor-not-allowed'); // Resetar a roleta visualmente sem animação const reel = document.getElementById('reel'); reel.style.transition = 'none'; reel.style.transform = 'translateY(0)'; // Forçar o navegador a processar a mudança de posição antes de reativar a transição void reel.offsetHeight; reel.style.transition = 'transform 5s cubic-bezier(0.15, 0, 0.15, 1)'; // Parar qualquer intervalo que esteja a correr if (loadingInterval) clearInterval(loadingInterval); }