improve conditional animations

This commit is contained in:
hippoz 2022-08-28 16:02:28 +03:00
parent 9d1d91711e
commit fc8d81753e
No known key found for this signature in database
GPG key ID: 7C52899193467641

View file

@ -13,9 +13,27 @@ export function maybeModalFly(node) {
export function maybeFly(...e) {
if (getItem("ui:doAnimations"))
return fly(...e);
else
return fly(e[0], { duration: 0 });
}
export function maybeFade(...e) {
if (getItem("ui:doAnimations"))
return fade(...e);
else
return fade(e[0], { duration: 0 });
}
export function maybeFlyIf(...e) {
if (getItem("ui:doAnimations") && e[1] && e[1]._condition)
return fly(...e);
else
return fly(e[0], { duration: 0 });
}
export function maybeFadeIf(...e) {
if (getItem("ui:doAnimations") && e[1] && e[1]._condition)
return fade(...e);
else
return fade(e[0], { duration: 0 });
}