@flighthq/easing 0.1.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/createEasingSamples.d.ts +3 -0
- package/dist/createEasingSamples.d.ts.map +1 -0
- package/dist/createEasingSamples.js +36 -0
- package/dist/createEasingSamples.js.map +1 -0
- package/dist/easeBack.d.ts +5 -0
- package/dist/easeBack.d.ts.map +1 -0
- package/dist/easeBack.js +6 -0
- package/dist/easeBack.js.map +1 -0
- package/dist/easeBounce.d.ts +5 -0
- package/dist/easeBounce.d.ts.map +1 -0
- package/dist/easeBounce.js +13 -0
- package/dist/easeBounce.js.map +1 -0
- package/dist/easeCircular.d.ts +5 -0
- package/dist/easeCircular.d.ts.map +1 -0
- package/dist/easeCircular.js +4 -0
- package/dist/easeCircular.js.map +1 -0
- package/dist/easeCombinators.d.ts +8 -0
- package/dist/easeCombinators.d.ts.map +1 -0
- package/dist/easeCombinators.js +53 -0
- package/dist/easeCombinators.js.map +1 -0
- package/dist/easeCubic.d.ts +5 -0
- package/dist/easeCubic.d.ts.map +1 -0
- package/dist/easeCubic.js +4 -0
- package/dist/easeCubic.js.map +1 -0
- package/dist/easeCubicBezier.d.ts +3 -0
- package/dist/easeCubicBezier.d.ts.map +1 -0
- package/dist/easeCubicBezier.js +68 -0
- package/dist/easeCubicBezier.js.map +1 -0
- package/dist/easeElastic.d.ts +5 -0
- package/dist/easeElastic.d.ts.map +1 -0
- package/dist/easeElastic.js +22 -0
- package/dist/easeElastic.js.map +1 -0
- package/dist/easeExponential.d.ts +5 -0
- package/dist/easeExponential.d.ts.map +1 -0
- package/dist/easeExponential.js +8 -0
- package/dist/easeExponential.js.map +1 -0
- package/dist/easeLinear.d.ts +3 -0
- package/dist/easeLinear.d.ts.map +1 -0
- package/dist/easeLinear.js +2 -0
- package/dist/easeLinear.js.map +1 -0
- package/dist/easePiecewise.d.ts +3 -0
- package/dist/easePiecewise.d.ts.map +1 -0
- package/dist/easePiecewise.js +45 -0
- package/dist/easePiecewise.js.map +1 -0
- package/dist/easePower.d.ts +5 -0
- package/dist/easePower.d.ts.map +1 -0
- package/dist/easePower.js +24 -0
- package/dist/easePower.js.map +1 -0
- package/dist/easeQuadratic.d.ts +5 -0
- package/dist/easeQuadratic.d.ts.map +1 -0
- package/dist/easeQuadratic.js +4 -0
- package/dist/easeQuadratic.js.map +1 -0
- package/dist/easeQuartic.d.ts +5 -0
- package/dist/easeQuartic.d.ts.map +1 -0
- package/dist/easeQuartic.js +4 -0
- package/dist/easeQuartic.js.map +1 -0
- package/dist/easeQuintic.d.ts +5 -0
- package/dist/easeQuintic.d.ts.map +1 -0
- package/dist/easeQuintic.js +4 -0
- package/dist/easeQuintic.js.map +1 -0
- package/dist/easeSine.d.ts +5 -0
- package/dist/easeSine.d.ts.map +1 -0
- package/dist/easeSine.js +4 -0
- package/dist/easeSine.js.map +1 -0
- package/dist/easeSmoothstep.d.ts +5 -0
- package/dist/easeSmoothstep.d.ts.map +1 -0
- package/dist/easeSmoothstep.js +17 -0
- package/dist/easeSmoothstep.js.map +1 -0
- package/dist/easeSteps.d.ts +3 -0
- package/dist/easeSteps.d.ts.map +1 -0
- package/dist/easeSteps.js +27 -0
- package/dist/easeSteps.js.map +1 -0
- package/dist/getEasingDerivative.d.ts +3 -0
- package/dist/getEasingDerivative.d.ts.map +1 -0
- package/dist/getEasingDerivative.js +28 -0
- package/dist/getEasingDerivative.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/package.json +37 -0
- package/src/createEasingSamples.test.ts +51 -0
- package/src/easeBack.test.ts +30 -0
- package/src/easeBounce.test.ts +30 -0
- package/src/easeCircular.test.ts +44 -0
- package/src/easeCombinators.test.ts +119 -0
- package/src/easeCubic.test.ts +34 -0
- package/src/easeCubicBezier.test.ts +47 -0
- package/src/easeElastic.test.ts +30 -0
- package/src/easeExponential.test.ts +34 -0
- package/src/easeLinear.test.ts +17 -0
- package/src/easePiecewise.test.ts +58 -0
- package/src/easePower.test.ts +82 -0
- package/src/easeQuadratic.test.ts +34 -0
- package/src/easeQuartic.test.ts +34 -0
- package/src/easeQuintic.test.ts +34 -0
- package/src/easeSine.test.ts +34 -0
- package/src/easeSmoothstep.test.ts +76 -0
- package/src/easeSteps.test.ts +65 -0
- package/src/getEasingDerivative.test.ts +37 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createEasingSamples.d.ts","sourceRoot":"","sources":["../src/createEasingSamples.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAgBtD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,YAAY,GAAG,YAAY,CAoBzG"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Samples `ease` at `count` uniformly-spaced values of t in [0,1] and writes
|
|
2
|
+
// the results into `out`. When `out` is omitted, a new Float32Array of length
|
|
3
|
+
// `count` is allocated. Returns the output array (always the same object as
|
|
4
|
+
// `out` when one is supplied).
|
|
5
|
+
//
|
|
6
|
+
// The first sample is always ease(0) and the last is always ease(1) when
|
|
7
|
+
// count ≥ 2. For count=1, the single sample is ease(0.5) — the midpoint.
|
|
8
|
+
//
|
|
9
|
+
// Use this to bake a curve to a lookup table for cheap evaluation in tight
|
|
10
|
+
// loops or GPU uploads where calling the full easing function per-frame is
|
|
11
|
+
// undesirable. For conformance comparison, the output is deterministic for the
|
|
12
|
+
// same `count` across environments.
|
|
13
|
+
//
|
|
14
|
+
// Programmer errors (count < 1, non-finite count) throw.
|
|
15
|
+
export function createEasingSamples(ease, count, out) {
|
|
16
|
+
if (!Number.isFinite(count) || count < 1) {
|
|
17
|
+
throw new Error('createEasingSamples: count must be a finite integer >= 1');
|
|
18
|
+
}
|
|
19
|
+
const n = Math.floor(count);
|
|
20
|
+
const result = out ?? new Float32Array(n);
|
|
21
|
+
if (n === 1) {
|
|
22
|
+
result[0] = ease(0.5);
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
const step = 1 / (n - 1);
|
|
26
|
+
for (let i = 0; i < n; i++) {
|
|
27
|
+
// Read t into a local before writing to result, preserving alias safety.
|
|
28
|
+
const t = i * step;
|
|
29
|
+
result[i] = ease(t < 0 ? 0 : t > 1 ? 1 : t);
|
|
30
|
+
}
|
|
31
|
+
// Clamp the endpoints exactly to avoid floating-point drift.
|
|
32
|
+
result[0] = ease(0);
|
|
33
|
+
result[n - 1] = ease(1);
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=createEasingSamples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createEasingSamples.js","sourceRoot":"","sources":["../src/createEasingSamples.ts"],"names":[],"mappings":"AAEA,6EAA6E;AAC7E,8EAA8E;AAC9E,4EAA4E;AAC5E,+BAA+B;AAC/B,EAAE;AACF,yEAAyE;AACzE,yEAAyE;AACzE,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,+EAA+E;AAC/E,oCAAoC;AACpC,EAAE;AACF,yDAAyD;AACzD,MAAM,UAAU,mBAAmB,CAAC,IAAoB,EAAE,KAAa,EAAE,GAAkB;IACzF,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC9E,CAAC;IACD,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC5B,MAAM,MAAM,GAAG,GAAG,IAAI,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;IAC1C,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACZ,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QACtB,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,yEAAyE;QACzE,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QACnB,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;IACD,6DAA6D;IAC7D,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACxB,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeBack.d.ts","sourceRoot":"","sources":["../src/easeBack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,eAAO,MAAM,UAAU,EAAE,cAAiD,CAAC;AAE3E,eAAO,MAAM,aAAa,EAAE,cACyE,CAAC;AAEtG,eAAO,MAAM,WAAW,EAAE,cAA4D,CAAC"}
|
package/dist/easeBack.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const easeInBack = (t) => t * t * ((s + 1) * t - s);
|
|
2
|
+
export const easeInOutBack = (t) => (t *= 2) < 1 ? 0.5 * (t * t * ((s2 + 1) * t - s2)) : 0.5 * ((t -= 2) * t * ((s2 + 1) * t + s2) + 2);
|
|
3
|
+
export const easeOutBack = (t) => (t -= 1) * t * ((s + 1) * t + s) + 1;
|
|
4
|
+
const s = 1.70158;
|
|
5
|
+
const s2 = s * 1.525;
|
|
6
|
+
//# sourceMappingURL=easeBack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeBack.js","sourceRoot":"","sources":["../src/easeBack.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAE3E,MAAM,CAAC,MAAM,aAAa,GAAmB,CAAC,CAAC,EAAE,EAAE,CACjD,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AAEtG,MAAM,CAAC,MAAM,WAAW,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAEvF,MAAM,CAAC,GAAG,OAAO,CAAC;AAClB,MAAM,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeBounce.d.ts","sourceRoot":"","sources":["../src/easeBounce.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,eAAO,MAAM,YAAY,EAAE,cAA4C,CAAC;AAExE,eAAO,MAAM,eAAe,EAAE,cAC6C,CAAC;AAE5E,eAAO,MAAM,aAAa,EAAE,cAAoC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const easeInBounce = (t) => 1 - bounceOut(1 - t);
|
|
2
|
+
export const easeInOutBounce = (t) => t < 0.5 ? (1 - bounceOut(1 - 2 * t)) / 2 : (1 + bounceOut(2 * t - 1)) / 2;
|
|
3
|
+
export const easeOutBounce = (t) => bounceOut(t);
|
|
4
|
+
function bounceOut(t) {
|
|
5
|
+
if (t < 1 / 2.75)
|
|
6
|
+
return 7.5625 * t * t;
|
|
7
|
+
if (t < 2 / 2.75)
|
|
8
|
+
return 7.5625 * (t -= 1.5 / 2.75) * t + 0.75;
|
|
9
|
+
if (t < 2.5 / 2.75)
|
|
10
|
+
return 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375;
|
|
11
|
+
return 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=easeBounce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeBounce.js","sourceRoot":"","sources":["../src/easeBounce.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAExE,MAAM,CAAC,MAAM,eAAe,GAAmB,CAAC,CAAC,EAAE,EAAE,CACnD,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAE5E,MAAM,CAAC,MAAM,aAAa,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAEjE,SAAS,SAAS,CAAC,CAAS;IAC1B,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI;QAAE,OAAO,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;IACxC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI;QAAE,OAAO,MAAM,GAAG,CAAC,CAAC,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IAC/D,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI;QAAE,OAAO,MAAM,GAAG,CAAC,CAAC,IAAI,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;IACpE,OAAO,MAAM,GAAG,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeCircular.d.ts","sourceRoot":"","sources":["../src/easeCircular.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,eAAO,MAAM,cAAc,EAAE,cAAgD,CAAC;AAE9E,eAAO,MAAM,iBAAiB,EAAE,cAC2D,CAAC;AAE5F,eAAO,MAAM,eAAe,EAAE,cAAwD,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const easeInCircular = (t) => 1 - Math.sqrt(1 - t * t);
|
|
2
|
+
export const easeInOutCircular = (t) => t < 0.5 ? (1 - Math.sqrt(1 - 4 * t * t)) / 2 : (Math.sqrt(1 - (-2 * t + 2) ** 2) + 1) / 2;
|
|
3
|
+
export const easeOutCircular = (t) => Math.sqrt(1 - (t - 1) * (t - 1));
|
|
4
|
+
//# sourceMappingURL=easeCircular.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeCircular.js","sourceRoot":"","sources":["../src/easeCircular.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAE9E,MAAM,CAAC,MAAM,iBAAiB,GAAmB,CAAC,CAAC,EAAE,EAAE,CACrD,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAE5F,MAAM,CAAC,MAAM,eAAe,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EasingFunction } from '@flighthq/types';
|
|
2
|
+
export declare function easeClamp(ease: EasingFunction): EasingFunction;
|
|
3
|
+
export declare function easeClampOutput(ease: EasingFunction, min: number, max: number): EasingFunction;
|
|
4
|
+
export declare function easeInvert(ease: EasingFunction): EasingFunction;
|
|
5
|
+
export declare function easeMirror(easeIn: EasingFunction): EasingFunction;
|
|
6
|
+
export declare function easeReverse(easeIn: EasingFunction): EasingFunction;
|
|
7
|
+
export declare function easeScaleOutput(ease: EasingFunction, fromValue: number, toValue: number): EasingFunction;
|
|
8
|
+
//# sourceMappingURL=easeCombinators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeCombinators.d.ts","sourceRoot":"","sources":["../src/easeCombinators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAetD,wBAAgB,SAAS,CAAC,IAAI,EAAE,cAAc,GAAG,cAAc,CAE9D;AAKD,wBAAgB,eAAe,CAAC,IAAI,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,cAAc,CAK9F;AAKD,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,cAAc,CAE/D;AAMD,wBAAgB,UAAU,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAKjE;AAID,wBAAgB,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAElE;AAKD,wBAAgB,eAAe,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAExG"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Easing combinators: each function takes one or more EasingFunctions and
|
|
2
|
+
// returns a new EasingFunction. These allocate a closure — treat them as
|
|
3
|
+
// create*-style calls and cache the result rather than calling inside tight
|
|
4
|
+
// loops. All combinators are alias-safe: they read all inputs before writing.
|
|
5
|
+
// EasingFunction parameters are function values, which are immutable by nature
|
|
6
|
+
// (function references cannot be mutated via the parameter), so Readonly<> is
|
|
7
|
+
// not needed on the callable type itself.
|
|
8
|
+
// Returns a new easing function that clamps `t` to [0,1] before delegating to
|
|
9
|
+
// `ease`. Use this to guard any easing function when the input may be driven
|
|
10
|
+
// from an unclamped source (physics integrator, spring, scroll offset).
|
|
11
|
+
// All other easing combinators and fixed-curve constants assume `t` is
|
|
12
|
+
// pre-clamped — this wrapper is the opt-in clamping layer.
|
|
13
|
+
export function easeClamp(ease) {
|
|
14
|
+
return (t) => ease(t < 0 ? 0 : t > 1 ? 1 : t);
|
|
15
|
+
}
|
|
16
|
+
// Returns a new easing function that clamps the output of `ease` to [min, max].
|
|
17
|
+
// Useful when an overshoot curve (easeInBack, easeOutElastic, etc.) drives a
|
|
18
|
+
// downstream consumer that requires a strict value range.
|
|
19
|
+
export function easeClampOutput(ease, min, max) {
|
|
20
|
+
return (t) => {
|
|
21
|
+
const v = ease(t);
|
|
22
|
+
return v < min ? min : v > max ? max : v;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
// Returns a new easing function that is the vertical mirror of `ease`:
|
|
26
|
+
// `t => 1 - ease(t)`. Maps f(0)=0,f(1)=1 curves to f(0)=1,f(1)=0.
|
|
27
|
+
// Distinct from easeReverse — this flips the output axis, not the input axis.
|
|
28
|
+
export function easeInvert(ease) {
|
|
29
|
+
return (t) => 1 - ease(t);
|
|
30
|
+
}
|
|
31
|
+
// Derives an InOut curve from an In curve using the standard half-and-mirror
|
|
32
|
+
// splice: the first half maps `[0,0.5]` via the In curve, and the second half
|
|
33
|
+
// mirrors that across the diagonal. The resulting curve passes through (0,0),
|
|
34
|
+
// (0.5,0.5), and (1,1).
|
|
35
|
+
export function easeMirror(easeIn) {
|
|
36
|
+
return (t) => {
|
|
37
|
+
if (t < 0.5)
|
|
38
|
+
return easeIn(t * 2) * 0.5;
|
|
39
|
+
return 1 - easeIn((1 - t) * 2) * 0.5;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
// Derives an Out curve from an In curve: `t => 1 - easeIn(1 - t)`. The result
|
|
43
|
+
// has easeIn's slow start mapped to a slow finish and vice-versa.
|
|
44
|
+
export function easeReverse(easeIn) {
|
|
45
|
+
return (t) => 1 - easeIn(1 - t);
|
|
46
|
+
}
|
|
47
|
+
// Remaps the output of `ease` from [0,1] to [fromValue, toValue]. Useful for
|
|
48
|
+
// directly driving a property value without a separate lerp call:
|
|
49
|
+
// `easeScaleOutput(ease, 100, 300)` produces values in [100,300].
|
|
50
|
+
export function easeScaleOutput(ease, fromValue, toValue) {
|
|
51
|
+
return (t) => fromValue + ease(t) * (toValue - fromValue);
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=easeCombinators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeCombinators.js","sourceRoot":"","sources":["../src/easeCombinators.ts"],"names":[],"mappings":"AAEA,0EAA0E;AAC1E,yEAAyE;AACzE,4EAA4E;AAC5E,8EAA8E;AAC9E,+EAA+E;AAC/E,8EAA8E;AAC9E,0CAA0C;AAE1C,8EAA8E;AAC9E,6EAA6E;AAC7E,wEAAwE;AACxE,uEAAuE;AACvE,2DAA2D;AAC3D,MAAM,UAAU,SAAS,CAAC,IAAoB;IAC5C,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC;AAED,gFAAgF;AAChF,6EAA6E;AAC7E,0DAA0D;AAC1D,MAAM,UAAU,eAAe,CAAC,IAAoB,EAAE,GAAW,EAAE,GAAW;IAC5E,OAAO,CAAC,CAAC,EAAE,EAAE;QACX,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC;AACJ,CAAC;AAED,uEAAuE;AACvE,kEAAkE;AAClE,8EAA8E;AAC9E,MAAM,UAAU,UAAU,CAAC,IAAoB;IAC7C,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAC5B,CAAC;AAED,6EAA6E;AAC7E,8EAA8E;AAC9E,8EAA8E;AAC9E,wBAAwB;AACxB,MAAM,UAAU,UAAU,CAAC,MAAsB;IAC/C,OAAO,CAAC,CAAC,EAAE,EAAE;QACX,IAAI,CAAC,GAAG,GAAG;YAAE,OAAO,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;QACxC,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;IACvC,CAAC,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,kEAAkE;AAClE,MAAM,UAAU,WAAW,CAAC,MAAsB;IAChD,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAClC,CAAC;AAED,6EAA6E;AAC7E,kEAAkE;AAClE,kEAAkE;AAClE,MAAM,UAAU,eAAe,CAAC,IAAoB,EAAE,SAAiB,EAAE,OAAe;IACtF,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeCubic.d.ts","sourceRoot":"","sources":["../src/easeCubic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,eAAO,MAAM,WAAW,EAAE,cAAiC,CAAC;AAE5D,eAAO,MAAM,cAAc,EAAE,cAAmF,CAAC;AAEjH,eAAO,MAAM,YAAY,EAAE,cAA8C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeCubic.js","sourceRoot":"","sources":["../src/easeCubic.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAE5D,MAAM,CAAC,MAAM,cAAc,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAEjH,MAAM,CAAC,MAAM,YAAY,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeCubicBezier.d.ts","sourceRoot":"","sources":["../src/easeCubicBezier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAQtD,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,cAAc,CA8D9F"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// Returns an easing function for the CSS cubic-bézier curve whose control
|
|
2
|
+
// points are P1=(x1,y1) and P2=(x2,y2); the endpoints are fixed at (0,0) and
|
|
3
|
+
// (1,1). The returned function maps an input progress `t` (interpreted as the
|
|
4
|
+
// curve's x) to the curve's y. This is the canonical WebKit `UnitBezier`
|
|
5
|
+
// solver: a forward x->y evaluation that first inverts x->parameter via
|
|
6
|
+
// Newton-Raphson, falling back to bisection when the derivative is too small.
|
|
7
|
+
export function easeCubicBezier(x1, y1, x2, y2) {
|
|
8
|
+
// Polynomial coefficients of the bézier in each axis, derived from the
|
|
9
|
+
// control points with the endpoints fixed at 0 and 1.
|
|
10
|
+
const cx = 3 * x1;
|
|
11
|
+
const bx = 3 * (x2 - x1) - cx;
|
|
12
|
+
const ax = 1 - cx - bx;
|
|
13
|
+
const cy = 3 * y1;
|
|
14
|
+
const by = 3 * (y2 - y1) - cy;
|
|
15
|
+
const ay = 1 - cy - by;
|
|
16
|
+
const sampleX = (s) => ((ax * s + bx) * s + cx) * s;
|
|
17
|
+
const sampleY = (s) => ((ay * s + by) * s + cy) * s;
|
|
18
|
+
const sampleDerivativeX = (s) => (3 * ax * s + 2 * bx) * s + cx;
|
|
19
|
+
const solveParameterForX = (x, epsilon) => {
|
|
20
|
+
let s = x;
|
|
21
|
+
// Newton-Raphson: fast when the slope is well-behaved.
|
|
22
|
+
for (let i = 0; i < 8; i++) {
|
|
23
|
+
const xError = sampleX(s) - x;
|
|
24
|
+
if (Math.abs(xError) < epsilon) {
|
|
25
|
+
return s;
|
|
26
|
+
}
|
|
27
|
+
const derivative = sampleDerivativeX(s);
|
|
28
|
+
if (Math.abs(derivative) < 1e-6) {
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
s -= xError / derivative;
|
|
32
|
+
}
|
|
33
|
+
// Bisection fallback over the guaranteed-bracketing [0,1] interval.
|
|
34
|
+
let low = 0;
|
|
35
|
+
let high = 1;
|
|
36
|
+
s = x;
|
|
37
|
+
if (s < low) {
|
|
38
|
+
return low;
|
|
39
|
+
}
|
|
40
|
+
if (s > high) {
|
|
41
|
+
return high;
|
|
42
|
+
}
|
|
43
|
+
while (low < high) {
|
|
44
|
+
const sampled = sampleX(s);
|
|
45
|
+
if (Math.abs(sampled - x) < epsilon) {
|
|
46
|
+
return s;
|
|
47
|
+
}
|
|
48
|
+
if (x > sampled) {
|
|
49
|
+
low = s;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
high = s;
|
|
53
|
+
}
|
|
54
|
+
s = (high - low) * 0.5 + low;
|
|
55
|
+
}
|
|
56
|
+
return s;
|
|
57
|
+
};
|
|
58
|
+
return (t) => {
|
|
59
|
+
if (t <= 0) {
|
|
60
|
+
return 0;
|
|
61
|
+
}
|
|
62
|
+
if (t >= 1) {
|
|
63
|
+
return 1;
|
|
64
|
+
}
|
|
65
|
+
return sampleY(solveParameterForX(t, 1e-7));
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=easeCubicBezier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeCubicBezier.js","sourceRoot":"","sources":["../src/easeCubicBezier.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeElastic.d.ts","sourceRoot":"","sources":["../src/easeElastic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,eAAO,MAAM,aAAa,EAAE,cAG3B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,cAI9B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAG5B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const easeInElastic = (t) => {
|
|
2
|
+
if (t === 0 || t === 1)
|
|
3
|
+
return t;
|
|
4
|
+
return -(Math.pow(2, 10 * (t -= 1)) * Math.sin(((t - s) * (2 * Math.PI)) / p));
|
|
5
|
+
};
|
|
6
|
+
export const easeInOutElastic = (t) => {
|
|
7
|
+
if (t === 0 || t === 1)
|
|
8
|
+
return t;
|
|
9
|
+
if ((t *= 2) < 1)
|
|
10
|
+
return -0.5 * (Math.pow(2, 10 * (t -= 1)) * Math.sin(((t - s2) * (2 * Math.PI)) / p2));
|
|
11
|
+
return 0.5 * Math.pow(2, -10 * (t -= 1)) * Math.sin(((t - s2) * (2 * Math.PI)) / p2) + 1;
|
|
12
|
+
};
|
|
13
|
+
export const easeOutElastic = (t) => {
|
|
14
|
+
if (t === 0 || t === 1)
|
|
15
|
+
return t;
|
|
16
|
+
return Math.pow(2, -10 * t) * Math.sin(((t - s) * (2 * Math.PI)) / p) + 1;
|
|
17
|
+
};
|
|
18
|
+
const p = 0.4;
|
|
19
|
+
const p2 = 0.45;
|
|
20
|
+
const s = (p / (2 * Math.PI)) * Math.asin(1);
|
|
21
|
+
const s2 = (p2 / (2 * Math.PI)) * Math.asin(1);
|
|
22
|
+
//# sourceMappingURL=easeElastic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeElastic.js","sourceRoot":"","sources":["../src/easeElastic.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAmB,CAAC,CAAC,EAAE,EAAE;IACjD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IACjC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACjF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAmB,CAAC,CAAC,EAAE,EAAE;IACpD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IACjC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC;QAAE,OAAO,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACzG,OAAO,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;AAC3F,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAmB,CAAC,CAAC,EAAE,EAAE;IAClD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IACjC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAC5E,CAAC,CAAC;AAEF,MAAM,CAAC,GAAG,GAAG,CAAC;AACd,MAAM,EAAE,GAAG,IAAI,CAAC;AAChB,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC7C,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EasingFunction } from '@flighthq/types';
|
|
2
|
+
export declare const easeInExponential: EasingFunction;
|
|
3
|
+
export declare const easeInOutExponential: EasingFunction;
|
|
4
|
+
export declare const easeOutExponential: EasingFunction;
|
|
5
|
+
//# sourceMappingURL=easeExponential.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeExponential.d.ts","sourceRoot":"","sources":["../src/easeExponential.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,eAAO,MAAM,iBAAiB,EAAE,cAAgE,CAAC;AAEjG,eAAO,MAAM,oBAAoB,EAAE,cAGlC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,cAAgE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const easeInExponential = (t) => (t === 0 ? 0 : Math.pow(2, 10 * t - 10));
|
|
2
|
+
export const easeInOutExponential = (t) => {
|
|
3
|
+
if (t === 0 || t === 1)
|
|
4
|
+
return t;
|
|
5
|
+
return t < 0.5 ? Math.pow(2, 20 * t - 10) / 2 : (2 - Math.pow(2, -20 * t + 10)) / 2;
|
|
6
|
+
};
|
|
7
|
+
export const easeOutExponential = (t) => (t === 1 ? 1 : 1 - Math.pow(2, -10 * t));
|
|
8
|
+
//# sourceMappingURL=easeExponential.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeExponential.js","sourceRoot":"","sources":["../src/easeExponential.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,iBAAiB,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAEjG,MAAM,CAAC,MAAM,oBAAoB,GAAmB,CAAC,CAAC,EAAE,EAAE;IACxD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IACjC,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;AACtF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeLinear.d.ts","sourceRoot":"","sources":["../src/easeLinear.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,eAAO,MAAM,UAAU,EAAE,cAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeLinear.js","sourceRoot":"","sources":["../src/easeLinear.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easePiecewise.d.ts","sourceRoot":"","sources":["../src/easePiecewise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAYrE,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,cAAc,CAoCxG"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Returns an easing function that splices multiple EasingFunctions across the
|
|
2
|
+
// [0,1] input range. Each segment is allocated a proportional slice of the
|
|
3
|
+
// input domain based on its `weight` (default 1). Weights are relative — they
|
|
4
|
+
// do not need to sum to any particular value; the function normalizes them.
|
|
5
|
+
//
|
|
6
|
+
// Example: `easePiecewise([{ ease: easeInCubic }, { ease: easeLinear, weight: 2 }])`
|
|
7
|
+
// gives the first segment 1/3 of the input range and the second segment 2/3.
|
|
8
|
+
//
|
|
9
|
+
// An empty or weight-zero segments array is a programmer error and throws.
|
|
10
|
+
// Allocates a closure and an internal segment table; cache the result.
|
|
11
|
+
export function easePiecewise(segments) {
|
|
12
|
+
if (segments.length === 0) {
|
|
13
|
+
throw new Error('easePiecewise: segments array must not be empty');
|
|
14
|
+
}
|
|
15
|
+
// Resolve weights and compute cumulative breakpoints.
|
|
16
|
+
const totalWeight = segments.reduce((sum, seg) => sum + (seg.weight ?? 1), 0);
|
|
17
|
+
if (totalWeight <= 0) {
|
|
18
|
+
throw new Error('easePiecewise: total segment weight must be greater than zero');
|
|
19
|
+
}
|
|
20
|
+
// Precompute per-segment [start, end] breakpoints in [0,1] space.
|
|
21
|
+
const breakpoints = [];
|
|
22
|
+
let accumulated = 0;
|
|
23
|
+
for (const seg of segments) {
|
|
24
|
+
const weight = seg.weight ?? 1;
|
|
25
|
+
const start = accumulated / totalWeight;
|
|
26
|
+
accumulated += weight;
|
|
27
|
+
const end = accumulated / totalWeight;
|
|
28
|
+
breakpoints.push({ ease: seg.ease, end, start });
|
|
29
|
+
}
|
|
30
|
+
return (t) => {
|
|
31
|
+
// Walk breakpoints to find the active segment.
|
|
32
|
+
for (let i = 0; i < breakpoints.length; i++) {
|
|
33
|
+
const bp = breakpoints[i];
|
|
34
|
+
if (t <= bp.end || i === breakpoints.length - 1) {
|
|
35
|
+
// Remap t into the local [0,1] range of this segment.
|
|
36
|
+
const span = bp.end - bp.start;
|
|
37
|
+
const localT = span > 0 ? (t - bp.start) / span : 1;
|
|
38
|
+
const clampedT = localT < 0 ? 0 : localT > 1 ? 1 : localT;
|
|
39
|
+
return bp.ease(clampedT);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return segments[segments.length - 1].ease(1);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=easePiecewise.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easePiecewise.js","sourceRoot":"","sources":["../src/easePiecewise.ts"],"names":[],"mappings":"AAEA,8EAA8E;AAC9E,2EAA2E;AAC3E,8EAA8E;AAC9E,4EAA4E;AAC5E,EAAE;AACF,qFAAqF;AACrF,6EAA6E;AAC7E,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,MAAM,UAAU,aAAa,CAAC,QAA0D;IACtF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;IAED,sDAAsD;IACtD,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9E,IAAI,WAAW,IAAI,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;IACnF,CAAC;IAED,kEAAkE;IAClE,MAAM,WAAW,GAA2D,EAAE,CAAC;IAC/E,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;QAC/B,MAAM,KAAK,GAAG,WAAW,GAAG,WAAW,CAAC;QACxC,WAAW,IAAI,MAAM,CAAC;QACtB,MAAM,GAAG,GAAG,WAAW,GAAG,WAAW,CAAC;QACtC,WAAW,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,CAAC,CAAC,EAAE,EAAE;QACX,+CAA+C;QAC/C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC5C,MAAM,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAChD,sDAAsD;gBACtD,MAAM,IAAI,GAAG,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC;gBAC/B,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;gBACpD,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;gBAC1D,OAAO,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC;QACD,OAAO,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EasingFunction } from '@flighthq/types';
|
|
2
|
+
export declare function easeInOutPower(exponent: number): EasingFunction;
|
|
3
|
+
export declare function easeInPower(exponent: number): EasingFunction;
|
|
4
|
+
export declare function easeOutPower(exponent: number): EasingFunction;
|
|
5
|
+
//# sourceMappingURL=easePower.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easePower.d.ts","sourceRoot":"","sources":["../src/easePower.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAKtD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAK/D;AAMD,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAE5D;AAKD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAE7D"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Returns an InOut-Power easing function for an arbitrary exponent.
|
|
2
|
+
// The inflection point is always at (0.5, 0.5) — symmetric by construction.
|
|
3
|
+
// Allocates a closure; cache the result.
|
|
4
|
+
export function easeInOutPower(exponent) {
|
|
5
|
+
return (t) => {
|
|
6
|
+
if (t < 0.5)
|
|
7
|
+
return Math.pow(t * 2, exponent) * 0.5;
|
|
8
|
+
return 1 - Math.pow((1 - t) * 2, exponent) * 0.5;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
// Returns an In-Power easing function for an arbitrary exponent. This
|
|
12
|
+
// generalizes easeInQuadratic (exponent=2) through easeInQuintic (exponent=5)
|
|
13
|
+
// to any fractional or non-integer power, including sub-linear curves (0<exp<1).
|
|
14
|
+
// Allocates a closure; cache the result.
|
|
15
|
+
export function easeInPower(exponent) {
|
|
16
|
+
return (t) => Math.pow(t, exponent);
|
|
17
|
+
}
|
|
18
|
+
// Returns an Out-Power easing function for an arbitrary exponent. Derived from
|
|
19
|
+
// easeInPower via the standard `1 - easeIn(1 - t)` reversal.
|
|
20
|
+
// Allocates a closure; cache the result.
|
|
21
|
+
export function easeOutPower(exponent) {
|
|
22
|
+
return (t) => 1 - Math.pow(1 - t, exponent);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=easePower.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easePower.js","sourceRoot":"","sources":["../src/easePower.ts"],"names":[],"mappings":"AAEA,oEAAoE;AACpE,4EAA4E;AAC5E,yCAAyC;AACzC,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,OAAO,CAAC,CAAC,EAAE,EAAE;QACX,IAAI,CAAC,GAAG,GAAG;YAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,GAAG,GAAG,CAAC;QACpD,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,GAAG,GAAG,CAAC;IACnD,CAAC,CAAC;AACJ,CAAC;AAED,sEAAsE;AACtE,8EAA8E;AAC9E,iFAAiF;AACjF,yCAAyC;AACzC,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;AACtC,CAAC;AAED,+EAA+E;AAC/E,6DAA6D;AAC7D,yCAAyC;AACzC,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EasingFunction } from '@flighthq/types';
|
|
2
|
+
export declare const easeInOutQuadratic: EasingFunction;
|
|
3
|
+
export declare const easeInQuadratic: EasingFunction;
|
|
4
|
+
export declare const easeOutQuadratic: EasingFunction;
|
|
5
|
+
//# sourceMappingURL=easeQuadratic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeQuadratic.d.ts","sourceRoot":"","sources":["../src/easeQuadratic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,eAAO,MAAM,kBAAkB,EAAE,cAA+E,CAAC;AAEjH,eAAO,MAAM,eAAe,EAAE,cAA6B,CAAC;AAE5D,eAAO,MAAM,gBAAgB,EAAE,cAAmC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeQuadratic.js","sourceRoot":"","sources":["../src/easeQuadratic.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAEjH,MAAM,CAAC,MAAM,eAAe,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;AAE5D,MAAM,CAAC,MAAM,gBAAgB,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeQuartic.d.ts","sourceRoot":"","sources":["../src/easeQuartic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,eAAO,MAAM,gBAAgB,EAAE,cAAuF,CAAC;AAEvH,eAAO,MAAM,aAAa,EAAE,cAAqC,CAAC;AAElE,eAAO,MAAM,cAAc,EAAE,cAA8C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeQuartic.js","sourceRoot":"","sources":["../src/easeQuartic.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAEvH,MAAM,CAAC,MAAM,aAAa,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAElE,MAAM,CAAC,MAAM,cAAc,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeQuintic.d.ts","sourceRoot":"","sources":["../src/easeQuintic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,eAAO,MAAM,gBAAgB,EAAE,cACqC,CAAC;AAErE,eAAO,MAAM,aAAa,EAAE,cAAyC,CAAC;AAEtE,eAAO,MAAM,cAAc,EAAE,cAA8C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeQuintic.js","sourceRoot":"","sources":["../src/easeQuintic.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAmB,CAAC,CAAC,EAAE,EAAE,CACpD,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;AAErE,MAAM,CAAC,MAAM,aAAa,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEtE,MAAM,CAAC,MAAM,cAAc,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeSine.d.ts","sourceRoot":"","sources":["../src/easeSine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,eAAO,MAAM,aAAa,EAAE,cAAwD,CAAC;AAErF,eAAO,MAAM,UAAU,EAAE,cAAuD,CAAC;AAEjF,eAAO,MAAM,WAAW,EAAE,cAAmD,CAAC"}
|
package/dist/easeSine.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeSine.js","sourceRoot":"","sources":["../src/easeSine.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAErF,MAAM,CAAC,MAAM,UAAU,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AAEjF,MAAM,CAAC,MAAM,WAAW,GAAmB,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EasingFunction, ScalarRemap } from '@flighthq/types';
|
|
2
|
+
export declare const easeSmootherstep: EasingFunction;
|
|
3
|
+
export declare const easeSmoothstep: EasingFunction;
|
|
4
|
+
export declare function easeSmoothstepRange(edge0: number, edge1: number): ScalarRemap;
|
|
5
|
+
//# sourceMappingURL=easeSmoothstep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easeSmoothstep.d.ts","sourceRoot":"","sources":["../src/easeSmoothstep.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAKnE,eAAO,MAAM,gBAAgB,EAAE,cAA2D,CAAC;AAG3F,eAAO,MAAM,cAAc,EAAE,cAA2C,CAAC;AAMzE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,CAK7E"}
|