@wix/interact 2.0.3 → 2.1.0

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.
Files changed (43) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/react.js +1 -1
  3. package/dist/cjs/web.js +1 -1
  4. package/dist/es/index.js +1 -1
  5. package/dist/es/react.js +2 -2
  6. package/dist/es/web.js +2 -2
  7. package/dist/{index-BfcN_rkn.mjs → index-BP07b-Y1.mjs} +1202 -751
  8. package/dist/index-BP07b-Y1.mjs.map +1 -0
  9. package/dist/index-D4orAyUu.js +18 -0
  10. package/dist/index-D4orAyUu.js.map +1 -0
  11. package/dist/tsconfig.build.tsbuildinfo +1 -1
  12. package/dist/types/core/Interact.d.ts +12 -1
  13. package/dist/types/core/Interact.d.ts.map +1 -1
  14. package/dist/types/core/add.d.ts.map +1 -1
  15. package/dist/types/core/remove.d.ts.map +1 -1
  16. package/dist/types/handlers/animationEnd.d.ts +1 -1
  17. package/dist/types/handlers/animationEnd.d.ts.map +1 -1
  18. package/dist/types/handlers/effectHandlers.d.ts +2 -1
  19. package/dist/types/handlers/effectHandlers.d.ts.map +1 -1
  20. package/dist/types/handlers/eventTrigger.d.ts +1 -1
  21. package/dist/types/handlers/eventTrigger.d.ts.map +1 -1
  22. package/dist/types/handlers/viewEnter.d.ts +1 -1
  23. package/dist/types/handlers/viewEnter.d.ts.map +1 -1
  24. package/dist/types/types.d.ts +29 -2
  25. package/dist/types/types.d.ts.map +1 -1
  26. package/docs/api/types.md +114 -0
  27. package/docs/examples/README.md +10 -1
  28. package/docs/examples/list-patterns.md +148 -0
  29. package/docs/guides/README.md +5 -0
  30. package/docs/guides/sequences.md +421 -0
  31. package/package.json +2 -2
  32. package/rules/MASTER-CLEANUP-PLAN.md +286 -0
  33. package/rules/click.md +124 -32
  34. package/rules/full-lean.md +93 -7
  35. package/rules/hover.md +142 -153
  36. package/rules/integration.md +83 -82
  37. package/rules/pointermove.md +32 -57
  38. package/rules/scroll-list.md +82 -280
  39. package/rules/viewenter.md +158 -253
  40. package/rules/viewprogress.md +139 -845
  41. package/dist/index-BfcN_rkn.mjs.map +0 -1
  42. package/dist/index-HXLBEIjG.js +0 -18
  43. package/dist/index-HXLBEIjG.js.map +0 -1
@@ -1,17 +1,12 @@
1
1
  # Scroll List Animation Rules for @wix/interact
2
2
 
3
- These rules help generate scroll-driven list animations using the `@wix/interact` library. List animations encompass sticky containers, sticky items, and their content animations, providing comprehensive patterns for modern scroll-driven list interactions including parallax effects, staggered reveals, and progressive content disclosure.
3
+ Scroll-driven list animations using `@wix/interact`. Sticky hierarchy: **container** **items** **content**. Use `key` for container/item; use `selector` for content within an item.
4
4
 
5
5
  ## Rule 1: Sticky Container List Animations with Named Effects
6
6
 
7
- **Use Case**: Animations applied to list containers that are sticky-positioned within their wrapper, using pre-built named effects for smooth scroll-driven transformations (e.g., horizontal sliding galleries, parallax backgrounds, container reveals)
7
+ **Use Case**: Sticky list containers with named effects (horizontal galleries, parallax backgrounds). Use `contain` range—animations run while the element is stuck in position.
8
8
 
9
- **When to Apply**:
10
-
11
- - For sticky container horizontal sliding during scroll
12
- - When creating parallax container effects
13
- - For container-level background transformations
14
- - When using pre-built motion effects for container animations
9
+ **When to Apply**: Sticky container sliding, parallax, background transformations.
15
10
 
16
11
  **Pattern**:
17
12
 
@@ -34,13 +29,7 @@ These rules help generate scroll-driven list animations using the `@wix/interact
34
29
  }
35
30
  ```
36
31
 
37
- **Variables**:
38
-
39
- - `[CONTAINER_KEY]`: Unique identifier for sticky list container
40
- - `[CONTAINER_NAMED_EFFECT]`: Container-level scroll effects ('BgParallax', 'PanScroll', 'MoveScroll', 'ParallaxScroll') or background effects ('BgPan', 'BgZoom', 'BgFade', 'BgReveal')
41
- - `[START_PERCENTAGE]`: Start point in contain range (typically 0)
42
- - `[END_PERCENTAGE]`: End point in contain range (typically 100)
43
- - `[UNIQUE_EFFECT_ID]`: Optional unique identifier
32
+ **Variables**: `[CONTAINER_KEY]`, `[CONTAINER_NAMED_EFFECT]` ('BgParallax', 'PanScroll', 'MoveScroll', 'ParallaxScroll', 'BgPan', 'BgZoom', 'BgFade', 'BgReveal'), `[START_PERCENTAGE]`/`[END_PERCENTAGE]` (typically 0/100), `[UNIQUE_EFFECT_ID]`.
44
33
 
45
34
  **Example - Horizontal Sliding Gallery Container**:
46
35
 
@@ -88,14 +77,9 @@ These rules help generate scroll-driven list animations using the `@wix/interact
88
77
 
89
78
  ## Rule 2: Sticky Item List Animations with Named Effects
90
79
 
91
- **Use Case**: Animations on individual list items that are sticky-positioned within the container, using named effects for entrance/exit animations as items enter sticky positioning (e.g., progressive item reveals, item transformation sequences)
80
+ **Use Case**: Individual sticky list items with named effects for entrance/exit (progressive reveals, item transformations).
92
81
 
93
- **When to Apply**:
94
-
95
- - For item entrance/exit animations during sticky phases
96
- - When creating progressive item reveals
97
- - For individual item transformations
98
- - When using pre-built item-level effects
82
+ **When to Apply**: Item entrance/exit during sticky phases, progressive item reveals.
99
83
 
100
84
  **Pattern**:
101
85
 
@@ -120,14 +104,13 @@ These rules help generate scroll-driven list animations using the `@wix/interact
120
104
 
121
105
  **Variables**:
122
106
 
123
- - `[ITEM_KEY]`: Unique identifier for individual list items
124
- - `[ITEM_NAMED_EFFECT]`: Item-level scroll effects from @wix/motion-presets scroll animations:
107
+ - `[ITEM_KEY]`: Individual list item identifier
108
+ - `[ITEM_NAMED_EFFECT]`: Item-level scroll effects from @wix/motion-presets:
125
109
  - **Reveal/Fade**: 'FadeScroll', 'BlurScroll', 'RevealScroll', 'ShapeScroll', 'ShuttersScroll'
126
110
  - **Movement**: 'MoveScroll', 'SlideScroll', 'PanScroll', 'SkewPanScroll'
127
111
  - **Scale**: 'GrowScroll', 'ShrinkScroll', 'StretchScroll'
128
112
  - **Rotation**: 'SpinScroll', 'FlipScroll', 'TiltScroll', 'TurnScroll'
129
113
  - **3D**: 'ArcScroll', 'Spin3dScroll'
130
- - `[RANGE_TYPE]`: 'entry' for entrance, 'exit' for exit, 'contain' for during sticky, 'cover' for full scroll range
131
114
  - `[START_PERCENTAGE]`: Range start percentage (0-100)
132
115
  - `[END_PERCENTAGE]`: Range end percentage (0-100)
133
116
  - `[EASING_FUNCTION]`: Timing function
@@ -179,14 +162,9 @@ These rules help generate scroll-driven list animations using the `@wix/interact
179
162
 
180
163
  ## Rule 3: Sticky Item List Content Animations with Named Effects
181
164
 
182
- **Use Case**: Animations on content within sticky list items, using named effects with each individual item being the viewProgress trigger (e.g., text reveals within cards, image animations within items, progressive content disclosure)
183
-
184
- **When to Apply**:
165
+ **Use Case**: Content within sticky items; each item is the viewProgress trigger (text reveals in cards, image animations, progressive disclosure). Use `key` for the item, `selector` for content within.
185
166
 
186
- - For content animations within sticky items
187
- - When creating staggered content reveals
188
- - For text/image animations inside list items
189
- - When coordinating multiple content elements
167
+ **When to Apply**: Content within sticky items, staggered content reveals, text/image animations inside list items.
190
168
 
191
169
  **Pattern**:
192
170
 
@@ -211,15 +189,13 @@ These rules help generate scroll-driven list animations using the `@wix/interact
211
189
 
212
190
  **Variables**:
213
191
 
214
- - `[ITEM_CONTAINER_KEY]`: Unique identifier for the containing list item
215
- - `[CONTENT_KEY]`: Unique identifier for content within the item (or use `selector` for CSS selector)
192
+ - `[ITEM_CONTAINER_KEY]` / `[CONTENT_KEY]`: Item and content identifiers. Use `selector` (e.g. `selector: '.content-text'`) for content within the item.
216
193
  - `[CONTENT_NAMED_EFFECT]`: Content-level scroll effects from @wix/motion-presets:
217
194
  - **Opacity/Visibility**: 'FadeScroll', 'BlurScroll'
218
195
  - **Reveal**: 'RevealScroll', 'ShapeScroll', 'ShuttersScroll'
219
196
  - **3D Transforms**: 'TiltScroll', 'FlipScroll', 'ArcScroll', 'TurnScroll', 'Spin3dScroll'
220
197
  - **Movement**: 'MoveScroll', 'SlideScroll'
221
198
  - **Scale**: 'GrowScroll', 'ShrinkScroll'
222
- - Other variables same as Rule 2
223
199
 
224
200
  **Example - Staggered Text Content Reveal**:
225
201
 
@@ -269,7 +245,7 @@ These rules help generate scroll-driven list animations using the `@wix/interact
269
245
  effects: [
270
246
  {
271
247
  key: 'product-card',
272
- selector: ' .hero-image',
248
+ selector: '.hero-image',
273
249
  namedEffect: {
274
250
  type: 'RevealScroll'
275
251
  },
@@ -286,14 +262,9 @@ These rules help generate scroll-driven list animations using the `@wix/interact
286
262
 
287
263
  ## Rule 4: List Container Keyframe Animations
288
264
 
289
- **Use Case**: Custom scroll-driven container animations using keyframe effects for precise control over sticky container behaviors (e.g., multi-property container transformations, responsive container animations, complex background effects)
265
+ **Use Case**: Custom container keyframe effects for sticky containers (multi-property transforms, complex backgrounds).
290
266
 
291
- **When to Apply**:
292
-
293
- - For custom container effects not available in named effects
294
- - When combining multiple CSS properties in container animations
295
- - For responsive container behaviors
296
- - When creating unique container visual effects
267
+ **When to Apply**: Custom container effects not available in named effects.
297
268
 
298
269
  **Pattern**:
299
270
 
@@ -322,13 +293,7 @@ These rules help generate scroll-driven list animations using the `@wix/interact
322
293
  }
323
294
  ```
324
295
 
325
- **Variables**:
326
-
327
- - `[CONTAINER_KEY]`: Unique identifier for list container
328
- - `[UNIQUE_KEYFRAME_EFFECT_NAME]`: unique name for the CSS keyframe effect (can equal `[UNIQUE_EFFECT_ID]` if provided)
329
- - `[CSS_PROPERTY_N]`: CSS property names ('transform', 'filter', 'opacity', 'backgroundColor')
330
- - `[START/MID/END_VALUE_N]`: Keyframe values for each property
331
- - Other variables same as Rule 1
296
+ **Variables**: `[CONTAINER_KEY]`, `[UNIQUE_KEYFRAME_EFFECT_NAME]` (or `[UNIQUE_EFFECT_ID]`). Other variables same as Rule 1.
332
297
 
333
298
  **Example - Multi-Property Container Animation**:
334
299
 
@@ -387,14 +352,9 @@ These rules help generate scroll-driven list animations using the `@wix/interact
387
352
 
388
353
  ## Rule 5: List Item Keyframe Entrance/Exit Animations
389
354
 
390
- **Use Case**: Custom entrance and exit animations for list items using keyframe effects for precise control over item reveals and dismissals (e.g., complex item entrances, item position flow, responsive item animations)
391
-
392
- **When to Apply**:
355
+ **Use Case**: Custom keyframe entrance/exit for list items (complex reveals, dismissals).
393
356
 
394
- - For complex item entrance effects beyond named effects
395
- - When creating unique item position flows
396
- - For multi-stage item animations
397
- - When coordinating item wrapper with content animations
357
+ **When to Apply**: Complex item entrance effects beyond named effects, coordinating item wrapper with content animations.
398
358
 
399
359
  **Pattern**:
400
360
 
@@ -423,12 +383,7 @@ These rules help generate scroll-driven list animations using the `@wix/interact
423
383
  }
424
384
  ```
425
385
 
426
- **Variables**:
427
-
428
- - `[ITEM_KEY]`: Unique identifier for individual list items
429
- - `[RANGE_TYPE]`: 'entry', 'exit', or 'contain' depending on animation phase
430
- - `[EASING_FUNCTION]`: Easing function to use
431
- - Other variables same as Rule 4
386
+ **Variables**: `[ITEM_KEY]`, `[EASING_FUNCTION]`. Other variables same as Rule 4.
432
387
 
433
388
  **Example - Complex Item Entrance**:
434
389
 
@@ -488,13 +443,9 @@ These rules help generate scroll-driven list animations using the `@wix/interact
488
443
 
489
444
  ## Rule 6: Staggered List Animations with Custom Timing
490
445
 
491
- **Use Case**: Coordinated animations across multiple list items with each individual item used as the viewProgress trigger and custom timing patterns (e.g., wave animations, linear stagger, exponential stagger, reverse stagger)
446
+ **Use Case**: Coordinated animations across list items; each item is the viewProgress trigger. Shared `effectId` in effects registry.
492
447
 
493
- **When to Apply**:
494
-
495
- - For creating wave-like animation propagation
496
- - When implementing linear or exponential stagger patterns
497
- - For reverse-order animations (exit effects)
448
+ **When to Apply**: Wave-like propagation, linear/exponential stagger, reverse-order exit effects. Uses shared `effectId` in the effects registry so each item references the same effect.
498
449
 
499
450
  **Pattern**:
500
451
 
@@ -589,33 +540,9 @@ These rules help generate scroll-driven list animations using the `@wix/interact
589
540
  }
590
541
  },
591
542
  interactions: [
592
- {
593
- key: 'feature-1',
594
- trigger: 'viewProgress',
595
- effects: [
596
- {
597
- effectId: 'feature-entrance'
598
- }
599
- ]
600
- },
601
- {
602
- key: 'feature-2',
603
- trigger: 'viewProgress',
604
- effects: [
605
- {
606
- effectId: 'feature-entrance'
607
- }
608
- ]
609
- },
610
- {
611
- key: 'feature-3',
612
- trigger: 'viewProgress',
613
- effects: [
614
- {
615
- effectId: 'feature-entrance'
616
- }
617
- ]
618
- },
543
+ { key: 'feature-1', trigger: 'viewProgress', effects: [{ effectId: 'feature-entrance' }] },
544
+ { key: 'feature-2', trigger: 'viewProgress', effects: [{ effectId: 'feature-entrance' }] },
545
+ { key: 'feature-3', trigger: 'viewProgress', effects: [{ effectId: 'feature-entrance' }] },
619
546
  ]
620
547
  }
621
548
  ```
