How to use the shifty.interpolate function in shifty

To help you get started, we’ve selected a few shifty examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jeremyckahn / rekapi / test / actor.js View on Github external
it('easing is taken from the destination frame', () => {
        let tweenableComparator;

        actor
          .keyframe(0, { x: 0 }, 'linear')
          .keyframe(1000, { x: 100 }, 'easeInSine')
          .keyframe(2000, { x: 200 }, 'easeOutCirc');

        tweenableComparator =
          interpolate({ x: 0 }, { x: 100 }, 0.5, 'easeInSine');

        actor._updateState(500);
        assert.equal(actor.get().x, tweenableComparator.x);

        tweenableComparator =
          interpolate({ x: 100 }, { x: 200 }, 0.5, 'easeOutCirc');

        actor._updateState(1500);
        assert.equal(actor.get().x, tweenableComparator.x);
      });
    });
github jeremyckahn / rekapi / test / actor.js View on Github external
it('easing is taken from the destination frame', () => {
        let tweenableComparator;

        actor
          .keyframe(0, { x: 0 }, 'linear')
          .keyframe(1000, { x: 100 }, 'easeInSine')
          .keyframe(2000, { x: 200 }, 'easeOutCirc');

        tweenableComparator =
          interpolate({ x: 0 }, { x: 100 }, 0.5, 'easeInSine');

        actor._updateState(500);
        assert.equal(actor.get().x, tweenableComparator.x);

        tweenableComparator =
          interpolate({ x: 100 }, { x: 200 }, 0.5, 'easeOutCirc');

        actor._updateState(1500);
        assert.equal(actor.get().x, tweenableComparator.x);
      });
    });
github jeremyckahn / rekapi / test / dom.js View on Github external
rekapi.update(50);

      const transformChunks = actor.get().transform.match(/(\d|\.)+/g);

      assert.equal(
        transformChunks[1],
        interpolate({ x: 0 }, { x: 1 }, 0.5, 'linear').x
      );
      assert.equal(
        transformChunks[2],
        interpolate({ x: 0 }, { x: 1 }, 0.5, 'easeInQuad').x
      );
      assert.equal(
        transformChunks[3],
        interpolate({ x: 0 }, { x: 1 }, 0.5, 'easeOutQuad').x
      );
    });
github web2solutions / dhxMVP / dist_electron / public / lib / thirdparty / progressbar.js View on Github external
Path.prototype._calculateFrom = function _calculateFrom(easing) {
    return Tweenable.interpolate(this._opts.from, this._opts.to, this.value(), easing);
};
github kimmobrunfeldt / progressbar.js / src / path.js View on Github external
Path.prototype._calculateFrom = function _calculateFrom(easing) {
    return shifty.interpolate(this._opts.from, this._opts.to, this.value(), easing);
};
github kerolloz / codecourses / admin_dashboard / vendor / progressbar / progressbar.js View on Github external
Path.prototype._calculateTo = function _calculateTo(progress, easing) {
                return Tweenable.interpolate(this._opts.from, this._opts.to, progress, easing);
            };
github jeremyckahn / rekapi / src / keyframe-property.js View on Github external
const nextProperty = this.nextProperty;

    if (typeof this.value === 'boolean') {
      return this.value;
    } else if (nextProperty) {
      const boundedMillisecond = Math.min(
        Math.max(millisecond, this.millisecond),
        nextProperty.millisecond
      );

      const { name } = this;
      const delta = nextProperty.millisecond - this.millisecond;
      const interpolatePosition =
        (boundedMillisecond - this.millisecond) / delta;

      return interpolate(
        { [name]: this.value },
        { [name]: nextProperty.value },
        interpolatePosition,
        nextProperty.easing
      )[name];
    } else {
      return this.value;
    }
  }
github web2solutions / dhxMVP / dist_electron / public / lib / thirdparty / progressbar.js View on Github external
Path.prototype._calculateTo = function _calculateTo(progress, easing) {
    return Tweenable.interpolate(this._opts.from, this._opts.to, progress, easing);
};
github kimmobrunfeldt / progressbar.js / src / path.js View on Github external
Path.prototype._calculateTo = function _calculateTo(progress, easing) {
    return shifty.interpolate(this._opts.from, this._opts.to, progress, easing);
};
github kimmobrunfeldt / progressbar.js / dist / progressbar.js View on Github external
Path.prototype._calculateTo = function _calculateTo(progress, easing) {
    return shifty.interpolate(this._opts.from, this._opts.to, progress, easing);
};

shifty

The fastest JavaScript animation engine on the web

MIT
Latest version published 1 year ago

Package Health Score

64 / 100
Full package analysis