U-Timer

Countdown Timer

Countdown Timer

`); } function updateCountdown() { if (!isPaused) { let minutes = Math.floor(remainingTime / 60); let seconds = remainingTime % 60; document.getElementById("countdown").innerText = `${minutes}m ${seconds}s`; if (countdownWindow) { countdownWindow.document.getElementById("countdown").innerText = `${minutes}m ${seconds}s`; } if (remainingTime > 0) { remainingTime--; } else { clearInterval(countdownInterval); document.getElementById("countdown").innerText = "FERTIG!"; if (countdownWindow) { countdownWindow.document.getElementById("countdown").innerText = "FERTIG!"; } document.getElementById("alarmSound").play(); } } } function togglePause() { isPaused = !isPaused; if (!isPaused) { countdownInterval = setInterval(updateCountdown, 1000); // Countdown fortsetzen } else { clearInterval(countdownInterval); // Countdown anhalten } if (countdownWindow) { countdownWindow.document.getElementById("countdown").innerText = document.getElementById("countdown").innerText; } }