laymur-animations 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,14 +49,18 @@ export declare class Animator {
49
49
  gap?: number;
50
50
  totalDuration?: number;
51
51
  }): void;
52
- static stopPulse(targets: AnimatedElement | AnimatedElement[]): void;
52
+ static stopPulse(targets: AnimatedElement | AnimatedElement[], options?: {
53
+ duration?: number;
54
+ }): void;
53
55
  static shake(targets: AnimatedElement | AnimatedElement[], options?: {
54
56
  radius?: number;
55
57
  duration?: number;
56
58
  frequency?: number;
57
59
  totalDuration?: number;
58
60
  }): void;
59
- static stopShake(targets: AnimatedElement | AnimatedElement[]): void;
61
+ static stopShake(targets: AnimatedElement | AnimatedElement[], options?: {
62
+ duration?: number;
63
+ }): void;
60
64
  static callToClick(targets: AnimatedElement | AnimatedElement[], options?: {
61
65
  jumpHeight?: number;
62
66
  duration?: number;
@@ -65,7 +69,9 @@ export declare class Animator {
65
69
  gap?: number;
66
70
  totalDuration?: number;
67
71
  }): void;
68
- static stopCallToClick(targets: AnimatedElement | AnimatedElement[]): void;
72
+ static stopCallToClick(targets: AnimatedElement | AnimatedElement[], options?: {
73
+ duration?: number;
74
+ }): void;
69
75
  static callToClickSpin(targets: AnimatedElement | AnimatedElement[], options?: {
70
76
  degrees?: number;
71
77
  duration?: number;
@@ -76,5 +82,7 @@ export declare class Animator {
76
82
  anchorX?: number;
77
83
  anchorY?: number;
78
84
  }): void;
79
- static stopCallToClickSpin(targets: AnimatedElement | AnimatedElement[]): void;
85
+ static stopCallToClickSpin(targets: AnimatedElement | AnimatedElement[], options?: {
86
+ duration?: number;
87
+ }): void;
80
88
  }
package/dist/index.js CHANGED
@@ -6193,7 +6193,8 @@ class Animator {
6193
6193
  }
6194
6194
  }
6195
6195
  }
6196
- static stopPulse(targets) {
6196
+ static stopPulse(targets, options = {}) {
6197
+ var _a;
6197
6198
  const elements = Array.isArray(targets) ? targets : [targets];
6198
6199
  for (const element of elements) {
6199
6200
  const tween = element.__laymurPulseTween;
@@ -6203,7 +6204,7 @@ class Animator {
6203
6204
  gsapWithCSS.to(element.micro, {
6204
6205
  scaleX: 1,
6205
6206
  scaleY: 1,
6206
- duration: 0.25,
6207
+ duration: (_a = options.duration) !== null && _a !== void 0 ? _a : 0.25,
6207
6208
  ease: "power1.out",
6208
6209
  });
6209
6210
  }
@@ -6237,7 +6238,8 @@ class Animator {
6237
6238
  }
6238
6239
  }
6239
6240
  }
6240
- static stopShake(targets) {
6241
+ static stopShake(targets, options = {}) {
6242
+ var _a;
6241
6243
  const elements = Array.isArray(targets) ? targets : [targets];
6242
6244
  for (const element of elements) {
6243
6245
  const key = "__laymurShakeInterval";
@@ -6248,7 +6250,7 @@ class Animator {
6248
6250
  gsapWithCSS.to(element.micro, {
6249
6251
  x: 0,
6250
6252
  y: 0,
6251
- duration: 0.25,
6253
+ duration: (_a = options.duration) !== null && _a !== void 0 ? _a : 0.25,
6252
6254
  ease: "power1.out",
6253
6255
  });
6254
6256
  }
@@ -6281,7 +6283,8 @@ class Animator {
6281
6283
  }
6282
6284
  }
6283
6285
  }
6284
- static stopCallToClick(targets) {
6286
+ static stopCallToClick(targets, options = {}) {
6287
+ var _a;
6285
6288
  const elements = Array.isArray(targets) ? targets : [targets];
6286
6289
  for (const element of elements) {
6287
6290
  const tween = element.__laymurCallTween;
@@ -6290,7 +6293,7 @@ class Animator {
6290
6293
  delete element.__laymurCallTween;
6291
6294
  gsapWithCSS.to(element.micro, {
6292
6295
  y: 0,
6293
- duration: 0.25,
6296
+ duration: (_a = options.duration) !== null && _a !== void 0 ? _a : 0.25,
6294
6297
  ease: "power1.out",
6295
6298
  });
6296
6299
  }
@@ -6338,7 +6341,8 @@ class Animator {
6338
6341
  }
6339
6342
  }
6340
6343
  }
6341
- static stopCallToClickSpin(targets) {
6344
+ static stopCallToClickSpin(targets, options = {}) {
6345
+ var _a;
6342
6346
  const elements = Array.isArray(targets) ? targets : [targets];
6343
6347
  for (const element of elements) {
6344
6348
  const tween = element.__laymurSpinTween;
@@ -6347,7 +6351,7 @@ class Animator {
6347
6351
  delete element.__laymurSpinTween;
6348
6352
  gsapWithCSS.to(element.micro, {
6349
6353
  angle: 0,
6350
- duration: 0.25,
6354
+ duration: (_a = options.duration) !== null && _a !== void 0 ? _a : 0.25,
6351
6355
  ease: "power1.out",
6352
6356
  });
6353
6357
  }