mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-29 10:17:30 +08:00
chore: stronger easing method type, add default easing method
This commit is contained in:
parent
3e1c8f2f56
commit
2b4c3d2efe
2 changed files with 36 additions and 2 deletions
|
|
@ -404,7 +404,7 @@ async function animateXpBar(
|
|||
|
||||
let firstOneDone = false;
|
||||
let animationDuration = quickSpeed;
|
||||
let animationEasing = "linear";
|
||||
let animationEasing: Misc.JQueryEasing = "linear";
|
||||
let decrement = 1 - (startingLevel % 1);
|
||||
|
||||
do {
|
||||
|
|
|
|||
|
|
@ -449,11 +449,45 @@ export function isAnyPopupVisible(): boolean {
|
|||
return popupVisible;
|
||||
}
|
||||
|
||||
export type JQueryEasing =
|
||||
| "linear"
|
||||
| "swing"
|
||||
| "easeInSine"
|
||||
| "easeOutSine"
|
||||
| "easeInOutSine"
|
||||
| "easeInQuad"
|
||||
| "easeOutQuad"
|
||||
| "easeInOutQuad"
|
||||
| "easeInCubic"
|
||||
| "easeOutCubic"
|
||||
| "easeInOutCubic"
|
||||
| "easeInQuart"
|
||||
| "easeOutQuart"
|
||||
| "easeInOutQuart"
|
||||
| "easeInQuint"
|
||||
| "easeOutQuint"
|
||||
| "easeInOutQuint"
|
||||
| "easeInExpo"
|
||||
| "easeOutExpo"
|
||||
| "easeInOutExpo"
|
||||
| "easeInCirc"
|
||||
| "easeOutCirc"
|
||||
| "easeInOutCirc"
|
||||
| "easeInBack"
|
||||
| "easeOutBack"
|
||||
| "easeInOutBack"
|
||||
| "easeInElastic"
|
||||
| "easeOutElastic"
|
||||
| "easeInOutElastic"
|
||||
| "easeInBounce"
|
||||
| "easeOutBounce"
|
||||
| "easeInOutBounce";
|
||||
|
||||
export async function promiseAnimation(
|
||||
el: JQuery,
|
||||
animation: Record<string, string>,
|
||||
duration: number,
|
||||
easing: string
|
||||
easing: JQueryEasing = "swing"
|
||||
): Promise<void> {
|
||||
return new Promise((resolve) => {
|
||||
el.animate(animation, applyReducedMotion(duration), easing, resolve);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue