@wix/interact 2.0.0-rc.8 → 2.0.1

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.
@@ -8,7 +8,7 @@ These rules help generate pointer-driven interactions using the `@wix/interact`
8
8
 
9
9
  The `pointerMove` trigger provides 2D progress (x and y coordinates). You can use:
10
10
 
11
- 1. **`namedEffect`** (Preferred): Pre-built mouse presets from `@wix/motion` that handle 2D progress internally
11
+ 1. **`namedEffect`** (Preferred): Pre-built mouse presets from `@wix/motion-presets` that handle 2D progress internally
12
12
  2. **`customEffect`** (Advanced): Custom function receiving the 2D progress object for full control
13
13
  3. **`keyframeEffect`** (Single-axis): The pointer position on a single axis is mapped to linear 0-1 progress for keyframe animations. Use `axis: 'x'` or `axis: 'y'` (defaults to `'y'`)
14
14
 
@@ -87,7 +87,7 @@ Controls how the progress range is calculated:
87
87
  - `[TARGET_KEY]`: Unique identifier for target element to animate (can be same as source or different)
88
88
  - `[HIT_AREA]`: 'self' (mouse within source element) or 'root' (mouse anywhere in viewport)
89
89
  - `[3D_EFFECT_TYPE]`: 'Tilt3DMouse', 'Track3DMouse', 'SwivelMouse'
90
- - `[EFFECT_PROPERTIES]`: Named effect specific properties (angle, perspective, power, etc.)
90
+ - `[EFFECT_PROPERTIES]`: Named effect specific properties (angle, perspective, direction, etc.)
91
91
  - `[CENTERED_TO_TARGET]`: true (center range at target) or false (use source element bounds)
92
92
  - `[UNIQUE_EFFECT_ID]`: Optional unique identifier
93
93
 
@@ -106,8 +106,7 @@ Controls how the progress range is calculated:
106
106
  namedEffect: {
107
107
  type: 'Tilt3DMouse',
108
108
  angle: 15,
109
- perspective: 1000,
110
- power: 'medium'
109
+ perspective: 1000
111
110
  }
112
111
  }
113
112
  ]
@@ -141,9 +140,8 @@ Controls how the progress range is calculated:
141
140
  key: '[TARGET_KEY]',
142
141
  namedEffect: {
143
142
  type: '[MOVEMENT_EFFECT_TYPE]',
144
- distance: { value: [DISTANCE_VALUE], type: '[DISTANCE_UNIT]' },
145
- axis: '[AXIS_CONSTRAINT]',
146
- power: '[POWER_LEVEL]'
143
+ distance: { value: [DISTANCE_VALUE], unit: '[DISTANCE_UNIT]' },
144
+ axis: '[AXIS_CONSTRAINT]'
147
145
  },
148
146
  centeredToTarget: [CENTERED_TO_TARGET],
149
147
  effectId: '[UNIQUE_EFFECT_ID]'
@@ -158,7 +156,6 @@ Controls how the progress range is calculated:
158
156
  - `[DISTANCE_VALUE]`: Numeric value for movement distance
159
157
  - `[DISTANCE_UNIT]`: 'px', 'percentage', 'vw', 'vh'
160
158
  - `[AXIS_CONSTRAINT]`: 'both', 'horizontal', 'vertical'
161
- - `[POWER_LEVEL]`: 'soft', 'medium', 'hard'
162
159
  - Other variables same as Rule 1
163
160
 
164
161
  **Example - Cursor Follower Element**:
@@ -174,9 +171,8 @@ Controls how the progress range is calculated:
174
171
  {
175
172
  namedEffect: {
176
173
  type: 'TrackMouse',
177
- distance: { value: 50, type: 'percentage' },
178
- axis: 'both',
179
- power: 'medium'
174
+ distance: { value: 50, unit: 'percentage' },
175
+ axis: 'both'
180
176
  },
181
177
  centeredToTarget: false
182
178
  }
@@ -198,9 +194,8 @@ Controls how the progress range is calculated:
198
194
  key: 'floating-element',
199
195
  namedEffect: {
200
196
  type: 'AiryMouse',
201
- distance: { value: 30, type: 'px' },
202
- axis: 'both',
203
- power: 'soft'
197
+ distance: { value: 30, unit: 'px' },
198
+ axis: 'both'
204
199
  },
205
200
  centeredToTarget: true,
206
201
  effectId: 'hero-float'
@@ -248,7 +243,7 @@ Controls how the progress range is calculated:
248
243
  **Variables**:
249
244
 
250
245
  - `[SCALE_EFFECT_TYPE]`: 'ScaleMouse', 'BlobMouse', 'SkewMouse'
