Easing Coordinates
Utility to turn steps and cubic-bezier single-transition-timing-functions into an array of "low-poly" xy-coordinates.
Usage
/* =>[ { x: 0, y: 0 }, { x: 0.136, y: 0.028 }, { x: 0.248, y: 0.104 }, { x: 0.342, y: 0.216 }, { x: 0.424, y: 0.352 }, { x: 0.5, y: 0.5 }, { x: 0.576, y: 0.648 }, { x: 0.658, y: 0.784 }, { x: 0.752, y: 0.896 }, { x: 0.864, y: 0.972 }, { x: 1, y: 1 },]*/ /* =>[ { x: 0, y: 0 }, { x: 0.25, y: 0 }, { x: 0.25, y: 0.25 }, { x: 0.5, y: 0.25 }, { x: 0.5, y: 0.5 }, { x: 0.75, y: 0.5 }, { x: 0.75, y: 0.75 }, { x: 1, y: 0.75 },]*/
Use stepsCoordinates
and cubicCoordinates
methods directly depending on your
data:
=== ===
Increase polySteps (default = 10, min = 2) to get a "higer-poly" version of your cubic-bezier functions.
Build
(See package.json for more scripts)
# Checkout and then npm install # Compile and watch the .ts files npm run watch # Run test npm run test