mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-19 20:16:04 +08:00
fading out banner before removing
This commit is contained in:
parent
5169f20ece
commit
41f5edeb31
1 changed files with 12 additions and 7 deletions
|
@ -202,13 +202,18 @@ class Notification {
|
|||
}
|
||||
);
|
||||
} else if (this.type === "banner") {
|
||||
$(`#bannerCenter .banner[id='${this.id}']`).remove();
|
||||
const height = $("#bannerCenter").height() as number;
|
||||
$("#centerContent").css(
|
||||
"padding-top",
|
||||
height + Misc.convertRemToPixels(2) + "px"
|
||||
);
|
||||
$("#notificationCenter").css("margin-top", height + "px");
|
||||
$(`#bannerCenter .banner[id='${this.id}']`)
|
||||
.css("opacity", 1)
|
||||
.animate(
|
||||
{
|
||||
opacity: 0,
|
||||
},
|
||||
125,
|
||||
() => {
|
||||
$(`#bannerCenter .banner[id='${this.id}']`).remove();
|
||||
updateMargin();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue