File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change
1
+ # 2.2.0
2
+
3
+ - Remove added points from end keyframe after interpolation completes.
4
+ - Add play/pause/playPause API for animations.
5
+
1
6
# 2.1.0
2
7
3
8
- Improved type checks on user-provided data
Original file line number Diff line number Diff line change @@ -122,6 +122,11 @@ animation.transition({
122
122
callback: loopAnimation,
123
123
blobOptions: {... },
124
124
});
125
+
126
+ // Toggle play/pause animation on canvas click.
127
+ ctx .canvas .onclick = () => {
128
+ animation .playPause ();
129
+ };
125
130
```
126
131
127
132
## Complete API
@@ -198,6 +203,12 @@ export const canvasPath: () => {
198
203
// Immediately begin animating through the given keyframes.
199
204
// Non-rendered keyframes from previous transitions are cancelled.
200
205
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 ;
201
212
};
202
213
```
203
214
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " blobs" ,
3
- "version" : " 2.1 .0" ,
3
+ "version" : " 2.2 .0" ,
4
4
"description" : " Random blob generation and animation" ,
5
5
"author" : " g-harel" ,
6
6
"license" : " MIT" ,
You can’t perform that action at this time.
0 commit comments