2022-05-05 15:33:22 +03:00
|
|
|
import { fade, fly } from "svelte/transition";
|
2022-08-04 21:31:02 +03:00
|
|
|
import { cubicInOut } from "svelte/easing";
|
2022-05-05 15:33:22 +03:00
|
|
|
import { getItem } from "./storage";
|
|
|
|
|
2022-08-04 21:31:02 +03:00
|
|
|
export function maybeModalFade(node) {
|
|
|
|
return maybeFade(node, { duration: 160, easing: cubicInOut });
|
|
|
|
}
|
|
|
|
|
|
|
|
export function maybeModalFly(node) {
|
|
|
|
return maybeFly(node, { duration: 210, easing: cubicInOut, y: 15 });
|
|
|
|
}
|
|
|
|
|
2022-05-05 15:33:22 +03:00
|
|
|
export function maybeFly(...e) {
|
2022-08-04 02:00:55 +03:00
|
|
|
if (getItem("ui:doAnimations"))
|
2022-05-05 15:33:22 +03:00
|
|
|
return fly(...e);
|
|
|
|
}
|
|
|
|
|
|
|
|
export function maybeFade(...e) {
|
2022-08-04 02:00:55 +03:00
|
|
|
if (getItem("ui:doAnimations"))
|
2022-05-05 15:33:22 +03:00
|
|
|
return fade(...e);
|
|
|
|
}
|