251
- - `[SCALE_PROPERTIES]`: Effect-specific properties (scale, distance, axis, power)
246
+ - `[SCALE_PROPERTIES]`: Effect-specific properties (scale, distance, axis)
252
247
  - Other variables same as Rule 1
253
248
 
254
249
  **Example - Interactive Scale Button**:
@@ -266,9 +261,8 @@ Controls how the progress range is calculated:
266
261
  namedEffect: {
267
262
  type: 'ScaleMouse',
268
263
  scale: 1.1,
269
- distance: { value: 100, type: 'px' },
270
- axis: 'both',
271
- power: 'medium'
264
+ distance: { value: 100, unit: 'px' },
265
+ axis: 'both'
272
266
  },
273
267
  centeredToTarget: true
274
268
  }
@@ -291,8 +285,7 @@ Controls how the progress range is calculated:
291
285
  namedEffect: {
292
286
  type: 'BlobMouse',
293
287
  intensity: 0.8,
294
- smoothness: 0.6,
295
- power: 'medium'
288
+ smoothness: 0.6
296
289
  },
297
290
  effectId: 'blob-morph'
298
291
  }
@@ -339,7 +332,7 @@ Controls how the progress range is calculated:
339
332
  **Variables**:
340
333
 
341
334
  - `[VISUAL_EFFECT_TYPE]`: 'BlurMouse', 'SpinMouse'
342
- - `[VISUAL_PROPERTIES]`: Effect-specific properties (blur amount, rotation speed, power)
335
+ - `[VISUAL_PROPERTIES]`: Effect-specific properties (blur amount, rotation speed)
343
336
  - Other variables same as Rule 1
344
337
 
345
338
  **Example - Motion Blur Card**:
@@ -357,8 +350,7 @@ Controls how the progress range is calculated:
357
350
  namedEffect: {
358
351
  type: 'BlurMouse',
359
352
  blurAmount: 5,
360
- motionIntensity: 0.7,
361
- power: 'medium'
353
+ motionIntensity: 0.7
362
354
  },
363
355
  centeredToTarget: true
364
356
  }
@@ -381,8 +373,7 @@ Controls how the progress range is calculated:
381
373
  namedEffect: {
382
374
  type: 'SpinMouse',
383
375
  rotationSpeed: 0.5,
384
- direction: 'clockwise',
385
- power: 'soft'
376
+ direction: 'clockwise'
386
377
  },
387
378
  centeredToTarget: false,
388
379
  effectId: 'icon-spin'
@@ -418,8 +409,7 @@ Controls how the progress range is calculated:
418
409
  key: '[BACKGROUND_LAYER_KEY]',
419
410
  namedEffect: {
420
411
  type: '[BACKGROUND_EFFECT_TYPE]',
421
- distance: { value: [BACKGROUND_DISTANCE], type: '[DISTANCE_UNIT]' },
422
- power: '[BACKGROUND_POWER]'
412
+ distance: { value: [BACKGROUND_DISTANCE], unit: '[DISTANCE_UNIT]' }
423
413
  },
424
414
  centeredToTarget: [CENTERED_TO_TARGET]
425
415
  },
@@ -427,8 +417,7 @@ Controls how the progress range is calculated:
427
417
  key: '[MIDGROUND_LAYER_KEY]',
428
418
  namedEffect: {
429
419
  type: '[MIDGROUND_EFFECT_TYPE]',
430
- distance: { value: [MIDGROUND_DISTANCE], type: '[DISTANCE_UNIT]' },
431
- power: '[MIDGROUND_POWER]'
420
+ distance: { value: [MIDGROUND_DISTANCE], unit: '[DISTANCE_UNIT]' }
432
421
  },
433
422
  centeredToTarget: [CENTERED_TO_TARGET]
434
423
  },
@@ -436,8 +425,7 @@ Controls how the progress range is calculated:
436
425
  key: '[FOREGROUND_LAYER_KEY]',
437
426
  namedEffect: {
438
427
  type: '[FOREGROUND_EFFECT_TYPE]',
439
- distance: { value: [FOREGROUND_DISTANCE], type: '[DISTANCE_UNIT]' },
440
- power: '[FOREGROUND_POWER]'
428
+ distance: { value: [FOREGROUND_DISTANCE], unit: '[DISTANCE_UNIT]' }
441
429
  },
442
430
  centeredToTarget: [CENTERED_TO_TARGET]
443
431
  }
@@ -451,7 +439,6 @@ Controls how the progress range is calculated:
451
439
  - `[*_LAYER_KEY]`: Unique identifier for different layer elements
