@nil-/xit 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,27 @@
1
+ import { cubicOut as z } from "./easing.js";
2
+ function q(a, { from: r, to: t }, c = {}) {
3
+ var e = getComputedStyle(a), p = C(a), d = e.transform === "none" ? "" : e.transform, [u, l] = e.transformOrigin.split(" ").map(parseFloat), m = r.width / t.width, f = r.height / t.height, i = (r.left + m * u - (t.left + u)) / p, s = (r.top + f * l - (t.top + l)) / p, { delay: y = 0, duration: v = (o) => Math.sqrt(o) * 120, easing: h = z } = c;
4
+ return {
5
+ delay: y,
6
+ duration: typeof v == "function" ? v(Math.sqrt(i * i + s * s)) : v,
7
+ easing: h,
8
+ css: (o, n) => {
9
+ var x = n * i, g = n * s, S = o + n * m, $ = o + n * f;
10
+ return `transform: ${d} scale(${S}, ${$}) translate(${x}px, ${g}px);`;
11
+ }
12
+ };
13
+ }
14
+ function C(a) {
15
+ if ("currentCSSZoom" in a)
16
+ return (
17
+ /** @type {number} */
18
+ a.currentCSSZoom
19
+ );
20
+ for (var r = a, t = 1; r !== null; )
21
+ t *= +getComputedStyle(r).zoom, r = /** @type {Element | null} */
22
+ r.parentElement;
23
+ return t;
24
+ }
25
+ export {
26
+ q as flip
27
+ };
@@ -0,0 +1,130 @@
1
+ function s(n) {
2
+ return n;
3
+ }
4
+ function f(n) {
5
+ const u = 2.5949095;
6
+ return (n *= 2) < 1 ? 0.5 * (n * n * ((u + 1) * n - u)) : 0.5 * ((n -= 2) * n * ((u + 1) * n + u) + 2);
7
+ }
8
+ function h(n) {
9
+ return n * n * ((1.70158 + 1) * n - 1.70158);
10
+ }
11
+ function M(n) {
12
+ return --n * n * ((1.70158 + 1) * n + 1.70158) + 1;
13
+ }
14
+ function c(n) {
15
+ const u = 0.36363636363636365, t = 8 / 11, o = 9 / 10, i = 4356 / 361, e = 35442 / 1805, a = 16061 / 1805, r = n * n;
16
+ return n < u ? 7.5625 * r : n < t ? 9.075 * r - 9.9 * n + 3.4 : n < o ? i * r - e * n + a : 10.8 * n * n - 20.52 * n + 10.72;
17
+ }
18
+ function I(n) {
19
+ return n < 0.5 ? 0.5 * (1 - c(1 - n * 2)) : 0.5 * c(n * 2 - 1) + 0.5;
20
+ }
21
+ function O(n) {
22
+ return 1 - c(1 - n);
23
+ }
24
+ function p(n) {
25
+ return (n *= 2) < 1 ? -0.5 * (Math.sqrt(1 - n * n) - 1) : 0.5 * (Math.sqrt(1 - (n -= 2) * n) + 1);
26
+ }
27
+ function q(n) {
28
+ return 1 - Math.sqrt(1 - n * n);
29
+ }
30
+ function w(n) {
31
+ return Math.sqrt(1 - --n * n);
32
+ }
33
+ function b(n) {
34
+ return n < 0.5 ? 4 * n * n * n : 0.5 * Math.pow(2 * n - 2, 3) + 1;
35
+ }
36
+ function P(n) {
37
+ return n * n * n;
38
+ }
39
+ function l(n) {
40
+ const u = n - 1;
41
+ return u * u * u + 1;
42
+ }
43
+ function x(n) {
44
+ return n < 0.5 ? 0.5 * Math.sin(13 * Math.PI / 2 * 2 * n) * Math.pow(2, 10 * (2 * n - 1)) : 0.5 * Math.sin(-13 * Math.PI / 2 * (2 * n - 1 + 1)) * Math.pow(2, -10 * (2 * n - 1)) + 1;
45
+ }
46
+ function d(n) {
47
+ return Math.sin(13 * n * Math.PI / 2) * Math.pow(2, 10 * (n - 1));
48
+ }
49
+ function k(n) {
50
+ return Math.sin(-13 * (n + 1) * Math.PI / 2) * Math.pow(2, -10 * n) + 1;
51
+ }
52
+ function v(n) {
53
+ return n === 0 || n === 1 ? n : n < 0.5 ? 0.5 * Math.pow(2, 20 * n - 10) : -0.5 * Math.pow(2, 10 - n * 20) + 1;
54
+ }
55
+ function g(n) {
56
+ return n === 0 ? n : Math.pow(2, 10 * (n - 1));
57
+ }
58
+ function j(n) {
59
+ return n === 1 ? n : 1 - Math.pow(2, -10 * n);
60
+ }
61
+ function m(n) {
62
+ return n /= 0.5, n < 1 ? 0.5 * n * n : (n--, -0.5 * (n * (n - 2) - 1));
63
+ }
64
+ function y(n) {
65
+ return n * n;
66
+ }
67
+ function z(n) {
68
+ return -n * (n - 2);
69
+ }
70
+ function A(n) {
71
+ return n < 0.5 ? 8 * Math.pow(n, 4) : -8 * Math.pow(n - 1, 4) + 1;
72
+ }
73
+ function B(n) {
74
+ return Math.pow(n, 4);
75
+ }
76
+ function C(n) {
77
+ return Math.pow(n - 1, 3) * (1 - n) + 1;
78
+ }
79
+ function D(n) {
80
+ return (n *= 2) < 1 ? 0.5 * n * n * n * n * n : 0.5 * ((n -= 2) * n * n * n * n + 2);
81
+ }
82
+ function E(n) {
83
+ return n * n * n * n * n;
84
+ }
85
+ function F(n) {
86
+ return --n * n * n * n * n + 1;
87
+ }
88
+ function G(n) {
89
+ return -0.5 * (Math.cos(Math.PI * n) - 1);
90
+ }
91
+ function H(n) {
92
+ const u = Math.cos(n * Math.PI * 0.5);
93
+ return Math.abs(u) < 1e-14 ? 1 : 1 - u;
94
+ }
95
+ function J(n) {
96
+ return Math.sin(n * Math.PI / 2);
97
+ }
98
+ export {
99
+ h as backIn,
100
+ f as backInOut,
101
+ M as backOut,
102
+ O as bounceIn,
103
+ I as bounceInOut,
104
+ c as bounceOut,
105
+ q as circIn,
106
+ p as circInOut,
107
+ w as circOut,
108
+ P as cubicIn,
109
+ b as cubicInOut,
110
+ l as cubicOut,
111
+ d as elasticIn,
112
+ x as elasticInOut,
113
+ k as elasticOut,
114
+ g as expoIn,
115
+ v as expoInOut,
116
+ j as expoOut,
117
+ s as linear,
118
+ y as quadIn,
119
+ m as quadInOut,
120
+ z as quadOut,
121
+ B as quartIn,
122
+ A as quartInOut,
123
+ C as quartOut,
124
+ E as quintIn,
125
+ D as quintInOut,
126
+ F as quintOut,
127
+ H as sineIn,
128
+ G as sineInOut,
129
+ J as sineOut
130
+ };
@@ -0,0 +1,4 @@
1
+ import { o as a } from "./index.js";
2
+ export {
3
+ a as on
4
+ };