Clamp progress bar to 100%
This commit is contained in:
parent
e03e48d08f
commit
b81227265c
1 changed files with 1 additions and 1 deletions
|
@ -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 a new issue