File tree Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -234,9 +234,16 @@ export interface TimestampProvider {
234
234
export const canvasPath: (timestampProvider ? : TimestampProvider ) => Animation ;
235
235
236
236
export interface WiggleOptions {
237
+ // Speed of the wiggle movement. Higher is faster.
237
238
speed: number ;
239
+ // Delay before the first wiggle frame.
240
+ // Default: 0
238
241
initialDelay? : number ;
242
+ // Length of the transition from the current state to the wiggle blob.
243
+ // Default: 0
239
244
initialTransition? : number ;
245
+ // Interpolation function.
246
+ // Default: linear
240
247
initialTimingFunction? : Keyframe [" timingFunction" ];
241
248
}
242
249
// Preset animation that produces natural-looking random movement.
Original file line number Diff line number Diff line change @@ -78,9 +78,16 @@ export interface TimestampProvider {
78
78
}
79
79
80
80
export interface WiggleOptions {
81
+ // Speed of the wiggle movement. Higher is faster.
81
82
speed : number ;
83
+ // Delay before the first wiggle frame.
84
+ // Default: 0
82
85
initialDelay ?: number ;
86
+ // Length of the transition from the current state to the wiggle blob.
87
+ // Default: 0
83
88
initialTransition ?: number ;
89
+ // Interpolation function.
90
+ // Default: linear
84
91
initialTimingFunction ?: Keyframe [ "timingFunction" ] ;
85
92
}
86
93
Original file line number Diff line number Diff line change @@ -5,21 +5,27 @@ import {mapPoints} from "../internal/util";
5
5
import { checkBlobOptions , checkCanvasOptions , checkSvgOptions } from "../internal/check" ;
6
6
7
7
export interface BlobOptions {
8
+ // A given seed will always produce the same blob.
9
+ // Use `Math.random()` for pseudorandom behavior.
8
10
seed : string | number ;
11
+ // Actual number of points will be `3 + extraPoints`.
9
12
extraPoints : number ;
13
+ // Increases the amount of variation in point position.
10
14
randomness : number ;
15
+ // Size of the bounding box.
11
16
size : number ;
12
17
}
13
18
14
19
export interface CanvasOptions {
20
+ // Coordinates of top-left corner of the blob.
15
21
offsetX ?: number ;
16
22
offsetY ?: number ;
17
23
}
18
24
19
25
export interface SvgOptions {
20
- fill ?: string ;
21
- stroke ?: string ;
22
- strokeWidth ?: number ;
26
+ fill ?: string ; // Default: "#ec576b".
27
+ stroke ?: string ; // Default: "none".
28
+ strokeWidth ?: number ; // Default: 0.
23
29
}
24
30
25
31
export const canvasPath = ( blobOptions : BlobOptions , canvasOptions : CanvasOptions = { } ) : Path2D => {
You can’t perform that action at this time.
0 commit comments