Skip to content

Commit

Permalink
docs: add Animation docs
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Feb 24, 2018
1 parent d4a9218 commit a1bf8bf
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const MyComponent = mock();
- [Animation](./docs/en/Animation.md)
- [`<AfterTimeout>`](./docs/en/AfterTimeout.md), [`<AfterDraf>`](./docs/en/AfterDraf.md), and [`<WhenIdle>`](./docs/en/WhenIdle.md)
- [`<Render>`](./docs/en/Render.md), [`withRender()`](./docs/en/Render.md#withrender-hoc), and [`@withRender`](./docs/en/Render.md#withrender-decorator)
- [`<RenderInterval>`](./docs/en/RenderInverval.md), [`withRenderInterval()`](./docs/en/RenderInverval.md#withrenderinterval-hoc), and [`@withRenderInterval`](./docs/en/RenderInverval.md#withrenderinterval-decorator)
- [`<RenderInterval>`](./docs/en/RenderInterval.md), [`withRenderInterval()`](./docs/en/RenderInterval.md#withrenderinterval-hoc), and [`@withRenderInterval`](./docs/en/RenderInterval.md#withrenderinterval-decorator)
- [`<Tween>`](./docs/en/Tween.md), [`withTween()`](./docs/en/Tween.md#withtween-hoc), and [`@withTween`](./docs/en/Tween.md#withtween-decorator)
- [`<Interpolation>`](./docs/en/Interpolation.md), [`withInterpolation()`](./docs/en/Interpolation.md#withinterpolation-hoc), and [`@withInterpolation`](./docs/en/Interpolation.md#withinterpolation-decorator)
- [Side Effects](./docs/en/Side-effects.md)
Expand Down
11 changes: 11 additions & 0 deletions docs/en/Animation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Animation

Below primitives are available to do basic animation in JavaScript.

- [`<AfterTimeout>`](./AfterTimeout.md) &mdash; renders children after a timeout.
- [`<AfterDraf>`](./AfterDraf.md) &mdash; renders children after double `requestAnimationFrame`.
- [`<WhenIdle>`](./WhenIdle.md) &mdash; renders children on browser idle time.
- [`<Render>`](./Render.md) &mdash; re-renders children on every `requestAnimationFrame`.
- [`<RenderInterval>`](./RenderInterval.md) &mdash; re-renders children at a specified frame rate per second.
- [`<Tween>`](./Tween.md) &mdash; applies an easing function to animation duration value from `<Render>`.
- [`<Interpolation>`](./Interpolation.md) &mdash; interpolates a map of values using a `<Tween>`.
9 changes: 8 additions & 1 deletion docs/en/Interpolation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ a value in `[0...1]` range it interpolates a map of values you define.

## Usage

Below code animates movement of 100x100px square.
Below code animates movement of a 100x100px square.

```jsx
import {Interpolation} from 'libreact/lib/Interpolation';
Expand All @@ -29,6 +29,13 @@ import {Interpolation} from 'libreact/lib/Interpolation';
```


## Props

Accepts all the [`<Tween>`](./Tween.md) props in addiont to:

- `map` &mdash; required, map of `[start, end]` values to interpolate.


## `withInterpolation()` HOC

Injects an `interpolation` prop into your component.
Expand Down
2 changes: 1 addition & 1 deletion docs/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
- [Animation](./Animation.md)
- [`<AfterTimeout>`](./AfterTimeout.md), [`<AfterDraf>`](./AfterDraf.md), and [`<WhenIdle>`](./WhenIdle.md)
- [`<Render>`](./Render.md), [`withRender()`](./Render.md#withrender-hoc), and [`@withRender`](./Render.md#withrender-decorator)
- [`<RenderInterval>`](./RenderInverval.md), [`withRenderInterval()`](./RenderInverval.md#withrenderinterval-hoc), and [`@withRenderInterval`](./RenderInverval.md#withrenderinterval-decorator)
- [`<RenderInterval>`](./RenderInterval.md), [`withRenderInterval()`](./RenderInterval.md#withrenderinterval-hoc), and [`@withRenderInterval`](./RenderInterval.md#withrenderinterval-decorator)
- [`<Tween>`](./Tween.md), [`withTween()`](./Tween.md#withtween-hoc), and [`@withTween`](./Tween.md#withtween-decorator)
- [`<Interpolation>`](./Interpolation.md), [`withInterpolation()`](./Interpolation.md#withinterpolation-hoc), and [`@withInterpolation`](./Interpolation.md#withinterpolation-decorator)
- [Side Effects](./Side-effects.md)
Expand Down
16 changes: 8 additions & 8 deletions docs/en/Tween.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@ You can use one of the built-in easing functions simply specifying its name as a
- `quadratic` &mdash; accelerates fast, then slows quickly towards end.
- `cubic` &mdash; overshoots over 1 and then returns to 1 towards end.
- `elastic` &mdash; overshoots over 1 multiple times - wiggles around 1.
- `circ` &mdsah; Commonly known as `outCirc`. Moves very fast at the beginning and
- `circ` &mdash; Commonly known as `outCirc`. Moves very fast at the beginning and
then quickly slows down in the middle. This tween can actually be used
in continuous transitions where target value changes all the time,
because of the very quick start, it hides the jitter between target value changes.
- `inQuad` &mdash; accelerating from zero velocity
- `outQuad` &mdash; decelerating to zero velocity.
- `inOutQuad` &mdash; acceleration until halfway, then deceleration.
- `inCubic` &mdash; accelerating from zero velocity.
- `outCubic` &mdsah; decelerating to zero velocity.
- `outCubic` &mdash; decelerating to zero velocity.
- `inOutCubic` &mdash; acceleration until halfway, then deceleration.
- `inQuart` &mdsah; accelerating from zero velocity.
- `outQuart` &mdsah; decelerating to zero velocity.
- `inOutQuart` &mdsah; acceleration until halfway, then deceleration.
- `inQuint` &mdsah; accelerating from zero velocity.
- `outQuint` &mdsah; decelerating to zero velocity.
- `inOutQuint` &mdsah; acceleration until halfway, then deceleration.
- `inQuart` &mdash; accelerating from zero velocity.
- `outQuart` &mdash; decelerating to zero velocity.
- `inOutQuart` &mdash; acceleration until halfway, then deceleration.
- `inQuint` &mdash; accelerating from zero velocity.
- `outQuint` &mdash; decelerating to zero velocity.
- `inOutQuint` &mdash; acceleration until halfway, then deceleration.


## Cubic-Bezier
Expand Down

0 comments on commit a1bf8bf

Please sign in to comment.