Clamp progress bar to 100%
This commit is contained in:
parent
e03e48d08f
commit
b81227265c
|
@ -75,7 +75,7 @@
|
||||||
|
|
||||||
progressInterval = window.setInterval(() => {
|
progressInterval = window.setInterval(() => {
|
||||||
elapsed += 1.0;
|
elapsed += 1.0;
|
||||||
let progress = elapsed / duration;
|
let progress = Math.min(elapsed / duration, 1.0);
|
||||||
progressBar.style.width = `${progress * 100}%`;
|
progressBar.style.width = `${progress * 100}%`;
|
||||||
}, 1000);
|
}, 1000);
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in New Issue