452
440
  - `[*_EFFECT_TYPE]`: Named effects for each layer (typically movement effects)
453
441
  - `[*_DISTANCE]`: Movement distance for each layer (creating depth)
454
- - `[*_POWER]`: Power level for each layer response
455
442
  - Other variables same as previous rules
456
443
 
457
444
  **Example - Parallax Card Layers**:
@@ -468,9 +455,8 @@ Controls how the progress range is calculated:
468
455
  key: 'bg-layer',
469
456
  namedEffect: {
470
457
  type: 'AiryMouse',
471
- distance: { value: 15, type: 'px' },
472
- axis: 'both',
473
- power: 'soft'
458
+ distance: { value: 15, unit: 'px' },
459
+ axis: 'both'
474
460
  },
475
461
  centeredToTarget: true
476
462
  },
@@ -478,9 +464,8 @@ Controls how the progress range is calculated:
478
464
  key: 'mid-layer',
479
465
  namedEffect: {
480
466
  type: 'TrackMouse',
481
- distance: { value: 25, type: 'px' },
482
- axis: 'both',
483
- power: 'medium'
467
+ distance: { value: 25, unit: 'px' },
468
+ axis: 'both'
484
469
  },
485
470
  centeredToTarget: true
486
471
  },
@@ -488,9 +473,8 @@ Controls how the progress range is calculated:
488
473
  key: 'fg-layer',
489
474
  namedEffect: {
490
475
  type: 'BounceMouse',
491
- distance: { value: 35, type: 'px' },
492
- axis: 'both',
493
- power: 'medium'
476
+ distance: { value: 35, unit: 'px' },
477
+ axis: 'both'
494
478
  },
495
479
  centeredToTarget: true
496
480
  }
@@ -512,9 +496,8 @@ Controls how the progress range is calculated:
512
496
  key: 'hero-bg',
513
497
  namedEffect: {
514
498
  type: 'AiryMouse',
515
- distance: { value: 20, type: 'px' },
516
- axis: 'both',
517
- power: 'soft'
499
+ distance: { value: 20, unit: 'px' },
500
+ axis: 'both'
518
501
  },
519
502
  centeredToTarget: true
520
503
  },
@@ -522,9 +505,8 @@ Controls how the progress range is calculated:
522
505
  key: 'hero-content',
523
506
  namedEffect: {
524
507
  type: 'TrackMouse',
525
- distance: { value: 40, type: 'px' },
526
- axis: 'horizontal',
527
- power: 'medium'
508
+ distance: { value: 40, unit: 'px' },
509
+ axis: 'horizontal'
528
510
  },
529
511
  centeredToTarget: true
530
512
  },
@@ -533,8 +515,7 @@ Controls how the progress range is calculated:
533
515
  namedEffect: {
534
516
  type: 'ScaleMouse',
535
517
  scale: 1.05,
536
- distance: { value: 60, type: 'px' },
537
- power: 'medium'
518
+ distance: { value: 60, unit: 'px' }
538
519
  },
539
520
  centeredToTarget: true
540
521
  }
@@ -610,8 +591,7 @@ Controls how the progress range is calculated:
610
591
  namedEffect: {
611
592
  type: 'Tilt3DMouse',
612
593
  angle: 12,
613
- perspective: 1000,
614
- power: 'soft'
594
+ perspective: 1000
615
595
  },
616
596
  centeredToTarget: true
617
597
  },
@@ -619,9 +599,8 @@ Controls how the progress range is calculated:
619
599
  key: 'card-shadow',
620
600
  namedEffect: {
621
601
  type: 'AiryMouse',
622
- distance: { value: 20, type: 'px' },
623
- axis: 'both',
624
- power: 'soft'
602
+ distance: { value: 20, unit: 'px' },
603
+ axis: 'both'
625
604
  },
626
605
  centeredToTarget: true
627
606
  }
@@ -644,8 +623,7 @@ Controls how the progress range is calculated:
644
623
  namedEffect: {
645
624
  type: 'ScaleMouse',
646
625
  scale: 1.05,
647
- distance: { value: 80, type: 'px' },
648
- power: 'medium'
626
+ distance: { value: 80, unit: 'px' }
649
627
  },
650
628
  centeredToTarget: true
651
629
  },
@@ -653,9 +631,8 @@ Controls how the progress range is calculated:
653
631
  key: 'nav-indicator',
654
632
  namedEffect: {
655
633
  type: 'TrackMouse',
656
- distance: { value: 15, type: 'px' },
657
- axis: 'horizontal',
658
- power: 'hard'
634
+ distance: { value: 15, unit: 'px' },
635
+ axis: 'horizontal'
659
636
  },
