Warn with timer colors near timeout

This commit is contained in:
Wojtek
2026-10-15 19:50:39 +02:00
parent 83e70dd02f
commit 3eabeebf6b
4 changed files with 5 additions and 2 deletions
@@ -127,8 +127,10 @@ document.addEventListener('DOMContentLoaded', function () {
const update = function () {
const minutes = Math.floor(remaining / 60);
const seconds = remaining % 60;
const ratio = remaining / total;
text.textContent = String(minutes).padStart(2, '0') + ':' + String(seconds).padStart(2, '0');
ring.style.strokeDashoffset = circumference * (1 - remaining / total);
ring.style.stroke = ratio <= 0.1 ? '#dc3545' : (ratio <= 0.2 ? '#fd7e14' : '#4a86cf');
if (remaining <= 0 && !submitted) {
submitted = true;