assets/scripts.js: Make choice timer bar animation smoother

It's still not smooth due to the ontimeupdate rate limit, but at least
it's less choppy (moves at a consistent speed).
This commit is contained in:
Vladimir Panteleev 2019-07-28 06:03:47 +00:00
parent 39c3144e4c
commit d5b63699fe

View file

@ -196,7 +196,7 @@ function momentStart(m, seeked) {
function momentUpdate(m, ms) {
//console.log('momentUpdate', m);
if (m.choices) {
var p = 100 - Math.floor((ms - m.startMs) * 100 / (m.endMs - m.startMs));
var p = 100 - ((ms - m.startMs) * 100.0 / (m.endMs - m.startMs));
document.getElementById("progress").style.width = p + '%';
}
}