Skip to content

Commit 49e3de8

Browse files
committed
changed the animation of the crown icon
1 parent f428ea4 commit 49e3de8

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

public/js/script.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,18 +424,26 @@ function calculateStats() {
424424
}
425425

426426
function hideCrown() {
427-
$("#result .stats .wpm .crownWrapper").css('width', 0);
427+
$("#result .stats .wpm .crownWrapper").css('opacity', 0);
428428
}
429429

430430
function showCrown() {
431431
$("#result .stats .wpm .crownWrapper").animate({
432-
width: '1.7rem'
433-
}, 250);
432+
opacity: 1
433+
}, 250,"easeOutCubic");
434434
}
435435

436436
function showResult() {
437437
testEnd = Date.now();
438438
let stats = calculateStats();
439+
if(stats === undefined){
440+
stats = {
441+
wpm: 0,
442+
acc: 0,
443+
correctChars: 0,
444+
incorrectChars: 0
445+
}
446+
}
439447
clearIntervals();
440448
$("#result .stats .wpm .bottom").text(stats.wpm);
441449
$("#result .stats .acc .bottom").text(stats.acc + "%");

0 commit comments

Comments
 (0)