How to use the shifty.Tweenable.formulas 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 / rekapi.js View on Github external
it('sets up custom curves correctly', () => {
      setBezierFunction('custom', 0, 0.25, 0.5, 0.75);
      rekapi = setupTestRekapi();

      exportedTimeline = rekapi.exportTimeline();

      // Reset for a clean test
      unsetBezierFunction('custom');

      targetRekapi = new Rekapi();
      targetRekapi.importTimeline(exportedTimeline);

      assert.equal(typeof Tweenable.formulas.custom, 'function');
      assert.equal(Tweenable.formulas.custom.x1, 0);
      assert.equal(Tweenable.formulas.custom.y1, 0.25);
      assert.equal(Tweenable.formulas.custom.x2, 0.5);
      assert.equal(Tweenable.formulas.custom.y2, 0.75);

      // Clean up Tweenable
      unsetBezierFunction('custom');
    });
  });
github jeremyckahn / rekapi / test / rekapi.js View on Github external
it('sets up custom curves correctly', () => {
      setBezierFunction('custom', 0, 0.25, 0.5, 0.75);
      rekapi = setupTestRekapi();

      exportedTimeline = rekapi.exportTimeline();

      // Reset for a clean test
      unsetBezierFunction('custom');

      targetRekapi = new Rekapi();
      targetRekapi.importTimeline(exportedTimeline);

      assert.equal(typeof Tweenable.formulas.custom, 'function');
      assert.equal(Tweenable.formulas.custom.x1, 0);
      assert.equal(Tweenable.formulas.custom.y1, 0.25);
      assert.equal(Tweenable.formulas.custom.x2, 0.5);
      assert.equal(Tweenable.formulas.custom.y2, 0.75);

      // Clean up Tweenable
      unsetBezierFunction('custom');
    });
  });
github jeremyckahn / rekapi / test / get-css.js View on Github external
after(() => {
    delete Tweenable.formulas.fakeLinear;
  });
github jeremyckahn / rekapi / test / get-css.js View on Github external
before(() => {
    /**
     * This is used to prevent optimization to make certain functions easier to
     * test.
     */
    Tweenable.formulas.fakeLinear = function (pos) {
      return pos;
    };
  });
github jeremyckahn / rekapi-timeline / src / rekapi-timeline.js View on Github external
updateEasingList () {
    this.setState({
      easingCurves: Object.keys(Tweenable.formulas)
    });
  }

shifty

The fastest JavaScript animation engine on the web

MIT
Latest version published 1 year ago

Package Health Score

64 / 100
Full package analysis