@mkbabb/keyframes.js 2.1.1 → 2.2.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.
@@ -0,0 +1,39 @@
1
+ //#region src/animation/internal/binarySearch.ts
2
+ function e(e, t, n, r) {
3
+ let i = 0, a = e.length - 1;
4
+ for (; i <= a;) {
5
+ let o = i + a >> 1, s = e[o];
6
+ if (t < n(s)) a = o - 1;
7
+ else if (t > r(s)) i = o + 1;
8
+ else return o;
9
+ }
10
+ return -1;
11
+ }
12
+ //#endregion
13
+ //#region src/animation/internal/leaves.ts
14
+ var t = 1e3 / 60;
15
+ function n(e, t, n) {
16
+ return Math.min(Math.max(e, t), n);
17
+ }
18
+ function r(e, t, n, r = 0, i = 1) {
19
+ if (n === t) throw Error("fromMax and fromMin cannot be equal");
20
+ let a = (i - r) / (n - t);
21
+ return (e - t) * a + r;
22
+ }
23
+ function i(e, t, n) {
24
+ return (1 - n) * e + n * t;
25
+ }
26
+ function a(e) {
27
+ if (typeof window < "u" && window.requestAnimationFrame) return window.requestAnimationFrame(e);
28
+ let n = t, r = Date.now();
29
+ return setTimeout(() => {
30
+ let i = Date.now(), a = i - r;
31
+ r = i, n = Math.max(0, t - a), e(i);
32
+ }, n);
33
+ }
34
+ function o(e) {
35
+ if (typeof window < "u" && window.cancelAnimationFrame) return window.cancelAnimationFrame(e);
36
+ clearTimeout(e);
37
+ }
38
+ //#endregion
39
+ export { r as a, a as i, n, e as o, i as r, o as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mkbabb/keyframes.js",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "description": "Create keyframe animations for anything in JavaScript; specify your keyframes in standards-complaint CSS.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -15,6 +15,7 @@
15
15
  "parsing"
16
16
  ],
17
17
  "type": "module",
18
+ "sideEffects": false,
18
19
  "main": "./dist/keyframes.js",
19
20
  "types": "./dist/keyframes.d.ts",
20
21
  "exports": {