@@ -624,14 +551,9 @@ These rules help generate scroll-driven list animations using the `@wix/interact
624
551
 
625
552
  ## Rule 7: Dynamic Content Animations with Custom Effects
626
553
 
627
- **Use Case**: JavaScript-powered list animations with custom effects for complex interactions that require calculations or dynamic content updates (e.g., scroll counters, progress tracking, data visualization, dynamic text updates)
554
+ **Use Case**: Per-item dynamic content via `customEffect` (counters, progress tracking, data visualization, dynamic text).
628
555
 
629
- **When to Apply**:
630
-
631
- - For animations requiring complex calculations
632
- - When integrating with data visualization
633
- - For dynamic content updates based on scroll
634
- - When creating interactive scroll-driven counters
556
+ **When to Apply**: Scroll-driven counters, progress tracking, data visualization, dynamic text updates in list contexts.
635
557
 
636
558
  **Pattern**:
637
559
 
@@ -657,13 +579,7 @@ These rules help generate scroll-driven list animations using the `@wix/interact
657
579
  }
658
580
  ```
659
581
 
660
- **Variables**:
661
-
662
- - `[LIST_CONTAINER_KEY]`: Unique identifier for list or section containing dynamic content
663
- - `[DYNAMIC_CONTENT_KEY]`: Unique identifier for elements that will be dynamically updated
664
- - `[CUSTOM_CALCULATION_LOGIC]`: JavaScript calculations based on progress
665
- - `[DYNAMIC_CONTENT_UPDATE]`: Code to update element content
666
- - `[VISUAL_PROPERTY_UPDATES]`: Code to update visual properties
582
+ **Variables**: `[LIST_CONTAINER_KEY]` / `[DYNAMIC_CONTENT_KEY]` identify the list and target elements. The `customEffect` receives `(element, progress)` where progress is 0–1.
667
583
 
668
584
  **Example - Scroll-Driven Counter in List**:
669
585
 
@@ -714,39 +630,24 @@ These rules help generate scroll-driven list animations using the `@wix/interact
714
630
  const items = element.closest('interact-element')?.querySelectorAll('.task-item') || [];
715
631
  const totalItems = items.length;
716
632
  const elementIndex = Array.from(items).indexOf(element);
717
-
718
- // Calculate staggered progress for each item
719
633
  const itemStartProgress = elementIndex / totalItems;
720
634
  const itemEndProgress = (elementIndex + 1) / totalItems;
635
+ let itemProgress = progress > itemStartProgress
636
+ ? Math.min(1, (progress - itemStartProgress) / (itemEndProgress - itemStartProgress))
637
+ : 0;
721
638
 
722
- // Calculate individual item progress
723
- let itemProgress = 0;
724
- if (progress > itemStartProgress) {
725
- itemProgress = Math.min(1, (progress - itemStartProgress) / (itemEndProgress - itemStartProgress));
726
- }
727
-
728
- // Update visual state
729
639
  const checkbox = element.querySelector('.task-checkbox');
730
640
  const taskText = element.querySelector('.task-text');
731
-
732
641
  if (itemProgress > 0.5) {
733
642
  element.classList.add('active');
734
643
  checkbox.style.transform = `scale(${0.8 + itemProgress * 0.4})`;
735
644
  checkbox.style.opacity = itemProgress;
736
645
  }
737
-
738
646
  if (itemProgress > 0.8) {
739
647
  element.classList.add('completed');
740
648
  taskText.style.textDecoration = 'line-through';
741
649
  taskText.style.opacity = '0.7';
742
650
  }
743
-
744
- // Update overall progress indicator
745
- const progressIndicator = document.querySelector('#overall-progress');
746
- if (progressIndicator && elementIndex === 0) {
747
- progressIndicator.style.width = `${progress * 100}%`;
748
- progressIndicator.textContent = `${Math.floor(progress * 100)}% Complete`;
749
- }
750
651
  },
751
652
  rangeStart: { name: 'cover', offset: { unit: 'percentage', value: 0 } },
752
653
  rangeEnd: { name: 'cover', offset: { unit: 'percentage', value: 100 } },
@@ -763,108 +664,73 @@ These rules help generate scroll-driven list animations using the `@wix/interact
763
664
 
764
665
  ### Multi-Layer List Coordination
765
666
 
766
- Coordinating container, items, and content simultaneously:
667
+ Container, items, and content: use `cover` for background/foreground layers (full scroll range), `contain` for the sticky container layer (while stuck).
767
668
 
768
669
  ```typescript
769
670
  {
770
671
  key: 'complex-list-section',
771
672
  trigger: 'viewProgress',
772
673
  effects: [
773
- // Background layer
774
- {
775
- key: 'list-background',
776
- keyframeEffect: {
777
- name: 'background-parallax',
778
- keyframes: [
779
- { transform: 'scale(1.1) translateY(0)', filter: 'blur(0)' },
780
- { transform: 'scale(1) translateY(-50px)', filter: 'blur(2px)' }
781
- ]
782
- },
783
- rangeStart: { name: 'cover', offset: { unit: 'percentage', value: 0 } },
784
- rangeEnd: { name: 'cover', offset: { unit: 'percentage', value: 100 } },
785
- easing: 'linear',
786
- fill: 'both'
787
- },
788
- // Container layer
789
- {
790
- key: 'list-container',
791
- keyframeEffect: {
792
- name: 'container-slide',
793
- keyframes: [
794
- { transform: 'translateX(0)' },
795
- { transform: 'translateX(-50%)' }
796
- ]
797
- },
798
- rangeStart: { name: 'contain', offset: { unit: 'percentage', value: 0 } },
799
- rangeEnd: { name: 'contain', offset: { unit: 'percentage', value: 100 } },
800
- easing: 'linear',
801
- fill: 'both'
802
- },
803
- // Foreground decorations
804
- {
805
- key: 'list-decorations',
806
- keyframeEffect: {
807
- name: 'decorations-parallax',
808
- keyframes: [
809
- { transform: 'translateY(0)', opacity: '0.8' },
810
- { transform: 'translateY(-100px)', opacity: '1' }
811
- ]
812
- },
813
- rangeStart: { name: 'cover', offset: { unit: 'percentage', value: 0 } },
814
- rangeEnd: { name: 'cover', offset: { unit: 'percentage', value: 100 } },
815
- easing: 'linear',
816
- fill: 'both'
817
- }
674
+ { key: 'list-background', keyframeEffect: { name: 'bg-parallax', keyframes: [{ transform: 'scale(1.1)' }, { transform: 'scale(1) translateY(-50px)' }] }, rangeStart: { name: 'cover', offset: { unit: 'percentage', value: 0 } }, rangeEnd: { name: 'cover', offset: { unit: 'percentage', value: 100 } }, easing: 'linear', fill: 'both' },
675
+ { key: 'list-container', keyframeEffect: { name: 'container-slide', keyframes: [{ transform: 'translateX(0)' }, { transform: 'translateX(-50%)' }] }, rangeStart: { name: 'contain', offset: { unit: 'percentage', value: 0 } }, rangeEnd: { name: 'contain', offset: { unit: 'percentage', value: 100 } }, easing: 'linear', fill: 'both' }
818
676
  ]
819
677
  }
