Skip to content

Commit 6c9c296

Browse files
committed
v2.2.0
1 parent 31c7c36 commit 6c9c296

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 2.2.0
2+
3+
- Remove added points from end keyframe after interpolation completes.
4+
- Add play/pause/playPause API for animations.
5+
16
# 2.1.0
27

38
- Improved type checks on user-provided data

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ animation.transition({
122122
callback: loopAnimation,
123123
blobOptions: {...},
124124
});
125+
126+
// Toggle play/pause animation on canvas click.
127+
ctx.canvas.onclick = () => {
128+
animation.playPause();
129+
};
125130
```
126131

127132
## Complete API
@@ -198,6 +203,12 @@ export const canvasPath: () => {
198203
// Immediately begin animating through the given keyframes.
199204
// Non-rendered keyframes from previous transitions are cancelled.
200205
transition: (...keyframes: CanvasKeyframe[]) => void;
206+
// Resume a paused animation. Has no effect if already playing.
207+
play: () => void;
208+
// Pause a playing animation. Has no effect if already paused.
209+
pause: () => void;
210+
// Toggle between playing and pausing the animation.
211+
playPause: () => void;
201212
};
202213
```
203214

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "blobs",
3-
"version": "2.1.0",
3+
"version": "2.2.0",
44
"description": "Random blob generation and animation",
55
"author": "g-harel",
66
"license": "MIT",

0 commit comments

Comments
 (0)