mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-08 14:42:46 +08:00
made the crown animation even smoother
This commit is contained in:
parent
866d87c6cb
commit
fc6957ee3d
1 changed files with 4 additions and 2 deletions
|
@ -430,7 +430,7 @@ function hideCrown() {
|
|||
}
|
||||
|
||||
function showCrown() {
|
||||
$("#result .stats .wpm .crownWrapper").animate({
|
||||
$("#result .stats .wpm .crownWrapper").delay(275).animate({
|
||||
opacity: 1
|
||||
}, 250,"easeOutCubic");
|
||||
}
|
||||
|
@ -456,7 +456,7 @@ function showResult() {
|
|||
} else if (config.mode == "words") {
|
||||
mode2 = config.words;
|
||||
}
|
||||
hideCrown();
|
||||
|
||||
let completedEvent = {
|
||||
wpm: stats.wpm,
|
||||
correctChars: stats.correctChars,
|
||||
|
@ -476,6 +476,7 @@ function showResult() {
|
|||
db_getUserHighestWpm(config.mode, mode2, config.punctuation, config.language).then(data => {
|
||||
// console.log(`highest wpm for this mode is ${data}, current is ${stats.wpm}`);
|
||||
if (data < stats.wpm) {
|
||||
hideCrown();
|
||||
showCrown();
|
||||
}
|
||||
completedEvent.uid = firebase.auth().currentUser.uid;
|
||||
|
@ -574,6 +575,7 @@ function restartTest() {
|
|||
$("#words").css('opacity', 0).removeClass('hidden').stop(true, true).animate({
|
||||
opacity: 1
|
||||
}, 125, () => {
|
||||
hideCrown();
|
||||
clearIntervals();
|
||||
$("#restartTestButton").css('opacity', 1);
|
||||
if ($("#commandLineWrapper").hasClass('hidden')) focusWords();
|
||||
|
|
Loading…
Add table
Reference in a new issue