Skip to content

Commit 8070ccb

Browse files
committed
- fix transition to be truly linear
1 parent 8367494 commit 8070ccb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

games/human_benchmark/js/number_memory.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,18 @@ $(function () {
6363

6464
// Start the progress bar animation
6565
$progressBar.width('100%');
66-
$progressBar.animate({width: '0%'}, duration, 'linear');
66+
$progressBar.css({
67+
'transition': `width ${duration}ms linear`,
68+
'width': '0%'
69+
});
6770
timer = setTimeout(() => {
6871
$("#number-area").empty();
6972
$("#answer-input").show().focus();
7073
$("#submit-answer").show();
74+
$progressBar.css({
75+
'transition': `none`,
76+
'width': '100%'
77+
});
7178
}, duration);
7279
}, 1000);
7380
}

0 commit comments

Comments
 (0)