@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.
- package/README.md +2 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/react.js +1 -1
- package/dist/cjs/web.js +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es/react.js +2 -2
- package/dist/es/web.js +2 -2
- package/dist/{index-DsvFkLS4.mjs → index-BnI6W-7u.mjs} +134 -128
- package/dist/{index-DsvFkLS4.mjs.map → index-BnI6W-7u.mjs.map} +1 -1
- package/dist/{index-Bs9cjD_x.js → index-emAFXYqb.js} +5 -5
- package/dist/{index-Bs9cjD_x.js.map → index-emAFXYqb.js.map} +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/core/add.d.ts.map +1 -1
- package/docs/README.md +39 -73
- package/docs/api/README.md +1 -1
- package/docs/api/functions.md +22 -37
- package/docs/api/interact-class.md +31 -20
- package/docs/api/interaction-controller.md +18 -54
- package/docs/api/types.md +31 -144
- package/docs/guides/effects-and-animations.md +9 -9
- package/docs/guides/understanding-triggers.md +11 -9
- package/docs/integration/react.md +15 -12
- package/package.json +3 -4
- package/rules/click.md +8 -10
- package/rules/full-lean.md +18 -20
- package/rules/hover.md +4 -6
- package/rules/integration.md +39 -13
- package/rules/pointermove.md +49 -81
- package/rules/scroll-list.md +66 -66
- package/rules/viewenter.md +24 -33
- package/rules/viewprogress.md +96 -96
package/rules/scroll-list.md
CHANGED
|
@@ -17,7 +17,7 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
17
17
|
|
|
18
18
|
```typescript
|
|
19
19
|
{
|
|
20
|
-
key: '[
|
|
20
|
+
key: '[CONTAINER_KEY]',
|
|
21
21
|
trigger: 'viewProgress',
|
|
22
22
|
effects: [
|
|
23
23
|
{
|
|
@@ -25,8 +25,8 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
25
25
|
namedEffect: {
|
|
26
26
|
type: '[CONTAINER_NAMED_EFFECT]'
|
|
27
27
|
},
|
|
28
|
-
rangeStart: { name: 'contain', offset: {
|
|
29
|
-
rangeEnd: { name: 'contain', offset: {
|
|
28
|
+
rangeStart: { name: 'contain', offset: { unit: 'percentage', value: [START_PERCENTAGE] } },
|
|
29
|
+
rangeEnd: { name: 'contain', offset: { unit: 'percentage', value: [END_PERCENTAGE] } },
|
|
30
30
|
easing: 'linear',
|
|
31
31
|
effectId: '[UNIQUE_EFFECT_ID]'
|
|
32
32
|
}
|
|
@@ -54,8 +54,8 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
54
54
|
namedEffect: {
|
|
55
55
|
type: 'PanScroll'
|
|
56
56
|
},
|
|
57
|
-
rangeStart: { name: 'contain', offset: {
|
|
58
|
-
rangeEnd: { name: 'contain', offset: {
|
|
57
|
+
rangeStart: { name: 'contain', offset: { unit: 'percentage', value: 0 } },
|
|
58
|
+
rangeEnd: { name: 'contain', offset: { unit: 'percentage', value: 100 } },
|
|
59
59
|
easing: 'linear',
|
|
60
60
|
effectId: 'gallery-slide'
|
|
61
61
|
}
|
|
@@ -75,8 +75,8 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
75
75
|
namedEffect: {
|
|
76
76
|
type: 'BgParallax'
|
|
77
77
|
},
|
|
78
|
-
rangeStart: { name: 'contain', offset: {
|
|
79
|
-
rangeEnd: { name: 'contain', offset: {
|
|
78
|
+
rangeStart: { name: 'contain', offset: { unit: 'percentage', value: 0 } },
|
|
79
|
+
rangeEnd: { name: 'contain', offset: { unit: 'percentage', value: 100 } },
|
|
80
80
|
easing: 'linear',
|
|
81
81
|
effectId: 'bg-parallax'
|
|
82
82
|
}
|
|
@@ -109,8 +109,8 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
109
109
|
namedEffect: {
|
|
110
110
|
type: '[ITEM_NAMED_EFFECT]'
|
|
111
111
|
},
|
|
112
|
-
rangeStart: { name: '[RANGE_TYPE]', offset: {
|
|
113
|
-
rangeEnd: { name: '[RANGE_TYPE]', offset: {
|
|
112
|
+
rangeStart: { name: '[RANGE_TYPE]', offset: { unit: 'percentage', value: [START_PERCENTAGE] } },
|
|
113
|
+
rangeEnd: { name: '[RANGE_TYPE]', offset: { unit: 'percentage', value: [END_PERCENTAGE] } },
|
|
114
114
|
easing: '[EASING_FUNCTION]',
|
|
115
115
|
effectId: '[UNIQUE_EFFECT_ID]'
|
|
116
116
|
}
|
|
@@ -121,7 +121,7 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
121
121
|
**Variables**:
|
|
122
122
|
|
|
123
123
|
- `[ITEM_KEY]`: Unique identifier for individual list items
|
|
124
|
-
- `[ITEM_NAMED_EFFECT]`: Item-level scroll effects from @wix/motion scroll animations:
|
|
124
|
+
- `[ITEM_NAMED_EFFECT]`: Item-level scroll effects from @wix/motion-presets scroll animations:
|
|
125
125
|
- **Reveal/Fade**: 'FadeScroll', 'BlurScroll', 'RevealScroll', 'ShapeScroll', 'ShuttersScroll'
|
|
126
126
|
- **Movement**: 'MoveScroll', 'SlideScroll', 'PanScroll', 'SkewPanScroll'
|
|
127
127
|
- **Scale**: 'GrowScroll', 'ShrinkScroll', 'StretchScroll'
|
|
@@ -145,8 +145,8 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
145
145
|
type: 'RevealScroll',
|
|
146
146
|
direction: 'bottom'
|
|
147
147
|
},
|
|
148
|
-
rangeStart: { name: 'entry', offset: {
|
|
149
|
-
rangeEnd: { name: 'entry', offset: {
|
|
148
|
+
rangeStart: { name: 'entry', offset: { unit: 'percentage', value: 0 } },
|
|
149
|
+
rangeEnd: { name: 'entry', offset: { unit: 'percentage', value: 60 } },
|
|
150
150
|
easing: 'ease-out',
|
|
151
151
|
effectId: 'item-reveal'
|
|
152
152
|
}
|
|
@@ -166,8 +166,8 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
166
166
|
namedEffect: {
|
|
167
167
|
type: 'GrowScroll'
|
|
168
168
|
},
|
|
169
|
-
rangeStart: { name: 'contain', offset: {
|
|
170
|
-
rangeEnd: { name: 'contain', offset: {
|
|
169
|
+
rangeStart: { name: 'contain', offset: { unit: 'percentage', value: 0 } },
|
|
170
|
+
rangeEnd: { name: 'contain', offset: { unit: 'percentage', value: 50 } },
|
|
171
171
|
easing: 'ease-in-out',
|
|
172
172
|
effectId: 'item-grow'
|
|
173
173
|
}
|
|
@@ -192,16 +192,16 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
192
192
|
|
|
193
193
|
```typescript
|
|
194
194
|
{
|
|
195
|
-
key: '[
|
|
195
|
+
key: '[ITEM_CONTAINER_KEY]',
|
|
196
196
|
trigger: 'viewProgress',
|
|
197
197
|
effects: [
|
|
198
198
|
{
|
|
199
|
-
key: '[
|
|
199
|
+
key: '[CONTENT_KEY]',
|
|
200
200
|
namedEffect: {
|
|
201
201
|
type: '[CONTENT_NAMED_EFFECT]'
|
|
202
202
|
},
|
|
203
|
-
rangeStart: { name: '[RANGE_TYPE]', offset: {
|
|
204
|
-
rangeEnd: { name: '[RANGE_TYPE]', offset: {
|
|
203
|
+
rangeStart: { name: '[RANGE_TYPE]', offset: { unit: 'percentage', value: [START_PERCENTAGE] } },
|
|
204
|
+
rangeEnd: { name: '[RANGE_TYPE]', offset: { unit: 'percentage', value: [END_PERCENTAGE] } },
|
|
205
205
|
easing: '[EASING_FUNCTION]',
|
|
206
206
|
effectId: '[UNIQUE_EFFECT_ID]'
|
|
207
207
|
}
|
|
@@ -211,9 +211,9 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
211
211
|
|
|
212
212
|
**Variables**:
|
|
213
213
|
|
|
214
|
-
- `[
|
|
215
|
-
- `[
|
|
216
|
-
- `[CONTENT_NAMED_EFFECT]`: Content-level scroll effects from @wix/motion:
|
|
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)
|
|
216
|
+
- `[CONTENT_NAMED_EFFECT]`: Content-level scroll effects from @wix/motion-presets:
|
|
217
217
|
- **Opacity/Visibility**: 'FadeScroll', 'BlurScroll'
|
|
218
218
|
- **Reveal**: 'RevealScroll', 'ShapeScroll', 'ShuttersScroll'
|
|
219
219
|
- **3D Transforms**: 'TiltScroll', 'FlipScroll', 'ArcScroll', 'TurnScroll', 'Spin3dScroll'
|
|
@@ -234,8 +234,8 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
234
234
|
namedEffect: {
|
|
235
235
|
type: 'FadeScroll'
|
|
236
236
|
},
|
|
237
|
-
rangeStart: { name: 'entry', offset: {
|
|
238
|
-
rangeEnd: { name: 'entry', offset: {
|
|
237
|
+
rangeStart: { name: 'entry', offset: { unit: 'percentage', value: 20 } },
|
|
238
|
+
rangeEnd: { name: 'entry', offset: { unit: 'percentage', value: 80 } },
|
|
239
239
|
easing: 'ease-out',
|
|
240
240
|
effectId: 'text-reveal-1'
|
|
241
241
|
}
|
|
@@ -251,8 +251,8 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
251
251
|
namedEffect: {
|
|
252
252
|
type: 'FadeScroll'
|
|
253
253
|
},
|
|
254
|
-
rangeStart: { name: 'entry', offset: {
|
|
255
|
-
rangeEnd: { name: 'entry', offset: {
|
|
254
|
+
rangeStart: { name: 'entry', offset: { unit: 'percentage', value: 20 } },
|
|
255
|
+
rangeEnd: { name: 'entry', offset: { unit: 'percentage', value: 80 } },
|
|
256
256
|
easing: 'ease-out',
|
|
257
257
|
effectId: 'text-reveal-2'
|
|
258
258
|
}
|
|
@@ -273,8 +273,8 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
273
273
|
namedEffect: {
|
|
274
274
|
type: 'RevealScroll'
|
|
275
275
|
},
|
|
276
|
-
rangeStart: { name: 'entry', offset: {
|
|
277
|
-
rangeEnd: { name: 'entry', offset: {
|
|
276
|
+
rangeStart: { name: 'entry', offset: { unit: 'percentage', value: 0 } },
|
|
277
|
+
rangeEnd: { name: 'entry', offset: { unit: 'percentage', value: 50 } },
|
|
278
278
|
easing: 'cubic-bezier(0.16, 1, 0.3, 1)',
|
|
279
279
|
effectId: 'product-image-reveal'
|
|
280
280
|
}
|
|
@@ -299,7 +299,7 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
299
299
|
|
|
300
300
|
```typescript
|
|
301
301
|
{
|
|
302
|
-
key: '[
|
|
302
|
+
key: '[CONTAINER_KEY]',
|
|
303
303
|
trigger: 'viewProgress',
|
|
304
304
|
effects: [
|
|
305
305
|
{
|
|
@@ -312,8 +312,8 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
312
312
|
{ [CSS_PROPERTY_1]: '[END_VALUE_1]', [CSS_PROPERTY_2]: '[END_VALUE_2]', [CSS_PROPERTY_3]: '[END_VALUE_3]' }
|
|
313
313
|
]
|
|
314
314
|
},
|
|
315
|
-
rangeStart: { name: 'contain', offset: {
|
|
316
|
-
rangeEnd: { name: 'contain', offset: {
|
|
315
|
+
rangeStart: { name: 'contain', offset: { unit: 'percentage', value: [START_PERCENTAGE] } },
|
|
316
|
+
rangeEnd: { name: 'contain', offset: { unit: 'percentage', value: [END_PERCENTAGE] } },
|
|
317
317
|
easing: 'linear',
|
|
318
318
|
fill: 'both',
|
|
319
319
|
effectId: '[UNIQUE_EFFECT_ID]'
|
|
@@ -347,8 +347,8 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
347
347
|
{ transform: 'translateX(-100%)', filter: 'brightness(1)', backgroundColor: 'rgb(255 255 255 / 0)' }
|
|
348
348
|
]
|
|
349
349
|
},
|
|
350
|
-
rangeStart: { name: 'contain', offset: {
|
|
351
|
-
rangeEnd: { name: 'contain', offset: {
|
|
350
|
+
rangeStart: { name: 'contain', offset: { unit: 'percentage', value: 0 } },
|
|
351
|
+
rangeEnd: { name: 'contain', offset: { unit: 'percentage', value: 100 } },
|
|
352
352
|
easing: 'linear',
|
|
353
353
|
fill: 'both',
|
|
354
354
|
effectId: 'container-slide'
|
|
@@ -373,8 +373,8 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
373
373
|
{ transform: 'scale(1) rotate(0deg)', opacity: '1', filter: 'hue-rotate(0deg)' }
|
|
374
374
|
]
|
|
375
375
|
},
|
|
376
|
-
rangeStart: { name: 'contain', offset: {
|
|
377
|
-
rangeEnd: { name: 'contain', offset: {
|
|
376
|
+
rangeStart: { name: 'contain', offset: { unit: 'percentage', value: 0 } },
|
|
377
|
+
rangeEnd: { name: 'contain', offset: { unit: 'percentage', value: 100 } },
|
|
378
378
|
easing: 'linear',
|
|
379
379
|
fill: 'both',
|
|
380
380
|
effectId: 'bg-transform'
|
|
@@ -413,8 +413,8 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
413
413
|
{ [CSS_PROPERTY_1]: '[END_VALUE_1]', [CSS_PROPERTY_2]: '[END_VALUE_2]' }
|
|
414
414
|
]
|
|
415
415
|
},
|
|
416
|
-
rangeStart: { name: '[RANGE_TYPE]', offset: {
|
|
417
|
-
rangeEnd: { name: '[RANGE_TYPE]', offset: {
|
|
416
|
+
rangeStart: { name: '[RANGE_TYPE]', offset: { unit: 'percentage', value: [START_PERCENTAGE] } },
|
|
417
|
+
rangeEnd: { name: '[RANGE_TYPE]', offset: { unit: 'percentage', value: [END_PERCENTAGE] } },
|
|
418
418
|
easing: '[EASING_FUNCTION]',
|
|
419
419
|
fill: 'both',
|
|
420
420
|
effectId: '[UNIQUE_EFFECT_ID]'
|
|
@@ -447,8 +447,8 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
447
447
|
{ opacity: '1', transform: 'translateY(0) scale(1) rotate(0deg)', filter: 'blur(0)', boxShadow: '0 20px 40px rgb(0 0 0 / 0.15)' }
|
|
448
448
|
]
|
|
449
449
|
},
|
|
450
|
-
rangeStart: { name: 'entry', offset: {
|
|
451
|
-
rangeEnd: { name: 'entry', offset: {
|
|
450
|
+
rangeStart: { name: 'entry', offset: { unit: 'percentage', value: 0 } },
|
|
451
|
+
rangeEnd: { name: 'entry', offset: { unit: 'percentage', value: 80 } },
|
|
452
452
|
easing: 'cubic-bezier(0.16, 1, 0.3, 1)',
|
|
453
453
|
fill: 'both',
|
|
454
454
|
effectId: 'timeline-entrance'
|
|
@@ -474,8 +474,8 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
474
474
|
{ opacity: '0', transform: 'scale(0.8) rotate(-5deg)', filter: 'brightness(0.6)' }
|
|
475
475
|
]
|
|
476
476
|
},
|
|
477
|
-
rangeStart: { name: 'exit', offset: {
|
|
478
|
-
rangeEnd: { name: 'exit', offset: {
|
|
477
|
+
rangeStart: { name: 'exit', offset: { unit: 'percentage', value: 20 } },
|
|
478
|
+
rangeEnd: { name: 'exit', offset: { unit: 'percentage', value: 100 } },
|
|
479
479
|
easing: 'ease-in',
|
|
480
480
|
fill: 'both',
|
|
481
481
|
effectId: 'card-exit'
|
|
@@ -503,14 +503,14 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
503
503
|
effects: {
|
|
504
504
|
[EFFECT_ID]: {
|
|
505
505
|
[EFFECT_TYPE]: [EFFECT_DEFINITION],
|
|
506
|
-
rangeStart: { name: '[RANGE_TYPE]', offset: {
|
|
507
|
-
rangeEnd: { name: '[RANGE_TYPE]', offset: {
|
|
506
|
+
rangeStart: { name: '[RANGE_TYPE]', offset: { unit: 'percentage', value: [START_PERCENTAGE] } },
|
|
507
|
+
rangeEnd: { name: '[RANGE_TYPE]', offset: { unit: 'percentage', value: [END_PERCENTAGE] } },
|
|
508
508
|
easing: '[EASING_FUNCTION]'
|
|
509
509
|
}
|
|
510
510
|
},
|
|
511
511
|
interactions: [
|
|
512
512
|
{
|
|
513
|
-
key: '[
|
|
513
|
+
key: '[ITEM_KEY_N]',
|
|
514
514
|
trigger: 'viewProgress',
|
|
515
515
|
effects: [
|
|
516
516
|
{
|
|
@@ -532,8 +532,8 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
532
532
|
namedEffect: {
|
|
533
533
|
type: 'SlideScroll'
|
|
534
534
|
},
|
|
535
|
-
rangeStart: { name: 'entry', offset: {
|
|
536
|
-
rangeEnd: { name: 'entry', offset: {
|
|
535
|
+
rangeStart: { name: 'entry', offset: { unit: 'percentage', value: 0 } },
|
|
536
|
+
rangeEnd: { name: 'entry', offset: { unit: 'percentage', value: 60 } },
|
|
537
537
|
easing: 'linear'
|
|
538
538
|
}
|
|
539
539
|
},
|
|
@@ -582,8 +582,8 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
582
582
|
{ opacity: '1', transform: 'translateY(0) scale(1)' }
|
|
583
583
|
]
|
|
584
584
|
},
|
|
585
|
-
rangeStart: { name: 'entry', offset: {
|
|
586
|
-
rangeEnd: { name: 'entry', offset: {
|
|
585
|
+
rangeStart: { name: 'entry', offset: { unit: 'percentage', value: 0 } },
|
|
586
|
+
rangeEnd: { name: 'entry', offset: { unit: 'percentage', value: 100 } },
|
|
587
587
|
easing: 'expoOut',
|
|
588
588
|
fill: 'both'
|
|
589
589
|
}
|
|
@@ -637,19 +637,19 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
637
637
|
|
|
638
638
|
```typescript
|
|
639
639
|
{
|
|
640
|
-
key: '[
|
|
640
|
+
key: '[LIST_CONTAINER_KEY]',
|
|
641
641
|
trigger: 'viewProgress',
|
|
642
642
|
effects: [
|
|
643
643
|
{
|
|
644
|
-
key: '[
|
|
645
|
-
customEffect: (element, progress
|
|
644
|
+
key: '[DYNAMIC_CONTENT_KEY]',
|
|
645
|
+
customEffect: (element, progress) => {
|
|
646
646
|
// progress is 0-1 representing scroll position within range
|
|
647
647
|
[CUSTOM_CALCULATION_LOGIC]
|
|
648
648
|
[DYNAMIC_CONTENT_UPDATE]
|
|
649
649
|
[VISUAL_PROPERTY_UPDATES]
|
|
650
650
|
},
|
|
651
|
-
rangeStart: { name: '[RANGE_TYPE]', offset: {
|
|
652
|
-
rangeEnd: { name: '[RANGE_TYPE]', offset: {
|
|
651
|
+
rangeStart: { name: '[RANGE_TYPE]', offset: { unit: 'percentage', value: [START_PERCENTAGE] } },
|
|
652
|
+
rangeEnd: { name: '[RANGE_TYPE]', offset: { unit: 'percentage', value: [END_PERCENTAGE] } },
|
|
653
653
|
fill: 'both',
|
|
654
654
|
effectId: '[UNIQUE_EFFECT_ID]'
|
|
655
655
|
}
|
|
@@ -692,8 +692,8 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
692
692
|
progressBar.style.width = `${percentage}%`;
|
|
693
693
|
}
|
|
694
694
|
},
|
|
695
|
-
rangeStart: { name: 'entry', offset: {
|
|
696
|
-
rangeEnd: { name: 'exit', offset: {
|
|
695
|
+
rangeStart: { name: 'entry', offset: { unit: 'percentage', value: 0 } },
|
|
696
|
+
rangeEnd: { name: 'exit', offset: { unit: 'percentage', value: 100 } },
|
|
697
697
|
fill: 'both',
|
|
698
698
|
effectId: 'stats-counter'
|
|
699
699
|
}
|
|
@@ -748,8 +748,8 @@ These rules help generate scroll-driven list animations using the `@wix/interact
|
|
|
748
748
|
progressIndicator.textContent = `${Math.floor(progress * 100)}% Complete`;
|
|
749
749
|
}
|
|
750
750
|
},
|
|
751
|
-
rangeStart: { name: 'cover', offset: {
|
|
752
|
-
rangeEnd: { name: 'cover', offset: {
|
|
751
|
+
rangeStart: { name: 'cover', offset: { unit: 'percentage', value: 0 } },
|
|
752
|
+
rangeEnd: { name: 'cover', offset: { unit: 'percentage', value: 100 } },
|
|
753
753
|
fill: 'both',
|
|
754
754
|
effectId: 'task-progress'
|
|
755
755
|
}
|
|
@@ -780,8 +780,8 @@ Coordinating container, items, and content simultaneously:
|
|
|
780
780
|
{ transform: 'scale(1) translateY(-50px)', filter: 'blur(2px)' }
|
|
781
781
|
]
|
|
782
782
|
},
|
|
783
|
-
rangeStart: { name: 'cover', offset: {
|
|
784
|
-
rangeEnd: { name: 'cover', offset: {
|
|
783
|
+
rangeStart: { name: 'cover', offset: { unit: 'percentage', value: 0 } },
|
|
784
|
+
rangeEnd: { name: 'cover', offset: { unit: 'percentage', value: 100 } },
|
|
785
785
|
easing: 'linear',
|
|
786
786
|
fill: 'both'
|
|
787
787
|
},
|
|
@@ -795,8 +795,8 @@ Coordinating container, items, and content simultaneously:
|
|
|
795
795
|
{ transform: 'translateX(-50%)' }
|
|
796
796
|
]
|
|
797
797
|
},
|
|
798
|
-
rangeStart: { name: 'contain', offset: {
|
|
799
|
-
rangeEnd: { name: 'contain', offset: {
|
|
798
|
+
rangeStart: { name: 'contain', offset: { unit: 'percentage', value: 0 } },
|
|
799
|
+
rangeEnd: { name: 'contain', offset: { unit: 'percentage', value: 100 } },
|
|
800
800
|
easing: 'linear',
|
|
801
801
|
fill: 'both'
|
|
802
802
|
},
|
|
@@ -810,8 +810,8 @@ Coordinating container, items, and content simultaneously:
|
|
|
810
810
|
{ transform: 'translateY(-100px)', opacity: '1' }
|
|
811
811
|
]
|
|
812
812
|
},
|
|
813
|
-
rangeStart: { name: 'cover', offset: {
|
|
814
|
-
rangeEnd: { name: 'cover', offset: {
|
|
813
|
+
rangeStart: { name: 'cover', offset: { unit: 'percentage', value: 0 } },
|
|
814
|
+
rangeEnd: { name: 'cover', offset: { unit: 'percentage', value: 100 } },
|
|
815
815
|
easing: 'linear',
|
|
816
816
|
fill: 'both'
|
|
817
817
|
}
|
|
@@ -839,8 +839,8 @@ Adaptive patterns based on screen size and device capabilities:
|
|
|
839
839
|
{ transform: 'translateY(0) rotateY(0deg)', boxShadow: '0 0 0 rgb(0 0 0 / 0)' }
|
|
840
840
|
]
|
|
841
841
|
},
|
|
842
|
-
rangeStart: { name: 'entry', offset: {
|
|
843
|
-
rangeEnd: { name: 'entry', offset: {
|
|
842
|
+
rangeStart: { name: 'entry', offset: { unit: 'percentage', value: 0 } },
|
|
843
|
+
rangeEnd: { name: 'entry', offset: { unit: 'percentage', value: 80 } },
|
|
844
844
|
easing: 'cubic-bezier(0.16, 1, 0.3, 1)',
|
|
845
845
|
fill: 'both'
|
|
846
846
|
}
|
|
@@ -861,8 +861,8 @@ Adaptive patterns based on screen size and device capabilities:
|
|
|
861
861
|
{ opacity: '1', transform: 'translateY(0)' }
|
|
862
862
|
]
|
|
863
863
|
},
|
|
864
|
-
rangeStart: { name: 'entry', offset: {
|
|
865
|
-
rangeEnd: { name: 'entry', offset: {
|
|
864
|
+
rangeStart: { name: 'entry', offset: { unit: 'percentage', value: 0 } },
|
|
865
|
+
rangeEnd: { name: 'entry', offset: { unit: 'percentage', value: 60 } },
|
|
866
866
|
easing: 'ease-out',
|
|
867
867
|
fill: 'both'
|
|
868
868
|
}
|
package/rules/viewenter.md
CHANGED
|
@@ -17,7 +17,7 @@ These rules help generate viewport-based interactions using the `@wix/interact`
|
|
|
17
17
|
|
|
18
18
|
```typescript
|
|
19
19
|
{
|
|
20
|
-
key: '[
|
|
20
|
+
key: '[SOURCE_KEY]',
|
|
21
21
|
trigger: 'viewEnter',
|
|
22
22
|
params: {
|
|
23
23
|
type: 'once',
|
|
@@ -26,7 +26,7 @@ These rules help generate viewport-based interactions using the `@wix/interact`
|
|
|
26
26
|
},
|
|
27
27
|
effects: [
|
|
28
28
|
{
|
|
29
|
-
key: '[
|
|
29
|
+
key: '[TARGET_KEY]',
|
|
30
30
|
[EFFECT_TYPE]: [EFFECT_DEFINITION],
|
|
31
31
|
duration: [DURATION_MS],
|
|
32
32
|
easing: '[EASING_FUNCTION]',
|
|
@@ -39,8 +39,8 @@ These rules help generate viewport-based interactions using the `@wix/interact`
|
|
|
39
39
|
|
|
40
40
|
**Variables**:
|
|
41
41
|
|
|
42
|
-
- `[
|
|
43
|
-
- `[
|
|
42
|
+
- `[SOURCE_KEY]`: Unique identifier for element that triggers when visible (often same as target key)
|
|
43
|
+
- `[TARGET_KEY]`: Unique identifier for element to animate (can be same as source or different)
|
|
44
44
|
- `[VISIBILITY_THRESHOLD]`: Number between 0-1 indicating how much of element must be visible (e.g., 0.3 = 30%)
|
|
45
45
|
- `[VIEWPORT_INSETS]`: String insets around viewport (e.g., '50px', '10%', '-100px')
|
|
46
46
|
- `[EFFECT_TYPE]`: Either `namedEffect` or `keyframeEffect`
|
|
@@ -121,7 +121,7 @@ These rules help generate viewport-based interactions using the `@wix/interact`
|
|
|
121
121
|
|
|
122
122
|
```typescript
|
|
123
123
|
{
|
|
124
|
-
key: '[
|
|
124
|
+
key: '[OBSERVER_KEY]',
|
|
125
125
|
trigger: 'viewEnter',
|
|
126
126
|
params: {
|
|
127
127
|
type: 'repeat',
|
|
@@ -130,7 +130,7 @@ These rules help generate viewport-based interactions using the `@wix/interact`
|
|
|
130
130
|
},
|
|
131
131
|
effects: [
|
|
132
132
|
{
|
|
133
|
-
key: '[
|
|
133
|
+
key: '[ANIMATION_TARGET_KEY]',
|
|
134
134
|
[EFFECT_TYPE]: [EFFECT_DEFINITION],
|
|
135
135
|
duration: [DURATION_MS],
|
|
136
136
|
easing: '[EASING_FUNCTION]',
|
|
@@ -143,8 +143,8 @@ These rules help generate viewport-based interactions using the `@wix/interact`
|
|
|
143
143
|
|
|
144
144
|
**Variables**:
|
|
145
145
|
|
|
146
|
-
- `[
|
|
147
|
-
- `[
|
|
146
|
+
- `[OBSERVER_KEY]`: Unique identifier for element that acts as scroll trigger
|
|
147
|
+
- `[ANIMATION_TARGET_KEY]`: Unique identifier for element that gets animated (different from observer)
|
|
148
148
|
- Other variables same as Rule 1
|
|
149
149
|
|
|
150
150
|
**Example - Image Reveal on Scroll**:
|
|
@@ -219,7 +219,7 @@ These rules help generate viewport-based interactions using the `@wix/interact`
|
|
|
219
219
|
|
|
220
220
|
```typescript
|
|
221
221
|
{
|
|
222
|
-
key: '[
|
|
222
|
+
key: '[OBSERVER_KEY]',
|
|
223
223
|
trigger: 'viewEnter',
|
|
224
224
|
params: {
|
|
225
225
|
type: 'alternate',
|
|
@@ -228,7 +228,7 @@ These rules help generate viewport-based interactions using the `@wix/interact`
|
|
|
228
228
|
},
|
|
229
229
|
effects: [
|
|
230
230
|
{
|
|
231
|
-
key: '[
|
|
231
|
+
key: '[ANIMATION_TARGET_KEY]',
|
|
232
232
|
[EFFECT_TYPE]: [EFFECT_DEFINITION],
|
|
233
233
|
duration: [DURATION_MS],
|
|
234
234
|
easing: '[EASING_FUNCTION]',
|
|
@@ -316,7 +316,7 @@ Same as Rule 2
|
|
|
316
316
|
|
|
317
317
|
```typescript
|
|
318
318
|
{
|
|
319
|
-
key: '[
|
|
319
|
+
key: '[SOURCE_KEY]',
|
|
320
320
|
trigger: 'viewEnter',
|
|
321
321
|
params: {
|
|
322
322
|
type: 'state',
|
|
@@ -325,7 +325,7 @@ Same as Rule 2
|
|
|
325
325
|
},
|
|
326
326
|
effects: [
|
|
327
327
|
{
|
|
328
|
-
key: '[
|
|
328
|
+
key: '[TARGET_KEY]',
|
|
329
329
|
[EFFECT_TYPE]: [EFFECT_DEFINITION],
|
|
330
330
|
duration: [DURATION_MS],
|
|
331
331
|
easing: '[EASING_FUNCTION]',
|
|
@@ -417,7 +417,7 @@ Same as Rule 2
|
|
|
417
417
|
|
|
418
418
|
```typescript
|
|
419
419
|
{
|
|
420
|
-
key: '[
|
|
420
|
+
key: '[SOURCE_KEY]',
|
|
421
421
|
trigger: 'viewEnter',
|
|
422
422
|
params: {
|
|
423
423
|
type: '[BEHAVIOR_TYPE]',
|
|
@@ -426,7 +426,7 @@ Same as Rule 2
|
|
|
426
426
|
},
|
|
427
427
|
effects: [
|
|
428
428
|
{
|
|
429
|
-
key: '[
|
|
429
|
+
key: '[TARGET_KEY]',
|
|
430
430
|
[EFFECT_TYPE]: [EFFECT_DEFINITION],
|
|
431
431
|
duration: [DURATION_MS],
|
|
432
432
|
easing: '[EASING_FUNCTION]'
|
|
@@ -576,7 +576,7 @@ Same as Rule 2
|
|
|
576
576
|
|
|
577
577
|
**Variables**:
|
|
578
578
|
|
|
579
|
-
- `[
|
|
579
|
+
- `[ELEMENT_N_KEY]`: Unique identifier for each individual element in sequence
|
|
580
580
|
- `[DELAY_N]`: Progressive delay values (e.g., 0, 100, 200, 300ms)
|
|
581
581
|
- `[SHARED_*]`: Common values used across all elements in the sequence
|
|
582
582
|
- Other variables same as Rule 1
|
|
@@ -597,7 +597,6 @@ Same as Rule 2
|
|
|
597
597
|
namedEffect: {
|
|
598
598
|
type: 'SlideIn',
|
|
599
599
|
direction: 'bottom',
|
|
600
|
-
power: 'medium',
|
|
601
600
|
},
|
|
602
601
|
duration: 600,
|
|
603
602
|
easing: 'ease-out',
|
|
@@ -618,7 +617,6 @@ Same as Rule 2
|
|
|
618
617
|
namedEffect: {
|
|
619
618
|
type: 'SlideIn',
|
|
620
619
|
direction: 'bottom',
|
|
621
|
-
power: 'medium',
|
|
622
620
|
},
|
|
623
621
|
duration: 600,
|
|
624
622
|
easing: 'ease-out',
|
|
@@ -639,7 +637,6 @@ Same as Rule 2
|
|
|
639
637
|
namedEffect: {
|
|
640
638
|
type: 'SlideIn',
|
|
641
639
|
direction: 'bottom',
|
|
642
|
-
power: 'medium',
|
|
643
640
|
},
|
|
644
641
|
duration: 600,
|
|
645
642
|
easing: 'ease-out',
|
|
@@ -885,14 +882,14 @@ Combining with conditions for responsive behavior:
|
|
|
885
882
|
|
|
886
883
|
## Preventing Flash of Unstyled Content (FOUC)
|
|
887
884
|
|
|
888
|
-
When using `viewEnter`
|
|
885
|
+
When using `viewEnter` for entrance animations, elements may briefly appear in their final state before the animation plays. Use the `generate` function to create critical CSS that prevents this.
|
|
889
886
|
|
|
890
887
|
### Using the `generate` Function
|
|
891
888
|
|
|
892
889
|
**Import and generate CSS:**
|
|
893
890
|
|
|
894
|
-
|
|
895
|
-
import { generate } from '@wix/interact';
|
|
891
|
+
```typescript
|
|
892
|
+
import { generate } from '@wix/interact/web';
|
|
896
893
|
|
|
897
894
|
const config: InteractConfig = {
|
|
898
895
|
interactions: [
|
|
@@ -904,19 +901,13 @@ const config: InteractConfig = {
|
|
|
904
901
|
{
|
|
905
902
|
namedEffect: { type: 'FadeIn' },
|
|
906
903
|
duration: 800,
|
|
907
|
-
fill: 'backwards'
|
|
908
|
-
}
|
|
909
|
-
]
|
|
910
|
-
}
|
|
911
|
-
]
|
|
904
|
+
fill: 'backwards',
|
|
905
|
+
},
|
|
906
|
+
],
|
|
907
|
+
},
|
|
908
|
+
],
|
|
912
909
|
};
|
|
913
910
|
|
|
914
|
-
/**Usage:**
|
|
915
|
-
```javascript
|
|
916
|
-
import { generate } from '@wix/interact';
|
|
917
|
-
|
|
918
|
-
const config = {/*...*/};
|
|
919
|
-
|
|
920
911
|
// Generate CSS at build time or on server
|
|
921
912
|
const css = generate(config);
|
|
922
913
|
|
|
@@ -938,7 +929,7 @@ const html = `
|
|
|
938
929
|
</body>
|
|
939
930
|
</html>
|
|
940
931
|
`;
|
|
941
|
-
|
|
932
|
+
```
|
|
942
933
|
|
|
943
934
|
### Generated CSS Behavior
|
|
944
935
|
|