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+
16# 2.1.0
27
38- Improved type checks on user-provided data
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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" ,
You can’t perform that action at this time.
0 commit comments