@tarsis/toolkit 0.4.7 → 0.5.0
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.
- package/dist/fonts/GT-Flexa-VF-Trial.woff2 +0 -0
- package/dist/fonts/GT-Maru-Light-Oblique-Trial.woff2 +0 -0
- package/dist/fonts/GT-Maru-Light-Trial.woff2 +0 -0
- package/dist/fonts/GT-Maru-Medium-Oblique-Trial.woff2 +0 -0
- package/dist/fonts/GT-Maru-Medium-Trial.woff2 +0 -0
- package/dist/fonts/GT-Maru-Mono-Black-Oblique-Trial.woff2 +0 -0
- package/dist/fonts/GT-Maru-Mono-Black-Trial.woff2 +0 -0
- package/dist/fonts/GT-Maru-Mono-Bold-Oblique-Trial.woff2 +0 -0
- package/dist/fonts/GT-Maru-Mono-Bold-Trial.woff2 +0 -0
- package/dist/fonts/GT-Maru-Mono-Light-Oblique-Trial.woff2 +0 -0
- package/dist/fonts/GT-Maru-Mono-Light-Trial.woff2 +0 -0
- package/dist/fonts/GT-Maru-Mono-Medium-Oblique-Trial.woff2 +0 -0
- package/dist/fonts/GT-Maru-Mono-Medium-Trial.woff2 +0 -0
- package/dist/fonts/gt/maru/GT-Maru-Light-Oblique-Trial.woff2 +0 -0
- package/dist/fonts/gt/maru/GT-Maru-Light-Trial.woff2 +0 -0
- package/dist/fonts/gt/maru/GT-Maru-Medium-Oblique-Trial.woff2 +0 -0
- package/dist/fonts/gt/maru/GT-Maru-Medium-Trial.woff2 +0 -0
- package/dist/fonts/gt/maru/GT-Maru-Mono-Black-Oblique-Trial.woff2 +0 -0
- package/dist/fonts/gt/maru/GT-Maru-Mono-Black-Trial.woff2 +0 -0
- package/dist/fonts/gt/maru/GT-Maru-Mono-Bold-Oblique-Trial.woff2 +0 -0
- package/dist/fonts/gt/maru/GT-Maru-Mono-Bold-Trial.woff2 +0 -0
- package/dist/fonts/gt/maru/GT-Maru-Mono-Light-Oblique-Trial.woff2 +0 -0
- package/dist/fonts/gt/maru/GT-Maru-Mono-Light-Trial.woff2 +0 -0
- package/dist/fonts/gt/maru/GT-Maru-Mono-Medium-Oblique-Trial.woff2 +0 -0
- package/dist/fonts/gt/maru/GT-Maru-Mono-Medium-Trial.woff2 +0 -0
- package/dist/fonts/gt/maru/gt-maru-black-oblique.woff2 +0 -0
- package/dist/fonts/gt/maru/gt-maru-black.woff2 +0 -0
- package/dist/fonts/gt/maru/gt-maru-bold-oblique.woff2 +0 -0
- package/dist/fonts/gt/maru/gt-maru-bold.woff2 +0 -0
- package/dist/fonts/gt/maru/gt-maru-mega-l.woff2 +0 -0
- package/dist/fonts/gt/maru/gt-maru-mega-m.woff2 +0 -0
- package/dist/fonts/gt/maru/gt-maru-mega-s.woff2 +0 -0
- package/dist/fonts/gt/maru/gt-maru-mono-regular-oblique.woff2 +0 -0
- package/dist/fonts/gt/maru/gt-maru-mono-regular.woff2 +0 -0
- package/dist/fonts/gt/maru/gt-maru-regular-oblique.woff2 +0 -0
- package/dist/fonts/gt/maru/gt-maru-regular.woff2 +0 -0
- package/dist/fonts/gt-flexa/GT-Flexa-VF-Trial.woff2 +0 -0
- package/dist/fonts/gt-maru-black-oblique.woff2 +0 -0
- package/dist/fonts/gt-maru-black.woff2 +0 -0
- package/dist/fonts/gt-maru-bold-oblique.woff2 +0 -0
- package/dist/fonts/gt-maru-bold.woff2 +0 -0
- package/dist/fonts/gt-maru-mega-l.woff2 +0 -0
- package/dist/fonts/gt-maru-mega-m.woff2 +0 -0
- package/dist/fonts/gt-maru-mega-s.woff2 +0 -0
- package/dist/fonts/gt-maru-mono-regular-oblique.woff2 +0 -0
- package/dist/fonts/gt-maru-mono-regular.woff2 +0 -0
- package/dist/fonts/gt-maru-regular-oblique.woff2 +0 -0
- package/dist/fonts/gt-maru-regular.woff2 +0 -0
- package/dist/fonts/maru/GT-Maru-Light-Oblique-Trial.woff2 +0 -0
- package/dist/fonts/maru/GT-Maru-Light-Trial.woff2 +0 -0
- package/dist/fonts/maru/GT-Maru-Medium-Oblique-Trial.woff2 +0 -0
- package/dist/fonts/maru/GT-Maru-Medium-Trial.woff2 +0 -0
- package/dist/fonts/maru/GT-Maru-Mono-Black-Oblique-Trial.woff2 +0 -0
- package/dist/fonts/maru/GT-Maru-Mono-Black-Trial.woff2 +0 -0
- package/dist/fonts/maru/GT-Maru-Mono-Bold-Oblique-Trial.woff2 +0 -0
- package/dist/fonts/maru/GT-Maru-Mono-Bold-Trial.woff2 +0 -0
- package/dist/fonts/maru/GT-Maru-Mono-Light-Oblique-Trial.woff2 +0 -0
- package/dist/fonts/maru/GT-Maru-Mono-Light-Trial.woff2 +0 -0
- package/dist/fonts/maru/GT-Maru-Mono-Medium-Oblique-Trial.woff2 +0 -0
- package/dist/fonts/maru/GT-Maru-Mono-Medium-Trial.woff2 +0 -0
- package/dist/fonts/maru/gt-maru-black-oblique.woff2 +0 -0
- package/dist/fonts/maru/gt-maru-black.woff2 +0 -0
- package/dist/fonts/maru/gt-maru-bold-oblique.woff2 +0 -0
- package/dist/fonts/maru/gt-maru-bold.woff2 +0 -0
- package/dist/fonts/maru/gt-maru-mega-l.woff2 +0 -0
- package/dist/fonts/maru/gt-maru-mega-m.woff2 +0 -0
- package/dist/fonts/maru/gt-maru-mega-s.woff2 +0 -0
- package/dist/fonts/maru/gt-maru-mono-regular-oblique.woff2 +0 -0
- package/dist/fonts/maru/gt-maru-mono-regular.woff2 +0 -0
- package/dist/fonts/maru/gt-maru-regular-oblique.woff2 +0 -0
- package/dist/fonts/maru/gt-maru-regular.woff2 +0 -0
- package/dist/gl-BlKJDzVL.cjs +3262 -0
- package/dist/gl-DA94DTyS.js +3258 -0
- package/dist/hooks.cjs +24 -0
- package/dist/hooks.d.ts +190 -0
- package/dist/hooks.js +1 -0
- package/dist/index-B9O5nl2I.js +113847 -0
- package/dist/index-B_kRoqUz.cjs +3912 -0
- package/dist/index-BlpASwt4.js +3910 -0
- package/dist/index-DrShaNFt.cjs +114199 -0
- package/dist/index.cjs +343 -30505
- package/dist/index.d.ts +470 -354
- package/dist/index.js +4 -30159
- package/dist/server.cjs +0 -3
- package/dist/server.d.ts +0 -2
- package/dist/server.js +1 -3
- package/dist/styles.css +1082 -768
- package/dist/svg-6fNe-PW5.cjs +68 -0
- package/dist/svg-C0Ykxk94.js +60 -0
- package/dist/useWindowReady-CESjx5iD.cjs +9275 -0
- package/dist/useWindowReady-CIGrizO6.js +9185 -0
- package/dist/utils.cjs +39 -0
- package/dist/utils.d.ts +90 -0
- package/dist/utils.js +2 -0
- package/package.json +79 -76
- package/dist/gl-BytuN41l.cjs +0 -380
- package/dist/gl-D_Ly48gx.js +0 -357
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
const React = require('react');
|
|
5
|
+
|
|
6
|
+
const chain = (...elements) => {
|
|
7
|
+
return elements.map((element, index) => /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
|
|
8
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: element }),
|
|
9
|
+
index !== elements.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("span", { children: " • " })
|
|
10
|
+
] }, index));
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
function distance(x1, x2, y1, y2) {
|
|
14
|
+
const a = x1 - x2;
|
|
15
|
+
const b = y1 - y2;
|
|
16
|
+
return Math.hypot(a, b);
|
|
17
|
+
}
|
|
18
|
+
function lineEq(y2, y1, x2, x1, currentVal) {
|
|
19
|
+
const m = (y2 - y1) / (x2 - x1);
|
|
20
|
+
const b = y1 - m * x1;
|
|
21
|
+
return m * currentVal + b;
|
|
22
|
+
}
|
|
23
|
+
function lerp(a, b, n) {
|
|
24
|
+
return (1 - n) * a + n * b;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function delay(ms) {
|
|
28
|
+
return new Promise((resolve) => {
|
|
29
|
+
setTimeout(() => {
|
|
30
|
+
resolve(void 0);
|
|
31
|
+
}, ms);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
35
|
+
|
|
36
|
+
function getPath(x, smoothing) {
|
|
37
|
+
const points = [
|
|
38
|
+
[2, 2],
|
|
39
|
+
[12 - x, 12 + x],
|
|
40
|
+
[22, 22]
|
|
41
|
+
];
|
|
42
|
+
const calculateControlPoint = (current, previous, next, reverse) => {
|
|
43
|
+
const p = previous || current;
|
|
44
|
+
const n = next || current;
|
|
45
|
+
const o = {
|
|
46
|
+
length: Math.sqrt(Math.pow(n[0] - p[0], 2) + Math.pow(n[1] - p[1], 2)),
|
|
47
|
+
angle: Math.atan2(n[1] - p[1], n[0] - p[0])
|
|
48
|
+
};
|
|
49
|
+
const angle = o.angle + (0);
|
|
50
|
+
const length = o.length * smoothing;
|
|
51
|
+
return [
|
|
52
|
+
current[0] + Math.cos(angle) * length,
|
|
53
|
+
current[1] + Math.sin(angle) * length
|
|
54
|
+
];
|
|
55
|
+
};
|
|
56
|
+
return points.reduce(
|
|
57
|
+
(acc, point, i, a) => i === 0 ? `M ${point[0]},${point[1]}` : `${acc} ${calculateControlPoint(a[i - 1], a[i - 2], point)}`,
|
|
58
|
+
""
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
exports.chain = chain;
|
|
63
|
+
exports.delay = delay;
|
|
64
|
+
exports.distance = distance;
|
|
65
|
+
exports.getPath = getPath;
|
|
66
|
+
exports.lerp = lerp;
|
|
67
|
+
exports.lineEq = lineEq;
|
|
68
|
+
exports.wait = wait;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Fragment } from 'react';
|
|
3
|
+
|
|
4
|
+
const chain = (...elements) => {
|
|
5
|
+
return elements.map((element, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6
|
+
/* @__PURE__ */ jsx("span", { children: element }),
|
|
7
|
+
index !== elements.length - 1 && /* @__PURE__ */ jsx("span", { children: " • " })
|
|
8
|
+
] }, index));
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
function distance(x1, x2, y1, y2) {
|
|
12
|
+
const a = x1 - x2;
|
|
13
|
+
const b = y1 - y2;
|
|
14
|
+
return Math.hypot(a, b);
|
|
15
|
+
}
|
|
16
|
+
function lineEq(y2, y1, x2, x1, currentVal) {
|
|
17
|
+
const m = (y2 - y1) / (x2 - x1);
|
|
18
|
+
const b = y1 - m * x1;
|
|
19
|
+
return m * currentVal + b;
|
|
20
|
+
}
|
|
21
|
+
function lerp(a, b, n) {
|
|
22
|
+
return (1 - n) * a + n * b;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function delay(ms) {
|
|
26
|
+
return new Promise((resolve) => {
|
|
27
|
+
setTimeout(() => {
|
|
28
|
+
resolve(void 0);
|
|
29
|
+
}, ms);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
33
|
+
|
|
34
|
+
function getPath(x, smoothing) {
|
|
35
|
+
const points = [
|
|
36
|
+
[2, 2],
|
|
37
|
+
[12 - x, 12 + x],
|
|
38
|
+
[22, 22]
|
|
39
|
+
];
|
|
40
|
+
const calculateControlPoint = (current, previous, next, reverse) => {
|
|
41
|
+
const p = previous || current;
|
|
42
|
+
const n = next || current;
|
|
43
|
+
const o = {
|
|
44
|
+
length: Math.sqrt(Math.pow(n[0] - p[0], 2) + Math.pow(n[1] - p[1], 2)),
|
|
45
|
+
angle: Math.atan2(n[1] - p[1], n[0] - p[0])
|
|
46
|
+
};
|
|
47
|
+
const angle = o.angle + (0);
|
|
48
|
+
const length = o.length * smoothing;
|
|
49
|
+
return [
|
|
50
|
+
current[0] + Math.cos(angle) * length,
|
|
51
|
+
current[1] + Math.sin(angle) * length
|
|
52
|
+
];
|
|
53
|
+
};
|
|
54
|
+
return points.reduce(
|
|
55
|
+
(acc, point, i, a) => i === 0 ? `M ${point[0]},${point[1]}` : `${acc} ${calculateControlPoint(a[i - 1], a[i - 2], point)}`,
|
|
56
|
+
""
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { lerp as a, delay as b, chain as c, distance as d, getPath as g, lineEq as l, wait as w };
|