820
678
  ```
821
679
 
822
680
  ### Responsive List Animations
823
681
 
824
- Adaptive patterns based on screen size and device capabilities:
682
+ Condition IDs are user-defined strings declared in the top-level `conditions` map. Define separate interactions for the same `key` with different conditions and effects.
825
683
 
826
684
  ```typescript
827
- // Desktop version with complex effects
828
685
  {
829
- key: 'responsive-list',
830
- trigger: 'viewProgress',
831
- conditions: ['desktop-only', 'prefers-motion'],
832
- effects: [
686
+ conditions: {
687
+ 'desktop-only': { type: 'media', predicate: '(min-width: 768px)' },
688
+ 'prefers-motion': { type: 'media', predicate: '(prefers-reduced-motion: no-preference)' },
689
+ 'mobile-only': { type: 'media', predicate: '(max-width: 767px)' },
690
+ },
691
+ interactions: [
833
692
  {
834
693
  key: 'list-item',
835
- keyframeEffect: {
836
- name: 'list-item-complex',
837
- keyframes: [
838
- { transform: 'translateY(-20px) rotateY(5deg)', boxShadow: '0 20px 40px rgb(0 0 0 / 0.15)' },
839
- { transform: 'translateY(0) rotateY(0deg)', boxShadow: '0 0 0 rgb(0 0 0 / 0)' }
840
- ]
841
- },
842
- rangeStart: { name: 'entry', offset: { unit: 'percentage', value: 0 } },
843
- rangeEnd: { name: 'entry', offset: { unit: 'percentage', value: 80 } },
844
- easing: 'cubic-bezier(0.16, 1, 0.3, 1)',
845
- fill: 'both'
846
- }
847
- ]
848
- },
849
- // Mobile version with simplified effects
850
- {
851
- key: 'responsive-list',
852
- trigger: 'viewProgress',
853
- conditions: ['mobile-only'],
854
- effects: [
694
+ trigger: 'viewProgress',
695
+ conditions: ['desktop-only', 'prefers-motion'],
696
+ effects: [
697
+ {
698
+ key: 'list-item',
699
+ keyframeEffect: {
700
+ name: 'item-complex',
701
+ keyframes: [
702
+ { opacity: '0', transform: 'translateY(-20px) rotateY(5deg)' },
703
+ { opacity: '1', transform: 'translateY(0) rotateY(0deg)' }
704
+ ]
705
+ },
706
+ rangeStart: { name: 'entry', offset: { unit: 'percentage', value: 0 } },
707
+ rangeEnd: { name: 'entry', offset: { unit: 'percentage', value: 80 } },
708
+ easing: 'cubic-bezier(0.16, 1, 0.3, 1)',
709
+ fill: 'both'
710
+ }
711
+ ]
712
+ },
713
+ // Simplified fallback for mobile or reduced-motion users
855
714
  {
856
715
  key: 'list-item',
857
- keyframeEffect: {
858
- name: 'list-item-simple',
859
- keyframes: [
860
- { opacity: '0', transform: 'translateY(30px)' },
861
- { opacity: '1', transform: 'translateY(0)' }
862
- ]
863
- },
864
- rangeStart: { name: 'entry', offset: { unit: 'percentage', value: 0 } },
865
- rangeEnd: { name: 'entry', offset: { unit: 'percentage', value: 60 } },
866
- easing: 'ease-out',
867
- fill: 'both'
716
+ trigger: 'viewProgress',
717
+ conditions: ['mobile-only'],
718
+ effects: [
719
+ {
720
+ key: 'list-item',
721
+ keyframeEffect: {
722
+ name: 'item-simple',
723
+ keyframes: [
724
+ { opacity: '0', transform: 'translateY(30px)' },
725
+ { opacity: '1', transform: 'translateY(0)' }
726
+ ]
727
+ },
728
+ rangeStart: { name: 'entry', offset: { unit: 'percentage', value: 0 } },
729
+ rangeEnd: { name: 'entry', offset: { unit: 'percentage', value: 60 } },
730
+ easing: 'ease-out',
731
+ fill: 'both'
732
+ }
733
+ ]
868
734
  }
869
735
  ]
870
736
  }
