waffle/frontend/src/animations.js

22 lines
549 B
JavaScript
Raw Normal View History

2022-05-05 15:33:22 +03:00
import { fade, fly } from "svelte/transition";
import { cubicInOut } from "svelte/easing";
2022-05-05 15:33:22 +03:00
import { getItem } from "./storage";
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) {
if (getItem("ui:doAnimations"))
2022-05-05 15:33:22 +03:00
return fly(...e);
}
export function maybeFade(...e) {
if (getItem("ui:doAnimations"))
2022-05-05 15:33:22 +03:00
return fade(...e);
}