From d5b63699fed7873d06b781f73f6011466898628b Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Sun, 28 Jul 2019 06:03:47 +0000 Subject: [PATCH] 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). --- assets/scripts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/scripts.js b/assets/scripts.js index 3110b06..8a8e751 100644 --- a/assets/scripts.js +++ b/assets/scripts.js @@ -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 + '%'; } }