Skip to content

Commit a1bf8bf

Browse files
committed
docs: add Animation docs
1 parent d4a9218 commit a1bf8bf

File tree

5 files changed

+29
-11
lines changed

5 files changed

+29
-11
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const MyComponent = mock();
8383
- [Animation](./docs/en/Animation.md)
8484
- [`<AfterTimeout>`](./docs/en/AfterTimeout.md), [`<AfterDraf>`](./docs/en/AfterDraf.md), and [`<WhenIdle>`](./docs/en/WhenIdle.md)
8585
- [`<Render>`](./docs/en/Render.md), [`withRender()`](./docs/en/Render.md#withrender-hoc), and [`@withRender`](./docs/en/Render.md#withrender-decorator)
86-
- [`<RenderInterval>`](./docs/en/RenderInverval.md), [`withRenderInterval()`](./docs/en/RenderInverval.md#withrenderinterval-hoc), and [`@withRenderInterval`](./docs/en/RenderInverval.md#withrenderinterval-decorator)
86+
- [`<RenderInterval>`](./docs/en/RenderInterval.md), [`withRenderInterval()`](./docs/en/RenderInterval.md#withrenderinterval-hoc), and [`@withRenderInterval`](./docs/en/RenderInterval.md#withrenderinterval-decorator)
8787
- [`<Tween>`](./docs/en/Tween.md), [`withTween()`](./docs/en/Tween.md#withtween-hoc), and [`@withTween`](./docs/en/Tween.md#withtween-decorator)
8888
- [`<Interpolation>`](./docs/en/Interpolation.md), [`withInterpolation()`](./docs/en/Interpolation.md#withinterpolation-hoc), and [`@withInterpolation`](./docs/en/Interpolation.md#withinterpolation-decorator)
8989
- [Side Effects](./docs/en/Side-effects.md)

docs/en/Animation.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Animation
2+
3+
Below primitives are available to do basic animation in JavaScript.
4+
5+
- [`<AfterTimeout>`](./AfterTimeout.md) &mdash; renders children after a timeout.
6+
- [`<AfterDraf>`](./AfterDraf.md) &mdash; renders children after double `requestAnimationFrame`.
7+
- [`<WhenIdle>`](./WhenIdle.md) &mdash; renders children on browser idle time.
8+
- [`<Render>`](./Render.md) &mdash; re-renders children on every `requestAnimationFrame`.
9+
- [`<RenderInterval>`](./RenderInterval.md) &mdash; re-renders children at a specified frame rate per second.
10+
- [`<Tween>`](./Tween.md) &mdash; applies an easing function to animation duration value from `<Render>`.
11+
- [`<Interpolation>`](./Interpolation.md) &mdash; interpolates a map of values using a `<Tween>`.

docs/en/Interpolation.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ a value in `[0...1]` range it interpolates a map of values you define.
66

77
## Usage
88

9-
Below code animates movement of 100x100px square.
9+
Below code animates movement of a 100x100px square.
1010

1111
```jsx
1212
import {Interpolation} from 'libreact/lib/Interpolation';
@@ -29,6 +29,13 @@ import {Interpolation} from 'libreact/lib/Interpolation';
2929
```
3030

3131

32+
## Props
33+
34+
Accepts all the [`<Tween>`](./Tween.md) props in addiont to:
35+
36+
- `map` &mdash; required, map of `[start, end]` values to interpolate.
37+
38+
3239
## `withInterpolation()` HOC
3340

3441
Injects an `interpolation` prop into your component.

docs/en/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
- [Animation](./Animation.md)
5353
- [`<AfterTimeout>`](./AfterTimeout.md), [`<AfterDraf>`](./AfterDraf.md), and [`<WhenIdle>`](./WhenIdle.md)
5454
- [`<Render>`](./Render.md), [`withRender()`](./Render.md#withrender-hoc), and [`@withRender`](./Render.md#withrender-decorator)
55-
- [`<RenderInterval>`](./RenderInverval.md), [`withRenderInterval()`](./RenderInverval.md#withrenderinterval-hoc), and [`@withRenderInterval`](./RenderInverval.md#withrenderinterval-decorator)
55+
- [`<RenderInterval>`](./RenderInterval.md), [`withRenderInterval()`](./RenderInterval.md#withrenderinterval-hoc), and [`@withRenderInterval`](./RenderInterval.md#withrenderinterval-decorator)
5656
- [`<Tween>`](./Tween.md), [`withTween()`](./Tween.md#withtween-hoc), and [`@withTween`](./Tween.md#withtween-decorator)
5757
- [`<Interpolation>`](./Interpolation.md), [`withInterpolation()`](./Interpolation.md#withinterpolation-hoc), and [`@withInterpolation`](./Interpolation.md#withinterpolation-decorator)
5858
- [Side Effects](./Side-effects.md)

docs/en/Tween.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,22 @@ You can use one of the built-in easing functions simply specifying its name as a
4040
- `quadratic` &mdash; accelerates fast, then slows quickly towards end.
4141
- `cubic` &mdash; overshoots over 1 and then returns to 1 towards end.
4242
- `elastic` &mdash; overshoots over 1 multiple times - wiggles around 1.
43-
- `circ` &mdsah; Commonly known as `outCirc`. Moves very fast at the beginning and
43+
- `circ` &mdash; Commonly known as `outCirc`. Moves very fast at the beginning and
4444
then quickly slows down in the middle. This tween can actually be used
4545
in continuous transitions where target value changes all the time,
4646
because of the very quick start, it hides the jitter between target value changes.
4747
- `inQuad` &mdash; accelerating from zero velocity
4848
- `outQuad` &mdash; decelerating to zero velocity.
4949
- `inOutQuad` &mdash; acceleration until halfway, then deceleration.
5050
- `inCubic` &mdash; accelerating from zero velocity.
51-
- `outCubic` &mdsah; decelerating to zero velocity.
51+
- `outCubic` &mdash; decelerating to zero velocity.
5252
- `inOutCubic` &mdash; acceleration until halfway, then deceleration.
53-
- `inQuart` &mdsah; accelerating from zero velocity.
54-
- `outQuart` &mdsah; decelerating to zero velocity.
55-
- `inOutQuart` &mdsah; acceleration until halfway, then deceleration.
56-
- `inQuint` &mdsah; accelerating from zero velocity.
57-
- `outQuint` &mdsah; decelerating to zero velocity.
58-
- `inOutQuint` &mdsah; acceleration until halfway, then deceleration.
53+
- `inQuart` &mdash; accelerating from zero velocity.
54+
- `outQuart` &mdash; decelerating to zero velocity.
55+
- `inOutQuart` &mdash; acceleration until halfway, then deceleration.
56+
- `inQuint` &mdash; accelerating from zero velocity.
57+
- `outQuint` &mdash; decelerating to zero velocity.
58+
- `inOutQuint` &mdash; acceleration until halfway, then deceleration.
5959

6060

6161
## Cubic-Bezier

0 commit comments

Comments
 (0)