660
637
  centeredToTarget: false
661
638
  }
@@ -689,7 +666,7 @@ Controls how the progress range is calculated:
689
666
  {
690
667
  namedEffect: {
691
668
  type: '[FOLLOWER_EFFECT_TYPE]',
692
- distance: { value: [FOLLOWER_DISTANCE], type: '[DISTANCE_UNIT]' },
669
+ distance: { value: [FOLLOWER_DISTANCE], unit: '[DISTANCE_UNIT]' },
693
670
  [FOLLOWER_PROPERTIES]
694
671
  },
695
672
  centeredToTarget: false,
@@ -721,9 +698,8 @@ Controls how the progress range is calculated:
721
698
  {
722
699
  namedEffect: {
723
700
  type: 'TrackMouse',
724
- distance: { value: 0, type: 'px' },
725
- axis: 'both',
726
- power: 'hard'
701
+ distance: { value: 0, unit: 'px' },
702
+ axis: 'both'
727
703
  },
728
704
  centeredToTarget: false,
729
705
  effectId: 'global-cursor'
@@ -745,9 +721,8 @@ Controls how the progress range is calculated:
745
721
  {
746
722
  namedEffect: {
747
723
  type: 'AiryMouse',
748
- distance: { value: 50, type: 'px' },
749
- axis: 'both',
750
- power: 'soft'
724
+ distance: { value: 50, unit: 'px' },
725
+ axis: 'both'
751
726
  },
752
727
  centeredToTarget: false,
753
728
  effectId: 'decoration-follower'
@@ -1264,8 +1239,7 @@ Adjusting pointer sensitivity based on device capabilities:
1264
1239
  namedEffect: {
1265
1240
  type: 'Tilt3DMouse',
1266
1241
  angle: 20,
1267
- perspective: 800,
1268
- power: 'medium'
1242
+ perspective: 800
1269
1243
  },
1270
1244
  centeredToTarget: true
1271
1245
  }
@@ -1284,8 +1258,7 @@ Adjusting pointer sensitivity based on device capabilities:
1284
1258
  key: 'responsive-element',
1285
1259
  namedEffect: {
1286
1260
  type: 'ScaleMouse',
1287
- scale: 1.02,
1288
- power: 'soft'
1261
+ scale: 1.02
1289
1262
  },
1290
1263
  centeredToTarget: true
1291
1264
  }
@@ -1310,8 +1283,7 @@ Different hit areas for different interaction contexts:
1310
1283
  key: 'local-card',
1311
1284
  namedEffect: {
1312
1285
  type: 'Tilt3DMouse',
1313
- angle: 15,
1314
- power: 'medium'
1286
+ angle: 15
1315
1287
  },
1316
1288
  centeredToTarget: true
1317
1289
  }
@@ -1329,8 +1301,7 @@ Different hit areas for different interaction contexts:
1329
1301
  key: 'ambient-element',
1330
1302
  namedEffect: {
1331
1303
  type: 'AiryMouse',
1332
- distance: { value: 30, type: 'px' },
1333
- power: 'soft'
1304
+ distance: { value: 30, unit: 'px' }
1334
1305
  },
1335
1306
  centeredToTarget: false
1336
1307
  }
@@ -1354,9 +1325,8 @@ Controlling movement direction for specific design needs:
1354
1325
  key: 'horizontal-slider',
1355
1326
  namedEffect: {
1356
1327
  type: 'TrackMouse',
1357
- distance: { value: 100, type: 'px' },
1358
- axis: 'horizontal',
1359
- power: 'medium'
1328
+ distance: { value: 100, unit: 'px' },
1329
+ axis: 'horizontal'
1360
1330
  },
1361
1331
  centeredToTarget: true
1362
1332
  },
@@ -1365,9 +1335,8 @@ Controlling movement direction for specific design needs:
1365
1335
  namedEffect: {
1366
1336
  type: 'ScaleMouse',
1367
1337
  scale: 1.2,
1368
- distance: { value: 150, type: 'px' },
1369
- axis: 'vertical',
1370
- power: 'medium'
1338
+ distance: { value: 150, unit: 'px' },
1339
+ axis: 'vertical'
1371
1340
  },
1372
1341
  centeredToTarget: true
1373
1342
  }
@@ -1527,7 +1496,6 @@ Controlling movement direction for specific design needs:
1527
1496
 
1528
1497
  **Poor pointer responsiveness**:
1529
1498
 
1530
- - Check `power` settings (soft/medium/hard) for namedEffect
1531
1499
  - Verify `hitArea` configuration
1532
1500
  - Test `centeredToTarget` settings
1533
1501
  - Ensure target elements are properly positioned