Warn with timer colors near timeout
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user