Function crossfade

Returns a 'crossfader` function of two easing functions, synchronised with the progress through the easing.

Example amt values:

  • 0.0 will yield 100% of easingA at its easing(0) value.
  • 0.2 will yield 80% of easingA, 20% of easingB, both at their easing(0.2) values
  • 0.5 will yield 50% of both functions both at their easing(0.5) values
  • 0.8 will yield 20% of easingA, 80% of easingB, with both at their easing(0.8) values
  • 1.0 will yield 100% of easingB at its easing(1) value.

So easingB will only ever kick in at higher amt values and easingA will only be present in lower values.

import { Easings } from "https://unpkg.com/ixfx/dist/modulation.js";
Easings.crossFade(0.5, Easings.Named.sineIn, Easings.Named.sineOut);