3 ms·
The easing functions on the demo page are from https://www.npmjs.com/package/eases https://www.npmjs.com/package/eases - ramjet will take any easing function (i
by rich_harris 11y ago
The easing functions on the demo page are from https://www.npmjs.com/package/eases https://www.npmjs.com/package/eases - ramjet will take any easing function (it should accept a value between 0 and 1, and return similar). For convenience, ramjet.linear, ramjet.easeIn, ramjet.easeOut and ramjet.easeInOut are included, but for best results I'd recommend combining it with an external easing library like eases.
- fredliu 11y agoSo does it mean it can be used with things like Rebound.js (http://facebook.github.io/rebound-js/examples/ http://facebook.github.io/rebound-js/examples/) to provide spring like animation?
- rich_harris 11y agoSpring physics might be a bit challenging, because it involves updating a physical model on a timer loop until the system reaches equilibrium, whereas an easing function crudely approximates a physical system with a very simple formula. Having said that, the rebound.js example page mentions 'pre-recording' the animation, so in theory it ought to be possible to use that as the basis of a timing function. Definitely an area worth investigating.