@@ -874,73 +740,9 @@ Adaptive patterns based on screen size and device capabilities:
874
740
 
875
741
  ## Best Practices for List Scroll Animations
876
742
 
877
- ### Performance Guidelines
878
-
879
- 1. **Use hardware-accelerated properties**: `transform`, `opacity`, `filter` for smooth animations
880
- 2. **Limit concurrent animations**: Avoid animating too many items simultaneously
881
- 3. **Use position:sticky for scrolling effects**: Animate elements while they're stuck in position and not scrolling with the page
882
- 4. **Consider `will-change` property**: When doing complex style animations inside custom effects that the browser can not predict automatically
883
-
884
- ### Range Selection Guidelines
885
-
886
- 1. **Container animations**: Use `contain` range for sticky container effects
887
- 2. **Item entrance**: Use `entry` range (0-60%) for natural reveals
888
- 3. **Item exit**: Use `exit` range (20-100%) for smooth dismissals
889
- 4. **Content coordination**: Use same timeline with `cover`/`contain` range and staggered offsets, or use a different timeline per item with same range and offsets
890
-
891
- ### User Experience Guidelines
892
-
893
- 1. **Keep animations subtle**: Avoid overwhelming users with excessive motion
894
- 2. **Maintain content readability**: Ensure text remains legible during animations
895
- 3. **Provide reduced motion alternatives**: Respect `prefers-reduced-motion` setting
896
-
897
- ### Accessibility Considerations
898
-
899
- 1. **Respect motion preferences**: Include `prefers-motion` conditions
900
- 2. **Provide keyboard navigation**: Ensure list remains navigable during animations
901
- 3. **Maintain focus management**: Don't break focus states with animations
902
- 4. **Ensure content accessibility**: Keep content accessible throughout animation states
903
-
904
- ### Common Use Cases by Pattern
905
-
906
- **Sticky Container (Rule 1)**:
907
-
908
- - Horizontal scrolling galleries
909
- - Timeline navigation
910
- - Product showcase carousels
911
- - Feature comparison tables
912
-
913
- **Sticky Items (Rule 2)**:
914
-
915
- - Progressive story reveals
916
- - Step-by-step processes
917
- - Card-based layouts
918
- - Interactive portfolios
919
-
920
- **Content Animations (Rule 3)**:
921
-
922
- - Text reveals within cards
923
- - Image animations in galleries
924
- - Icon animations in feature lists
925
- - Progressive data visualization
926
-
927
- **Keyframe Effects (Rules 4-5)**:
928
-
929
- - Complex brand animations
930
- - Multi-property transformations
931
- - Responsive design adaptations
932
- - Advanced visual effects
933
-
934
- **Staggered Animations (Rule 6)**:
935
-
936
- - Team member introductions
937
- - Product grid reveals
938
- - Feature list presentations
939
- - Testimonial carousels
940
-
941
- **Dynamic Content (Rule 7)**:
743
+ ### List-Specific Guidelines
942
744
 
943
- - Statistics counters
944
- - Progress tracking
945
- - Data visualization
946
- - Interactive dashboards
745
+ 1. **Sticky hierarchy**: Container → items → content. Use `contain` range for sticky container effects (animations run while the element is stuck in position).
746
+ 2. **Content coordination**: Use same timeline with `cover`/`contain` range and staggered offsets, or use a different timeline per item with same range and offsets.
747
+ 3. **Use position:sticky**: Animate elements while they're stuck in position and not scrolling with the page.
748
+ 4. **@wix/interact conditions**: Include `prefers-motion` in conditions for reduced-motion users (e.g. `conditions: ['prefers-motion']`).