import { fade, fly, scale } from "svelte/transition"; import { cubicInOut } from "svelte/easing"; import { getItem } from "./storage"; export function maybeModalFade(node) { return maybeFade(node, { duration: 175, easing: cubicInOut }); } export function maybeModalScale(node) { return maybeScale(node, { duration: 175, easing: cubicInOut, start: 0.93 }); } export function maybeScale(...e) { if (getItem("ui:doAnimations")) return scale(...e); else return scale(e[0], { duration: 0 }); } 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 }); }