Skip to content

Commit

Permalink
Improve easing documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyckahn committed Sep 5, 2017
1 parent 9a05b7b commit 8267b5e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
15 changes: 10 additions & 5 deletions src/easing-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@
*/

/**
* Shifty implements [Robert Penner's easing
* @member shifty.Tweenable.formulas
* @description A static Object of {@link shifty.easingFunction}s that can by
* used by Shifty. The default values are defined in
* [`easing-functions.js`](easing-functions.js.html), but you can add your own
* {@link shifty.easingFunction}s by defining them as keys to this Object.
*
* Shifty ships with an implementation of [Robert Penner's easing
* equations](http://robertpenner.com/easing/), as adapted from
* [Scripty2](https://github.com/madrobby/scripty2/blob/master/src/effects/transitions/penner.js)'s
* implementation. These functions are used internally by Shifty, but they can
* also be accessed externally via {@link shifty.Tweenable.formulas}.
*
* implementation.
* <p data-height="934" data-theme-id="0" data-slug-hash="wqObdO"
* data-default-tab="js,result" data-user="jeremyckahn" data-embed-version="2"
* data-pen-title="Shifty - Easing formula names" class="codepen">See the Pen <a
Expand All @@ -29,7 +33,8 @@
* href="https://codepen.io">CodePen</a>.</p>
* <script async
* src="https://production-assets.codepen.io/assets/embed/ei.js"></script>
* @module shifty.easingFunctions
* @type {Object.<shifty.easingFunction>}
* @static
*/
export const linear = pos => pos;

Expand Down
19 changes: 0 additions & 19 deletions src/tweenable.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,6 @@ export const each = (obj, fn) => {
*/
export const clone = obj => assign({}, obj);

/**
* This object contains all of the tweens available to Shifty. It is
* extensible - simply attach properties to the `Tweenable.formulas`
* Object following the same format as `linear`.
*
* `pos` should be a normalized `number` (between 0 and 1).
* @type {Object(function)}
* @private
*/
const formulas = clone(easingFunctions);

/**
Expand Down Expand Up @@ -477,16 +468,6 @@ export class Tweenable {
}

assign(Tweenable, {
/**
* @member shifty.Tweenable.formulas
* @description A static Object of {@link shifty.easingFunction} that can by
* used by Shifty. The default values are defined in
* [`easing-functions.js`](easing-functions.js.html), but you can add your
* own {@link shifty.easingFunction}s by defining them as keys to this
* Object.
* @type {Object.<shifty.easingFunction>}
* @static
*/
formulas,

filters: { token },
Expand Down

0 comments on commit 8267b5e

Please sign in to comment.