diff --git a/.gitignore b/.gitignore index 2fa56e4..9fdade7 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ /coverage # production -/dist +#/dist # misc .DS_Store diff --git a/dist/easings.js b/dist/easings.js new file mode 100644 index 0000000..36f67e1 --- /dev/null +++ b/dist/easings.js @@ -0,0 +1,72 @@ +const r = { + quart: (t, e) => n( + [0.895, 0.03, 0.685, 0.22], + [0.165, 0.84, 0.44, 1], + [0.77, 0, 0.175, 1], + t, + e + ), + circ: (t, e) => n( + [0.6, 0.04, 0.98, 0.335], + [0.075, 0.82, 0.165, 1], + [0.785, 0.135, 0.15, 0.86], + t, + e + ), + quint: (t, e) => n( + [0.755, 0.05, 0.855, 0.06], + [0.23, 1, 0.32, 1], + [0.86, 0, 0.07, 1], + t, + e + ), + sine: (t, e) => n( + [0.47, 0, 0.745, 0.715], + [0.39, 0.575, 0.565, 1], + [0.445, 0.05, 0.55, 0.95], + t, + e + ), + expo: (t, e) => n( + [0.95, 0.05, 0.795, 0.035], + [0.19, 1, 0.22, 1], + [1, 0, 0, 1], + t, + e + ), + cubic: (t, e) => n( + [0.55, 0.055, 0.675, 0.19], + [0.215, 0.61, 0.355, 1], + [0.645, 0.045, 0.355, 1], + t, + e + ) +}, a = { + type: "tween", + duration: 0.7 +}, n = (t, e, u, c, o) => { + const s = c ? { duration: c } : {}, i = o ? { delay: o } : {}; + return { + in: { + ...a, + ease: t, + ...s, + ...i + }, + out: { + ...a, + ease: e, + ...s, + ...i + }, + inOut: { + ...a, + ease: u, + ...s, + ...i + } + }; +}; +export { + r as default +}; diff --git a/dist/easings/easings.d.ts b/dist/easings/easings.d.ts new file mode 100644 index 0000000..11c2653 --- /dev/null +++ b/dist/easings/easings.d.ts @@ -0,0 +1,10 @@ +type EasingCollection = { + out: any; + in: any; + inOut: any; +}; +type EasingFunction = (duration: number, delay?: number) => EasingCollection; +declare const Easings: { + [key: string]: EasingFunction; +}; +export default Easings; diff --git a/dist/unom-style.d.ts b/dist/unom-style.d.ts new file mode 100644 index 0000000..c14391a --- /dev/null +++ b/dist/unom-style.d.ts @@ -0,0 +1,7 @@ +import ease from "./easings/easings"; +export { +/** + * @public + * Util function to create framer-motion transitions based on penner's functions + */ +ease }; diff --git a/dist/unom-style.js b/dist/unom-style.js new file mode 100644 index 0000000..8d2e2a7 --- /dev/null +++ b/dist/unom-style.js @@ -0,0 +1,4 @@ +import { default as f } from "./easings.js"; +export { + f as ease +};