react-awesome-reveal 4.3.0 → 5.0.0-next.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 (122) hide show
  1. package/README.md +16 -207
  2. package/dist/index.d.ts +1 -3
  3. package/dist/index.js +1 -1830
  4. package/dist/keyframes.d.ts +1 -0
  5. package/dist/keyframes.js +1 -0
  6. package/package.json +51 -57
  7. package/skills/migrating-from-v4/SKILL.md +95 -0
  8. package/dist/Reveal.d.ts +0 -69
  9. package/dist/animations/attention_seekers/bounce.d.ts +0 -5
  10. package/dist/animations/attention_seekers/flash.d.ts +0 -5
  11. package/dist/animations/attention_seekers/headShake.d.ts +0 -5
  12. package/dist/animations/attention_seekers/heartBeat.d.ts +0 -5
  13. package/dist/animations/attention_seekers/index.d.ts +0 -13
  14. package/dist/animations/attention_seekers/jello.d.ts +0 -5
  15. package/dist/animations/attention_seekers/pulse.d.ts +0 -5
  16. package/dist/animations/attention_seekers/rubberBand.d.ts +0 -5
  17. package/dist/animations/attention_seekers/shake.d.ts +0 -5
  18. package/dist/animations/attention_seekers/shakeX.d.ts +0 -5
  19. package/dist/animations/attention_seekers/shakeY.d.ts +0 -5
  20. package/dist/animations/attention_seekers/swing.d.ts +0 -5
  21. package/dist/animations/attention_seekers/tada.d.ts +0 -5
  22. package/dist/animations/attention_seekers/wobble.d.ts +0 -5
  23. package/dist/animations/bouncing_entrances/bounceIn.d.ts +0 -5
  24. package/dist/animations/bouncing_entrances/bounceInDown.d.ts +0 -5
  25. package/dist/animations/bouncing_entrances/bounceInLeft.d.ts +0 -5
  26. package/dist/animations/bouncing_entrances/bounceInRight.d.ts +0 -5
  27. package/dist/animations/bouncing_entrances/bounceInUp.d.ts +0 -5
  28. package/dist/animations/bouncing_entrances/index.d.ts +0 -5
  29. package/dist/animations/bouncing_exits/bounceOut.d.ts +0 -5
  30. package/dist/animations/bouncing_exits/bounceOutDown.d.ts +0 -5
  31. package/dist/animations/bouncing_exits/bounceOutLeft.d.ts +0 -5
  32. package/dist/animations/bouncing_exits/bounceOutRight.d.ts +0 -5
  33. package/dist/animations/bouncing_exits/bounceOutUp.d.ts +0 -5
  34. package/dist/animations/bouncing_exits/index.d.ts +0 -5
  35. package/dist/animations/fading_entrances/fadeIn.d.ts +0 -5
  36. package/dist/animations/fading_entrances/fadeInBottomLeft.d.ts +0 -5
  37. package/dist/animations/fading_entrances/fadeInBottomRight.d.ts +0 -5
  38. package/dist/animations/fading_entrances/fadeInDown.d.ts +0 -5
  39. package/dist/animations/fading_entrances/fadeInDownBig.d.ts +0 -5
  40. package/dist/animations/fading_entrances/fadeInLeft.d.ts +0 -5
  41. package/dist/animations/fading_entrances/fadeInLeftBig.d.ts +0 -5
  42. package/dist/animations/fading_entrances/fadeInRight.d.ts +0 -5
  43. package/dist/animations/fading_entrances/fadeInRightBig.d.ts +0 -5
  44. package/dist/animations/fading_entrances/fadeInTopLeft.d.ts +0 -5
  45. package/dist/animations/fading_entrances/fadeInTopRight.d.ts +0 -5
  46. package/dist/animations/fading_entrances/fadeInUp.d.ts +0 -5
  47. package/dist/animations/fading_entrances/fadeInUpBig.d.ts +0 -5
  48. package/dist/animations/fading_entrances/index.d.ts +0 -13
  49. package/dist/animations/fading_exits/fadeOut.d.ts +0 -5
  50. package/dist/animations/fading_exits/fadeOutBottomLeft.d.ts +0 -5
  51. package/dist/animations/fading_exits/fadeOutBottomRight.d.ts +0 -5
  52. package/dist/animations/fading_exits/fadeOutDown.d.ts +0 -5
  53. package/dist/animations/fading_exits/fadeOutDownBig.d.ts +0 -5
  54. package/dist/animations/fading_exits/fadeOutLeft.d.ts +0 -5
  55. package/dist/animations/fading_exits/fadeOutLeftBig.d.ts +0 -5
  56. package/dist/animations/fading_exits/fadeOutRight.d.ts +0 -5
  57. package/dist/animations/fading_exits/fadeOutRightBig.d.ts +0 -5
  58. package/dist/animations/fading_exits/fadeOutTopLeft.d.ts +0 -5
  59. package/dist/animations/fading_exits/fadeOutTopRight.d.ts +0 -5
  60. package/dist/animations/fading_exits/fadeOutUp.d.ts +0 -5
  61. package/dist/animations/fading_exits/fadeOutUpBig.d.ts +0 -5
  62. package/dist/animations/fading_exits/index.d.ts +0 -13
  63. package/dist/animations/flippers/flip.d.ts +0 -5
  64. package/dist/animations/flippers/flipInX.d.ts +0 -5
  65. package/dist/animations/flippers/flipInY.d.ts +0 -5
  66. package/dist/animations/flippers/flipOutX.d.ts +0 -5
  67. package/dist/animations/flippers/flipOutY.d.ts +0 -5
  68. package/dist/animations/flippers/index.d.ts +0 -5
  69. package/dist/animations/rotating_entrances/index.d.ts +0 -5
  70. package/dist/animations/rotating_entrances/rotateIn.d.ts +0 -5
  71. package/dist/animations/rotating_entrances/rotateInDownLeft.d.ts +0 -5
  72. package/dist/animations/rotating_entrances/rotateInDownRight.d.ts +0 -5
  73. package/dist/animations/rotating_entrances/rotateInUpLeft.d.ts +0 -5
  74. package/dist/animations/rotating_entrances/rotateInUpRight.d.ts +0 -5
  75. package/dist/animations/rotating_exits/index.d.ts +0 -5
  76. package/dist/animations/rotating_exits/rotateOut.d.ts +0 -5
  77. package/dist/animations/rotating_exits/rotateOutDownLeft.d.ts +0 -5
  78. package/dist/animations/rotating_exits/rotateOutDownRight.d.ts +0 -5
  79. package/dist/animations/rotating_exits/rotateOutUpLeft.d.ts +0 -5
  80. package/dist/animations/rotating_exits/rotateOutUpRight.d.ts +0 -5
  81. package/dist/animations/sliding_entrances/index.d.ts +0 -4
  82. package/dist/animations/sliding_entrances/slideInDown.d.ts +0 -5
  83. package/dist/animations/sliding_entrances/slideInLeft.d.ts +0 -5
  84. package/dist/animations/sliding_entrances/slideInRight.d.ts +0 -5
  85. package/dist/animations/sliding_entrances/slideInUp.d.ts +0 -5
  86. package/dist/animations/sliding_exits/index.d.ts +0 -4
  87. package/dist/animations/sliding_exits/slideOutDown.d.ts +0 -5
  88. package/dist/animations/sliding_exits/slideOutLeft.d.ts +0 -5
  89. package/dist/animations/sliding_exits/slideOutRight.d.ts +0 -5
  90. package/dist/animations/sliding_exits/slideOutUp.d.ts +0 -5
  91. package/dist/animations/specials/hinge.d.ts +0 -5
  92. package/dist/animations/specials/index.d.ts +0 -4
  93. package/dist/animations/specials/jackInTheBox.d.ts +0 -5
  94. package/dist/animations/specials/rollIn.d.ts +0 -5
  95. package/dist/animations/specials/rollOut.d.ts +0 -5
  96. package/dist/animations/zooming_entrances/index.d.ts +0 -5
  97. package/dist/animations/zooming_entrances/zoomIn.d.ts +0 -5
  98. package/dist/animations/zooming_entrances/zoomInDown.d.ts +0 -5
  99. package/dist/animations/zooming_entrances/zoomInLeft.d.ts +0 -5
  100. package/dist/animations/zooming_entrances/zoomInRight.d.ts +0 -5
  101. package/dist/animations/zooming_entrances/zoomInUp.d.ts +0 -5
  102. package/dist/animations/zooming_exits/index.d.ts +0 -5
  103. package/dist/animations/zooming_exits/zoomOut.d.ts +0 -5
  104. package/dist/animations/zooming_exits/zoomOutDown.d.ts +0 -5
  105. package/dist/animations/zooming_exits/zoomOutLeft.d.ts +0 -5
  106. package/dist/animations/zooming_exits/zoomOutRight.d.ts +0 -5
  107. package/dist/animations/zooming_exits/zoomOutUp.d.ts +0 -5
  108. package/dist/components/AttentionSeeker.d.ts +0 -12
  109. package/dist/components/Bounce.d.ts +0 -17
  110. package/dist/components/Fade.d.ts +0 -22
  111. package/dist/components/Flip.d.ts +0 -17
  112. package/dist/components/Hinge.d.ts +0 -4
  113. package/dist/components/JackInTheBox.d.ts +0 -4
  114. package/dist/components/Roll.d.ts +0 -10
  115. package/dist/components/Rotate.d.ts +0 -17
  116. package/dist/components/Slide.d.ts +0 -17
  117. package/dist/components/Zoom.d.ts +0 -17
  118. package/dist/components/index.d.ts +0 -10
  119. package/dist/index.cjs +0 -1845
  120. package/dist/utils/animations.d.ts +0 -8
  121. package/dist/utils/guards.d.ts +0 -2
  122. package/dist/utils/patterns.d.ts +0 -2
package/dist/index.cjs DELETED
@@ -1,1845 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
-
5
- const jsxRuntime = require('@emotion/react/jsx-runtime');
6
- const react = require('@emotion/react');
7
- const react$1 = require('react');
8
- const reactIntersectionObserver = require('react-intersection-observer');
9
- const reactIs = require('react-is');
10
-
11
- const bounce = react.keyframes`
12
- from,
13
- 20%,
14
- 53%,
15
- to {
16
- animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
17
- transform: translate3d(0, 0, 0);
18
- }
19
-
20
- 40%,
21
- 43% {
22
- animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
23
- transform: translate3d(0, -30px, 0) scaleY(1.1);
24
- }
25
-
26
- 70% {
27
- animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
28
- transform: translate3d(0, -15px, 0) scaleY(1.05);
29
- }
30
-
31
- 80% {
32
- transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
33
- transform: translate3d(0, 0, 0) scaleY(0.95);
34
- }
35
-
36
- 90% {
37
- transform: translate3d(0, -4px, 0) scaleY(1.02);
38
- }
39
- `;
40
-
41
- const flash = react.keyframes`
42
- from,
43
- 50%,
44
- to {
45
- opacity: 1;
46
- }
47
-
48
- 25%,
49
- 75% {
50
- opacity: 0;
51
- }
52
- `;
53
-
54
- const headShake = react.keyframes`
55
- 0% {
56
- transform: translateX(0);
57
- }
58
-
59
- 6.5% {
60
- transform: translateX(-6px) rotateY(-9deg);
61
- }
62
-
63
- 18.5% {
64
- transform: translateX(5px) rotateY(7deg);
65
- }
66
-
67
- 31.5% {
68
- transform: translateX(-3px) rotateY(-5deg);
69
- }
70
-
71
- 43.5% {
72
- transform: translateX(2px) rotateY(3deg);
73
- }
74
-
75
- 50% {
76
- transform: translateX(0);
77
- }
78
- `;
79
-
80
- const heartBeat = react.keyframes`
81
- 0% {
82
- transform: scale(1);
83
- }
84
-
85
- 14% {
86
- transform: scale(1.3);
87
- }
88
-
89
- 28% {
90
- transform: scale(1);
91
- }
92
-
93
- 42% {
94
- transform: scale(1.3);
95
- }
96
-
97
- 70% {
98
- transform: scale(1);
99
- }
100
- `;
101
-
102
- const jello = react.keyframes`
103
- from,
104
- 11.1%,
105
- to {
106
- transform: translate3d(0, 0, 0);
107
- }
108
-
109
- 22.2% {
110
- transform: skewX(-12.5deg) skewY(-12.5deg);
111
- }
112
-
113
- 33.3% {
114
- transform: skewX(6.25deg) skewY(6.25deg);
115
- }
116
-
117
- 44.4% {
118
- transform: skewX(-3.125deg) skewY(-3.125deg);
119
- }
120
-
121
- 55.5% {
122
- transform: skewX(1.5625deg) skewY(1.5625deg);
123
- }
124
-
125
- 66.6% {
126
- transform: skewX(-0.78125deg) skewY(-0.78125deg);
127
- }
128
-
129
- 77.7% {
130
- transform: skewX(0.390625deg) skewY(0.390625deg);
131
- }
132
-
133
- 88.8% {
134
- transform: skewX(-0.1953125deg) skewY(-0.1953125deg);
135
- }
136
- `;
137
-
138
- const pulse = react.keyframes`
139
- from {
140
- transform: scale3d(1, 1, 1);
141
- }
142
-
143
- 50% {
144
- transform: scale3d(1.05, 1.05, 1.05);
145
- }
146
-
147
- to {
148
- transform: scale3d(1, 1, 1);
149
- }
150
- `;
151
-
152
- const rubberBand = react.keyframes`
153
- from {
154
- transform: scale3d(1, 1, 1);
155
- }
156
-
157
- 30% {
158
- transform: scale3d(1.25, 0.75, 1);
159
- }
160
-
161
- 40% {
162
- transform: scale3d(0.75, 1.25, 1);
163
- }
164
-
165
- 50% {
166
- transform: scale3d(1.15, 0.85, 1);
167
- }
168
-
169
- 65% {
170
- transform: scale3d(0.95, 1.05, 1);
171
- }
172
-
173
- 75% {
174
- transform: scale3d(1.05, 0.95, 1);
175
- }
176
-
177
- to {
178
- transform: scale3d(1, 1, 1);
179
- }
180
- `;
181
-
182
- const shake = react.keyframes`
183
- from,
184
- to {
185
- transform: translate3d(0, 0, 0);
186
- }
187
-
188
- 10%,
189
- 30%,
190
- 50%,
191
- 70%,
192
- 90% {
193
- transform: translate3d(-10px, 0, 0);
194
- }
195
-
196
- 20%,
197
- 40%,
198
- 60%,
199
- 80% {
200
- transform: translate3d(10px, 0, 0);
201
- }
202
- `;
203
-
204
- const shakeX = react.keyframes`
205
- from,
206
- to {
207
- transform: translate3d(0, 0, 0);
208
- }
209
-
210
- 10%,
211
- 30%,
212
- 50%,
213
- 70%,
214
- 90% {
215
- transform: translate3d(-10px, 0, 0);
216
- }
217
-
218
- 20%,
219
- 40%,
220
- 60%,
221
- 80% {
222
- transform: translate3d(10px, 0, 0);
223
- }
224
- `;
225
-
226
- const shakeY = react.keyframes`
227
- from,
228
- to {
229
- transform: translate3d(0, 0, 0);
230
- }
231
-
232
- 10%,
233
- 30%,
234
- 50%,
235
- 70%,
236
- 90% {
237
- transform: translate3d(0, -10px, 0);
238
- }
239
-
240
- 20%,
241
- 40%,
242
- 60%,
243
- 80% {
244
- transform: translate3d(0, 10px, 0);
245
- }
246
- `;
247
-
248
- const swing = react.keyframes`
249
- 20% {
250
- transform: rotate3d(0, 0, 1, 15deg);
251
- }
252
-
253
- 40% {
254
- transform: rotate3d(0, 0, 1, -10deg);
255
- }
256
-
257
- 60% {
258
- transform: rotate3d(0, 0, 1, 5deg);
259
- }
260
-
261
- 80% {
262
- transform: rotate3d(0, 0, 1, -5deg);
263
- }
264
-
265
- to {
266
- transform: rotate3d(0, 0, 1, 0deg);
267
- }
268
- `;
269
-
270
- const tada = react.keyframes`
271
- from {
272
- transform: scale3d(1, 1, 1);
273
- }
274
-
275
- 10%,
276
- 20% {
277
- transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
278
- }
279
-
280
- 30%,
281
- 50%,
282
- 70%,
283
- 90% {
284
- transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
285
- }
286
-
287
- 40%,
288
- 60%,
289
- 80% {
290
- transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
291
- }
292
-
293
- to {
294
- transform: scale3d(1, 1, 1);
295
- }
296
- `;
297
-
298
- const wobble = react.keyframes`
299
- from {
300
- transform: translate3d(0, 0, 0);
301
- }
302
-
303
- 15% {
304
- transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg);
305
- }
306
-
307
- 30% {
308
- transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg);
309
- }
310
-
311
- 45% {
312
- transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg);
313
- }
314
-
315
- 60% {
316
- transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg);
317
- }
318
-
319
- 75% {
320
- transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg);
321
- }
322
-
323
- to {
324
- transform: translate3d(0, 0, 0);
325
- }
326
- `;
327
-
328
- const fadeIn = react.keyframes`
329
- from {
330
- opacity: 0;
331
- }
332
-
333
- to {
334
- opacity: 1;
335
- }
336
- `;
337
-
338
- const fadeInBottomLeft = react.keyframes`
339
- from {
340
- opacity: 0;
341
- transform: translate3d(-100%, 100%, 0);
342
- }
343
-
344
- to {
345
- opacity: 1;
346
- transform: translate3d(0, 0, 0);
347
- }
348
- `;
349
-
350
- const fadeInBottomRight = react.keyframes`
351
- from {
352
- opacity: 0;
353
- transform: translate3d(100%, 100%, 0);
354
- }
355
-
356
- to {
357
- opacity: 1;
358
- transform: translate3d(0, 0, 0);
359
- }
360
- `;
361
-
362
- const fadeInDown = react.keyframes`
363
- from {
364
- opacity: 0;
365
- transform: translate3d(0, -100%, 0);
366
- }
367
-
368
- to {
369
- opacity: 1;
370
- transform: translate3d(0, 0, 0);
371
- }
372
- `;
373
-
374
- const fadeInDownBig = react.keyframes`
375
- from {
376
- opacity: 0;
377
- transform: translate3d(0, -2000px, 0);
378
- }
379
-
380
- to {
381
- opacity: 1;
382
- transform: translate3d(0, 0, 0);
383
- }
384
- `;
385
-
386
- const fadeInLeft = react.keyframes`
387
- from {
388
- opacity: 0;
389
- transform: translate3d(-100%, 0, 0);
390
- }
391
-
392
- to {
393
- opacity: 1;
394
- transform: translate3d(0, 0, 0);
395
- }
396
- `;
397
-
398
- const fadeInLeftBig = react.keyframes`
399
- from {
400
- opacity: 0;
401
- transform: translate3d(-2000px, 0, 0);
402
- }
403
-
404
- to {
405
- opacity: 1;
406
- transform: translate3d(0, 0, 0);
407
- }
408
- `;
409
-
410
- const fadeInRight = react.keyframes`
411
- from {
412
- opacity: 0;
413
- transform: translate3d(100%, 0, 0);
414
- }
415
-
416
- to {
417
- opacity: 1;
418
- transform: translate3d(0, 0, 0);
419
- }
420
- `;
421
-
422
- const fadeInRightBig = react.keyframes`
423
- from {
424
- opacity: 0;
425
- transform: translate3d(2000px, 0, 0);
426
- }
427
-
428
- to {
429
- opacity: 1;
430
- transform: translate3d(0, 0, 0);
431
- }
432
- `;
433
-
434
- const fadeInTopLeft = react.keyframes`
435
- from {
436
- opacity: 0;
437
- transform: translate3d(-100%, -100%, 0);
438
- }
439
-
440
- to {
441
- opacity: 1;
442
- transform: translate3d(0, 0, 0);
443
- }
444
- `;
445
-
446
- const fadeInTopRight = react.keyframes`
447
- from {
448
- opacity: 0;
449
- transform: translate3d(100%, -100%, 0);
450
- }
451
-
452
- to {
453
- opacity: 1;
454
- transform: translate3d(0, 0, 0);
455
- }
456
- `;
457
-
458
- const fadeInUp = react.keyframes`
459
- from {
460
- opacity: 0;
461
- transform: translate3d(0, 100%, 0);
462
- }
463
-
464
- to {
465
- opacity: 1;
466
- transform: translate3d(0, 0, 0);
467
- }
468
- `;
469
-
470
- const fadeInUpBig = react.keyframes`
471
- from {
472
- opacity: 0;
473
- transform: translate3d(0, 2000px, 0);
474
- }
475
-
476
- to {
477
- opacity: 1;
478
- transform: translate3d(0, 0, 0);
479
- }
480
- `;
481
-
482
- function getAnimationCss({
483
- duration = 1e3,
484
- delay = 0,
485
- timingFunction = "ease",
486
- keyframes = fadeInLeft,
487
- iterationCount = 1
488
- }) {
489
- return react.css`
490
- animation-duration: ${duration}ms;
491
- animation-timing-function: ${timingFunction};
492
- animation-delay: ${delay}ms;
493
- animation-name: ${keyframes};
494
- animation-direction: normal;
495
- animation-fill-mode: both;
496
- animation-iteration-count: ${iterationCount};
497
-
498
- @media (prefers-reduced-motion: reduce) {
499
- animation: none;
500
- }
501
- `;
502
- }
503
-
504
- function isNullable(a) {
505
- return a == void 0;
506
- }
507
- function isStringLike(value) {
508
- return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
509
- }
510
-
511
- function matchIf(onTrue, onFalse) {
512
- return (condition) => condition ? onTrue() : onFalse();
513
- }
514
- function matchIfOrNull(onTrue) {
515
- return matchIf(onTrue, () => null);
516
- }
517
-
518
- function hideWhen(condition) {
519
- return matchIfOrNull(() => ({ opacity: 0 }))(condition);
520
- }
521
- const Reveal = (props) => {
522
- const {
523
- cascade = false,
524
- damping = 0.5,
525
- delay = 0,
526
- duration = 1e3,
527
- fraction = 0,
528
- keyframes = fadeInLeft,
529
- triggerOnce = false,
530
- className,
531
- style,
532
- childClassName,
533
- childStyle,
534
- children,
535
- onVisibilityChange
536
- } = props;
537
- const animationStyles = react$1.useMemo(
538
- () => getAnimationCss({
539
- keyframes,
540
- duration
541
- }),
542
- [duration, keyframes]
543
- );
544
- if (isNullable(children)) return null;
545
- if (isStringLike(children))
546
- return /* @__PURE__ */ jsxRuntime.jsx(TextReveal, { ...props, animationStyles, children: String(children) });
547
- if (reactIs.isFragment(children))
548
- return /* @__PURE__ */ jsxRuntime.jsx(FragmentReveal, { ...props, animationStyles });
549
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: react$1.Children.map(children, (node, index) => {
550
- if (!react$1.isValidElement(node)) return null;
551
- const nodeDelay = delay + (cascade ? index * duration * damping : 0);
552
- switch (node.type) {
553
- case "ol":
554
- case "ul":
555
- return /* @__PURE__ */ jsxRuntime.jsx(react.ClassNames, { children: ({ cx }) => /* @__PURE__ */ jsxRuntime.jsx(
556
- node.type,
557
- {
558
- ...node.props,
559
- className: cx(className, node.props.className),
560
- style: Object.assign({}, style, node.props.style),
561
- children: /* @__PURE__ */ jsxRuntime.jsx(Reveal, { ...props, children: node.props.children })
562
- }
563
- ) });
564
- case "li":
565
- return /* @__PURE__ */ jsxRuntime.jsx(
566
- reactIntersectionObserver.InView,
567
- {
568
- threshold: fraction,
569
- triggerOnce,
570
- onChange: onVisibilityChange,
571
- children: ({ inView, ref }) => /* @__PURE__ */ jsxRuntime.jsx(react.ClassNames, { children: ({ cx }) => /* @__PURE__ */ jsxRuntime.jsx(
572
- node.type,
573
- {
574
- ...node.props,
575
- ref,
576
- className: cx(childClassName, node.props.className),
577
- css: matchIfOrNull(() => animationStyles)(inView),
578
- style: Object.assign(
579
- {},
580
- childStyle,
581
- node.props.style,
582
- hideWhen(!inView),
583
- {
584
- animationDelay: nodeDelay + "ms"
585
- }
586
- )
587
- }
588
- ) })
589
- }
590
- );
591
- default:
592
- return /* @__PURE__ */ jsxRuntime.jsx(
593
- reactIntersectionObserver.InView,
594
- {
595
- threshold: fraction,
596
- triggerOnce,
597
- onChange: onVisibilityChange,
598
- children: ({ inView, ref }) => /* @__PURE__ */ jsxRuntime.jsx(
599
- "div",
600
- {
601
- ref,
602
- className,
603
- css: matchIfOrNull(() => animationStyles)(inView),
604
- style: Object.assign({}, style, hideWhen(!inView), {
605
- animationDelay: nodeDelay + "ms"
606
- }),
607
- children: /* @__PURE__ */ jsxRuntime.jsx(react.ClassNames, { children: ({ cx }) => /* @__PURE__ */ jsxRuntime.jsx(
608
- node.type,
609
- {
610
- ...node.props,
611
- className: cx(childClassName, node.props.className),
612
- style: Object.assign(
613
- {},
614
- childStyle,
615
- node.props.style
616
- )
617
- }
618
- ) })
619
- }
620
- )
621
- }
622
- );
623
- }
624
- }) });
625
- };
626
- const textBaseStyles = {
627
- display: "inline-block",
628
- whiteSpace: "pre"
629
- };
630
- const TextReveal = (props) => {
631
- const {
632
- animationStyles,
633
- cascade = false,
634
- damping = 0.5,
635
- delay = 0,
636
- duration = 1e3,
637
- fraction = 0,
638
- triggerOnce = false,
639
- className,
640
- style,
641
- children,
642
- onVisibilityChange
643
- } = props;
644
- const { ref, inView } = reactIntersectionObserver.useInView({
645
- triggerOnce,
646
- threshold: fraction,
647
- onChange: onVisibilityChange
648
- });
649
- return matchIf(
650
- () => /* @__PURE__ */ jsxRuntime.jsx(
651
- "div",
652
- {
653
- ref,
654
- className,
655
- style: Object.assign({}, style, textBaseStyles),
656
- children: children.split("").map((char, index) => /* @__PURE__ */ jsxRuntime.jsx(
657
- "span",
658
- {
659
- css: matchIfOrNull(() => animationStyles)(inView),
660
- style: {
661
- animationDelay: delay + index * duration * damping + "ms"
662
- },
663
- children: char
664
- },
665
- index
666
- ))
667
- }
668
- ),
669
- () => /* @__PURE__ */ jsxRuntime.jsx(FragmentReveal, { ...props, children })
670
- )(cascade);
671
- };
672
- const FragmentReveal = (props) => {
673
- const {
674
- animationStyles,
675
- fraction = 0,
676
- triggerOnce = false,
677
- className,
678
- style,
679
- children,
680
- onVisibilityChange
681
- } = props;
682
- const { ref, inView } = reactIntersectionObserver.useInView({
683
- triggerOnce,
684
- threshold: fraction,
685
- onChange: onVisibilityChange
686
- });
687
- return /* @__PURE__ */ jsxRuntime.jsx(
688
- "div",
689
- {
690
- ref,
691
- className,
692
- css: matchIfOrNull(() => animationStyles)(inView),
693
- style: Object.assign({}, style, hideWhen(!inView)),
694
- children
695
- }
696
- );
697
- };
698
-
699
- function getStyles$7(effect) {
700
- switch (effect) {
701
- case "bounce":
702
- return [bounce, { transformOrigin: "center bottom" }];
703
- case "flash":
704
- return [flash];
705
- case "headShake":
706
- return [headShake, { animationTimingFunction: "ease-in-out" }];
707
- case "heartBeat":
708
- return [heartBeat, { animationTimingFunction: "ease-in-out" }];
709
- case "jello":
710
- return [jello, { transformOrigin: "center" }];
711
- case "pulse":
712
- return [pulse, { animationTimingFunction: "ease-in-out" }];
713
- case "rubberBand":
714
- return [rubberBand];
715
- case "shake":
716
- return [shake];
717
- case "shakeX":
718
- return [shakeX];
719
- case "shakeY":
720
- return [shakeY];
721
- case "swing":
722
- return [swing, { transformOrigin: "top center" }];
723
- case "tada":
724
- return [tada];
725
- case "wobble":
726
- return [wobble];
727
- }
728
- }
729
- const AttentionSeeker = (props) => {
730
- const { effect = "bounce", style, ...rest } = props;
731
- const [keyframes, animationCss] = react$1.useMemo(() => getStyles$7(effect), [effect]);
732
- return /* @__PURE__ */ jsxRuntime.jsx(
733
- Reveal,
734
- {
735
- keyframes,
736
- style: Object.assign({}, style, animationCss),
737
- ...rest
738
- }
739
- );
740
- };
741
-
742
- const bounceIn = react.keyframes`
743
- from,
744
- 20%,
745
- 40%,
746
- 60%,
747
- 80%,
748
- to {
749
- animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
750
- }
751
-
752
- 0% {
753
- opacity: 0;
754
- transform: scale3d(0.3, 0.3, 0.3);
755
- }
756
-
757
- 20% {
758
- transform: scale3d(1.1, 1.1, 1.1);
759
- }
760
-
761
- 40% {
762
- transform: scale3d(0.9, 0.9, 0.9);
763
- }
764
-
765
- 60% {
766
- opacity: 1;
767
- transform: scale3d(1.03, 1.03, 1.03);
768
- }
769
-
770
- 80% {
771
- transform: scale3d(0.97, 0.97, 0.97);
772
- }
773
-
774
- to {
775
- opacity: 1;
776
- transform: scale3d(1, 1, 1);
777
- }
778
- `;
779
-
780
- const bounceInDown = react.keyframes`
781
- from,
782
- 60%,
783
- 75%,
784
- 90%,
785
- to {
786
- animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
787
- }
788
-
789
- 0% {
790
- opacity: 0;
791
- transform: translate3d(0, -3000px, 0) scaleY(3);
792
- }
793
-
794
- 60% {
795
- opacity: 1;
796
- transform: translate3d(0, 25px, 0) scaleY(0.9);
797
- }
798
-
799
- 75% {
800
- transform: translate3d(0, -10px, 0) scaleY(0.95);
801
- }
802
-
803
- 90% {
804
- transform: translate3d(0, 5px, 0) scaleY(0.985);
805
- }
806
-
807
- to {
808
- transform: translate3d(0, 0, 0);
809
- }
810
- `;
811
-
812
- const bounceInLeft = react.keyframes`
813
- from,
814
- 60%,
815
- 75%,
816
- 90%,
817
- to {
818
- animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
819
- }
820
-
821
- 0% {
822
- opacity: 0;
823
- transform: translate3d(-3000px, 0, 0) scaleX(3);
824
- }
825
-
826
- 60% {
827
- opacity: 1;
828
- transform: translate3d(25px, 0, 0) scaleX(1);
829
- }
830
-
831
- 75% {
832
- transform: translate3d(-10px, 0, 0) scaleX(0.98);
833
- }
834
-
835
- 90% {
836
- transform: translate3d(5px, 0, 0) scaleX(0.995);
837
- }
838
-
839
- to {
840
- transform: translate3d(0, 0, 0);
841
- }
842
- `;
843
-
844
- const bounceInRight = react.keyframes`
845
- from,
846
- 60%,
847
- 75%,
848
- 90%,
849
- to {
850
- animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
851
- }
852
-
853
- from {
854
- opacity: 0;
855
- transform: translate3d(3000px, 0, 0) scaleX(3);
856
- }
857
-
858
- 60% {
859
- opacity: 1;
860
- transform: translate3d(-25px, 0, 0) scaleX(1);
861
- }
862
-
863
- 75% {
864
- transform: translate3d(10px, 0, 0) scaleX(0.98);
865
- }
866
-
867
- 90% {
868
- transform: translate3d(-5px, 0, 0) scaleX(0.995);
869
- }
870
-
871
- to {
872
- transform: translate3d(0, 0, 0);
873
- }
874
- `;
875
-
876
- const bounceInUp = react.keyframes`
877
- from,
878
- 60%,
879
- 75%,
880
- 90%,
881
- to {
882
- animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
883
- }
884
-
885
- from {
886
- opacity: 0;
887
- transform: translate3d(0, 3000px, 0) scaleY(5);
888
- }
889
-
890
- 60% {
891
- opacity: 1;
892
- transform: translate3d(0, -20px, 0) scaleY(0.9);
893
- }
894
-
895
- 75% {
896
- transform: translate3d(0, 10px, 0) scaleY(0.95);
897
- }
898
-
899
- 90% {
900
- transform: translate3d(0, -5px, 0) scaleY(0.985);
901
- }
902
-
903
- to {
904
- transform: translate3d(0, 0, 0);
905
- }
906
- `;
907
-
908
- const bounceOut = react.keyframes`
909
- 20% {
910
- transform: scale3d(0.9, 0.9, 0.9);
911
- }
912
-
913
- 50%,
914
- 55% {
915
- opacity: 1;
916
- transform: scale3d(1.1, 1.1, 1.1);
917
- }
918
-
919
- to {
920
- opacity: 0;
921
- transform: scale3d(0.3, 0.3, 0.3);
922
- }
923
- `;
924
-
925
- const bounceOutDown = react.keyframes`
926
- 20% {
927
- transform: translate3d(0, 10px, 0) scaleY(0.985);
928
- }
929
-
930
- 40%,
931
- 45% {
932
- opacity: 1;
933
- transform: translate3d(0, -20px, 0) scaleY(0.9);
934
- }
935
-
936
- to {
937
- opacity: 0;
938
- transform: translate3d(0, 2000px, 0) scaleY(3);
939
- }
940
- `;
941
-
942
- const bounceOutLeft = react.keyframes`
943
- 20% {
944
- opacity: 1;
945
- transform: translate3d(20px, 0, 0) scaleX(0.9);
946
- }
947
-
948
- to {
949
- opacity: 0;
950
- transform: translate3d(-2000px, 0, 0) scaleX(2);
951
- }
952
- `;
953
-
954
- const bounceOutRight = react.keyframes`
955
- 20% {
956
- opacity: 1;
957
- transform: translate3d(-20px, 0, 0) scaleX(0.9);
958
- }
959
-
960
- to {
961
- opacity: 0;
962
- transform: translate3d(2000px, 0, 0) scaleX(2);
963
- }
964
- `;
965
-
966
- const bounceOutUp = react.keyframes`
967
- 20% {
968
- transform: translate3d(0, -10px, 0) scaleY(0.985);
969
- }
970
-
971
- 40%,
972
- 45% {
973
- opacity: 1;
974
- transform: translate3d(0, 20px, 0) scaleY(0.9);
975
- }
976
-
977
- to {
978
- opacity: 0;
979
- transform: translate3d(0, -2000px, 0) scaleY(3);
980
- }
981
- `;
982
-
983
- function getStyles$6(reverse, direction) {
984
- switch (direction) {
985
- case "down":
986
- return reverse ? bounceOutDown : bounceInDown;
987
- case "left":
988
- return reverse ? bounceOutLeft : bounceInLeft;
989
- case "right":
990
- return reverse ? bounceOutRight : bounceInRight;
991
- case "up":
992
- return reverse ? bounceOutUp : bounceInUp;
993
- default:
994
- return reverse ? bounceOut : bounceIn;
995
- }
996
- }
997
- const Bounce = (props) => {
998
- const { direction, reverse = false, ...rest } = props;
999
- const keyframes = react$1.useMemo(
1000
- () => getStyles$6(reverse, direction),
1001
- [direction, reverse]
1002
- );
1003
- return /* @__PURE__ */ jsxRuntime.jsx(Reveal, { keyframes, ...rest });
1004
- };
1005
-
1006
- const fadeOut = react.keyframes`
1007
- from {
1008
- opacity: 1;
1009
- }
1010
-
1011
- to {
1012
- opacity: 0;
1013
- }
1014
- `;
1015
-
1016
- const fadeOutBottomLeft = react.keyframes`
1017
- from {
1018
- opacity: 1;
1019
- transform: translate3d(0, 0, 0);
1020
- }
1021
-
1022
- to {
1023
- opacity: 0;
1024
- transform: translate3d(-100%, 100%, 0);
1025
- }
1026
- `;
1027
-
1028
- const fadeOutBottomRight = react.keyframes`
1029
- from {
1030
- opacity: 1;
1031
- transform: translate3d(0, 0, 0);
1032
- }
1033
-
1034
- to {
1035
- opacity: 0;
1036
- transform: translate3d(100%, 100%, 0);
1037
- }
1038
- `;
1039
-
1040
- const fadeOutDown = react.keyframes`
1041
- from {
1042
- opacity: 1;
1043
- }
1044
-
1045
- to {
1046
- opacity: 0;
1047
- transform: translate3d(0, 100%, 0);
1048
- }
1049
- `;
1050
-
1051
- const fadeOutDownBig = react.keyframes`
1052
- from {
1053
- opacity: 1;
1054
- }
1055
-
1056
- to {
1057
- opacity: 0;
1058
- transform: translate3d(0, 2000px, 0);
1059
- }
1060
- `;
1061
-
1062
- const fadeOutLeft = react.keyframes`
1063
- from {
1064
- opacity: 1;
1065
- }
1066
-
1067
- to {
1068
- opacity: 0;
1069
- transform: translate3d(-100%, 0, 0);
1070
- }
1071
- `;
1072
-
1073
- const fadeOutLeftBig = react.keyframes`
1074
- from {
1075
- opacity: 1;
1076
- }
1077
-
1078
- to {
1079
- opacity: 0;
1080
- transform: translate3d(-2000px, 0, 0);
1081
- }
1082
- `;
1083
-
1084
- const fadeOutRight = react.keyframes`
1085
- from {
1086
- opacity: 1;
1087
- }
1088
-
1089
- to {
1090
- opacity: 0;
1091
- transform: translate3d(100%, 0, 0);
1092
- }
1093
- `;
1094
-
1095
- const fadeOutRightBig = react.keyframes`
1096
- from {
1097
- opacity: 1;
1098
- }
1099
-
1100
- to {
1101
- opacity: 0;
1102
- transform: translate3d(2000px, 0, 0);
1103
- }
1104
- `;
1105
-
1106
- const fadeOutTopLeft = react.keyframes`
1107
- from {
1108
- opacity: 1;
1109
- transform: translate3d(0, 0, 0);
1110
- }
1111
-
1112
- to {
1113
- opacity: 0;
1114
- transform: translate3d(-100%, -100%, 0);
1115
- }
1116
- `;
1117
-
1118
- const fadeOutTopRight = react.keyframes`
1119
- from {
1120
- opacity: 1;
1121
- transform: translate3d(0, 0, 0);
1122
- }
1123
-
1124
- to {
1125
- opacity: 0;
1126
- transform: translate3d(100%, -100%, 0);
1127
- }
1128
- `;
1129
-
1130
- const fadeOutUp = react.keyframes`
1131
- from {
1132
- opacity: 1;
1133
- }
1134
-
1135
- to {
1136
- opacity: 0;
1137
- transform: translate3d(0, -100%, 0);
1138
- }
1139
- `;
1140
-
1141
- const fadeOutUpBig = react.keyframes`
1142
- from {
1143
- opacity: 1;
1144
- }
1145
-
1146
- to {
1147
- opacity: 0;
1148
- transform: translate3d(0, -2000px, 0);
1149
- }
1150
- `;
1151
-
1152
- function getStyles$5(big, reverse, direction) {
1153
- switch (direction) {
1154
- case "bottom-left":
1155
- return reverse ? fadeOutBottomLeft : fadeInBottomLeft;
1156
- case "bottom-right":
1157
- return reverse ? fadeOutBottomRight : fadeInBottomRight;
1158
- case "down":
1159
- return big ? reverse ? fadeOutDownBig : fadeInDownBig : reverse ? fadeOutDown : fadeInDown;
1160
- case "left":
1161
- return big ? reverse ? fadeOutLeftBig : fadeInLeftBig : reverse ? fadeOutLeft : fadeInLeft;
1162
- case "right":
1163
- return big ? reverse ? fadeOutRightBig : fadeInRightBig : reverse ? fadeOutRight : fadeInRight;
1164
- case "top-left":
1165
- return reverse ? fadeOutTopLeft : fadeInTopLeft;
1166
- case "top-right":
1167
- return reverse ? fadeOutTopRight : fadeInTopRight;
1168
- case "up":
1169
- return big ? reverse ? fadeOutUpBig : fadeInUpBig : reverse ? fadeOutUp : fadeInUp;
1170
- default:
1171
- return reverse ? fadeOut : fadeIn;
1172
- }
1173
- }
1174
- const Fade = (props) => {
1175
- const { big = false, direction, reverse = false, ...rest } = props;
1176
- const keyframes = react$1.useMemo(
1177
- () => getStyles$5(big, reverse, direction),
1178
- [big, direction, reverse]
1179
- );
1180
- return /* @__PURE__ */ jsxRuntime.jsx(Reveal, { keyframes, ...rest });
1181
- };
1182
-
1183
- const flip = react.keyframes`
1184
- from {
1185
- transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, -360deg);
1186
- animation-timing-function: ease-out;
1187
- }
1188
-
1189
- 40% {
1190
- transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px)
1191
- rotate3d(0, 1, 0, -190deg);
1192
- animation-timing-function: ease-out;
1193
- }
1194
-
1195
- 50% {
1196
- transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px)
1197
- rotate3d(0, 1, 0, -170deg);
1198
- animation-timing-function: ease-in;
1199
- }
1200
-
1201
- 80% {
1202
- transform: perspective(400px) scale3d(0.95, 0.95, 0.95) translate3d(0, 0, 0)
1203
- rotate3d(0, 1, 0, 0deg);
1204
- animation-timing-function: ease-in;
1205
- }
1206
-
1207
- to {
1208
- transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, 0deg);
1209
- animation-timing-function: ease-in;
1210
- }
1211
- `;
1212
-
1213
- const flipInX = react.keyframes`
1214
- from {
1215
- transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
1216
- animation-timing-function: ease-in;
1217
- opacity: 0;
1218
- }
1219
-
1220
- 40% {
1221
- transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
1222
- animation-timing-function: ease-in;
1223
- }
1224
-
1225
- 60% {
1226
- transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
1227
- opacity: 1;
1228
- }
1229
-
1230
- 80% {
1231
- transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
1232
- }
1233
-
1234
- to {
1235
- transform: perspective(400px);
1236
- }
1237
- `;
1238
-
1239
- const flipInY = react.keyframes`
1240
- from {
1241
- transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
1242
- animation-timing-function: ease-in;
1243
- opacity: 0;
1244
- }
1245
-
1246
- 40% {
1247
- transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
1248
- animation-timing-function: ease-in;
1249
- }
1250
-
1251
- 60% {
1252
- transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
1253
- opacity: 1;
1254
- }
1255
-
1256
- 80% {
1257
- transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
1258
- }
1259
-
1260
- to {
1261
- transform: perspective(400px);
1262
- }
1263
- `;
1264
-
1265
- const flipOutX = react.keyframes`
1266
- from {
1267
- transform: perspective(400px);
1268
- }
1269
-
1270
- 30% {
1271
- transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
1272
- opacity: 1;
1273
- }
1274
-
1275
- to {
1276
- transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
1277
- opacity: 0;
1278
- }
1279
- `;
1280
-
1281
- const flipOutY = react.keyframes`
1282
- from {
1283
- transform: perspective(400px);
1284
- }
1285
-
1286
- 30% {
1287
- transform: perspective(400px) rotate3d(0, 1, 0, -15deg);
1288
- opacity: 1;
1289
- }
1290
-
1291
- to {
1292
- transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
1293
- opacity: 0;
1294
- }
1295
- `;
1296
-
1297
- function getStyles$4(reverse, direction) {
1298
- switch (direction) {
1299
- case "horizontal":
1300
- return reverse ? flipOutX : flipInX;
1301
- case "vertical":
1302
- return reverse ? flipOutY : flipInY;
1303
- default:
1304
- return flip;
1305
- }
1306
- }
1307
- const animationCss$1 = {
1308
- backfaceVisibility: "visible"
1309
- };
1310
- const Flip = (props) => {
1311
- const { direction, reverse = false, style, ...rest } = props;
1312
- const keyframes = react$1.useMemo(
1313
- () => getStyles$4(reverse, direction),
1314
- [direction, reverse]
1315
- );
1316
- return /* @__PURE__ */ jsxRuntime.jsx(
1317
- Reveal,
1318
- {
1319
- keyframes,
1320
- style: Object.assign({}, style, animationCss$1),
1321
- ...rest
1322
- }
1323
- );
1324
- };
1325
-
1326
- const hinge = react.keyframes`
1327
- 0% {
1328
- animation-timing-function: ease-in-out;
1329
- }
1330
-
1331
- 20%,
1332
- 60% {
1333
- transform: rotate3d(0, 0, 1, 80deg);
1334
- animation-timing-function: ease-in-out;
1335
- }
1336
-
1337
- 40%,
1338
- 80% {
1339
- transform: rotate3d(0, 0, 1, 60deg);
1340
- animation-timing-function: ease-in-out;
1341
- opacity: 1;
1342
- }
1343
-
1344
- to {
1345
- transform: translate3d(0, 700px, 0);
1346
- opacity: 0;
1347
- }
1348
- `;
1349
-
1350
- const jackInTheBox = react.keyframes`
1351
- from {
1352
- opacity: 0;
1353
- transform: scale(0.1) rotate(30deg);
1354
- transform-origin: center bottom;
1355
- }
1356
-
1357
- 50% {
1358
- transform: rotate(-10deg);
1359
- }
1360
-
1361
- 70% {
1362
- transform: rotate(3deg);
1363
- }
1364
-
1365
- to {
1366
- opacity: 1;
1367
- transform: scale(1);
1368
- }
1369
- `;
1370
-
1371
- const rollIn = react.keyframes`
1372
- from {
1373
- opacity: 0;
1374
- transform: translate3d(-100%, 0, 0) rotate3d(0, 0, 1, -120deg);
1375
- }
1376
-
1377
- to {
1378
- opacity: 1;
1379
- transform: translate3d(0, 0, 0);
1380
- }
1381
- `;
1382
-
1383
- const rollOut = react.keyframes`
1384
- from {
1385
- opacity: 1;
1386
- }
1387
-
1388
- to {
1389
- opacity: 0;
1390
- transform: translate3d(100%, 0, 0) rotate3d(0, 0, 1, 120deg);
1391
- }
1392
- `;
1393
-
1394
- const animationCss = {
1395
- transformOrigin: "top left"
1396
- };
1397
- const Hinge = (props) => {
1398
- const { style, ...rest } = props;
1399
- return /* @__PURE__ */ jsxRuntime.jsx(
1400
- Reveal,
1401
- {
1402
- keyframes: hinge,
1403
- style: Object.assign({}, style, animationCss),
1404
- ...rest
1405
- }
1406
- );
1407
- };
1408
-
1409
- const JackInTheBox = (props) => {
1410
- return /* @__PURE__ */ jsxRuntime.jsx(Reveal, { keyframes: jackInTheBox, ...props });
1411
- };
1412
-
1413
- function getStyles$3(reverse) {
1414
- return reverse ? rollOut : rollIn;
1415
- }
1416
- const Roll = (props) => {
1417
- const { reverse = false, ...rest } = props;
1418
- const keyframes = react$1.useMemo(() => getStyles$3(reverse), [reverse]);
1419
- return /* @__PURE__ */ jsxRuntime.jsx(Reveal, { keyframes, ...rest });
1420
- };
1421
-
1422
- const rotateIn = react.keyframes`
1423
- from {
1424
- transform: rotate3d(0, 0, 1, -200deg);
1425
- opacity: 0;
1426
- }
1427
-
1428
- to {
1429
- transform: translate3d(0, 0, 0);
1430
- opacity: 1;
1431
- }
1432
- `;
1433
-
1434
- const rotateInDownLeft = react.keyframes`
1435
- from {
1436
- transform: rotate3d(0, 0, 1, -45deg);
1437
- opacity: 0;
1438
- }
1439
-
1440
- to {
1441
- transform: translate3d(0, 0, 0);
1442
- opacity: 1;
1443
- }
1444
- `;
1445
-
1446
- const rotateInDownRight = react.keyframes`
1447
- from {
1448
- transform: rotate3d(0, 0, 1, 45deg);
1449
- opacity: 0;
1450
- }
1451
-
1452
- to {
1453
- transform: translate3d(0, 0, 0);
1454
- opacity: 1;
1455
- }
1456
- `;
1457
-
1458
- const rotateInUpLeft = react.keyframes`
1459
- from {
1460
- transform: rotate3d(0, 0, 1, 45deg);
1461
- opacity: 0;
1462
- }
1463
-
1464
- to {
1465
- transform: translate3d(0, 0, 0);
1466
- opacity: 1;
1467
- }
1468
- `;
1469
-
1470
- const rotateInUpRight = react.keyframes`
1471
- from {
1472
- transform: rotate3d(0, 0, 1, -90deg);
1473
- opacity: 0;
1474
- }
1475
-
1476
- to {
1477
- transform: translate3d(0, 0, 0);
1478
- opacity: 1;
1479
- }
1480
- `;
1481
-
1482
- const rotateOut = react.keyframes`
1483
- from {
1484
- opacity: 1;
1485
- }
1486
-
1487
- to {
1488
- transform: rotate3d(0, 0, 1, 200deg);
1489
- opacity: 0;
1490
- }
1491
- `;
1492
-
1493
- const rotateOutDownLeft = react.keyframes`
1494
- from {
1495
- opacity: 1;
1496
- }
1497
-
1498
- to {
1499
- transform: rotate3d(0, 0, 1, 45deg);
1500
- opacity: 0;
1501
- }
1502
- `;
1503
-
1504
- const rotateOutDownRight = react.keyframes`
1505
- from {
1506
- opacity: 1;
1507
- }
1508
-
1509
- to {
1510
- transform: rotate3d(0, 0, 1, -45deg);
1511
- opacity: 0;
1512
- }
1513
- `;
1514
-
1515
- const rotateOutUpLeft = react.keyframes`
1516
- from {
1517
- opacity: 1;
1518
- }
1519
-
1520
- to {
1521
- transform: rotate3d(0, 0, 1, -45deg);
1522
- opacity: 0;
1523
- }
1524
- `;
1525
-
1526
- const rotateOutUpRight = react.keyframes`
1527
- from {
1528
- opacity: 1;
1529
- }
1530
-
1531
- to {
1532
- transform: rotate3d(0, 0, 1, 90deg);
1533
- opacity: 0;
1534
- }
1535
- `;
1536
-
1537
- function getStyles$2(reverse, direction) {
1538
- switch (direction) {
1539
- case "bottom-left":
1540
- return reverse ? [rotateOutDownLeft, { transformOrigin: "left bottom" }] : [rotateInDownLeft, { transformOrigin: "left bottom" }];
1541
- case "bottom-right":
1542
- return reverse ? [rotateOutDownRight, { transformOrigin: "right bottom" }] : [rotateInDownRight, { transformOrigin: "right bottom" }];
1543
- case "top-left":
1544
- return reverse ? [rotateOutUpLeft, { transformOrigin: "left bottom" }] : [rotateInUpLeft, { transformOrigin: "left bottom" }];
1545
- case "top-right":
1546
- return reverse ? [rotateOutUpRight, { transformOrigin: "right bottom" }] : [rotateInUpRight, { transformOrigin: "right bottom" }];
1547
- default:
1548
- return reverse ? [rotateOut, { transformOrigin: "center" }] : [rotateIn, { transformOrigin: "center" }];
1549
- }
1550
- }
1551
- const Rotate = (props) => {
1552
- const { direction, reverse = false, style, ...rest } = props;
1553
- const [keyframes, animationCss] = react$1.useMemo(
1554
- () => getStyles$2(reverse, direction),
1555
- [direction, reverse]
1556
- );
1557
- return /* @__PURE__ */ jsxRuntime.jsx(
1558
- Reveal,
1559
- {
1560
- keyframes,
1561
- style: Object.assign({}, style, animationCss),
1562
- ...rest
1563
- }
1564
- );
1565
- };
1566
-
1567
- const slideInDown = react.keyframes`
1568
- from {
1569
- transform: translate3d(0, -100%, 0);
1570
- visibility: visible;
1571
- }
1572
-
1573
- to {
1574
- transform: translate3d(0, 0, 0);
1575
- }
1576
- `;
1577
-
1578
- const slideInLeft = react.keyframes`
1579
- from {
1580
- transform: translate3d(-100%, 0, 0);
1581
- visibility: visible;
1582
- }
1583
-
1584
- to {
1585
- transform: translate3d(0, 0, 0);
1586
- }
1587
- `;
1588
-
1589
- const slideInRight = react.keyframes`
1590
- from {
1591
- transform: translate3d(100%, 0, 0);
1592
- visibility: visible;
1593
- }
1594
-
1595
- to {
1596
- transform: translate3d(0, 0, 0);
1597
- }
1598
- `;
1599
-
1600
- const slideInUp = react.keyframes`
1601
- from {
1602
- transform: translate3d(0, 100%, 0);
1603
- visibility: visible;
1604
- }
1605
-
1606
- to {
1607
- transform: translate3d(0, 0, 0);
1608
- }
1609
- `;
1610
-
1611
- const slideOutDown = react.keyframes`
1612
- from {
1613
- transform: translate3d(0, 0, 0);
1614
- }
1615
-
1616
- to {
1617
- visibility: hidden;
1618
- transform: translate3d(0, 100%, 0);
1619
- }
1620
- `;
1621
-
1622
- const slideOutLeft = react.keyframes`
1623
- from {
1624
- transform: translate3d(0, 0, 0);
1625
- }
1626
-
1627
- to {
1628
- visibility: hidden;
1629
- transform: translate3d(-100%, 0, 0);
1630
- }
1631
- `;
1632
-
1633
- const slideOutRight = react.keyframes`
1634
- from {
1635
- transform: translate3d(0, 0, 0);
1636
- }
1637
-
1638
- to {
1639
- visibility: hidden;
1640
- transform: translate3d(100%, 0, 0);
1641
- }
1642
- `;
1643
-
1644
- const slideOutUp = react.keyframes`
1645
- from {
1646
- transform: translate3d(0, 0, 0);
1647
- }
1648
-
1649
- to {
1650
- visibility: hidden;
1651
- transform: translate3d(0, -100%, 0);
1652
- }
1653
- `;
1654
-
1655
- function getStyles$1(reverse, direction) {
1656
- switch (direction) {
1657
- case "down":
1658
- return reverse ? slideOutDown : slideInDown;
1659
- case "right":
1660
- return reverse ? slideOutRight : slideInRight;
1661
- case "up":
1662
- return reverse ? slideOutUp : slideInUp;
1663
- case "left":
1664
- default:
1665
- return reverse ? slideOutLeft : slideInLeft;
1666
- }
1667
- }
1668
- const Slide = (props) => {
1669
- const { direction, reverse = false, ...rest } = props;
1670
- const keyframes = react$1.useMemo(
1671
- () => getStyles$1(reverse, direction),
1672
- [direction, reverse]
1673
- );
1674
- return /* @__PURE__ */ jsxRuntime.jsx(Reveal, { keyframes, ...rest });
1675
- };
1676
-
1677
- const zoomIn = react.keyframes`
1678
- from {
1679
- opacity: 0;
1680
- transform: scale3d(0.3, 0.3, 0.3);
1681
- }
1682
-
1683
- 50% {
1684
- opacity: 1;
1685
- }
1686
- `;
1687
-
1688
- const zoomInDown = react.keyframes`
1689
- from {
1690
- opacity: 0;
1691
- transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -1000px, 0);
1692
- animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
1693
- }
1694
-
1695
- 60% {
1696
- opacity: 1;
1697
- transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0);
1698
- animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
1699
- }
1700
- `;
1701
-
1702
- const zoomInLeft = react.keyframes`
1703
- from {
1704
- opacity: 0;
1705
- transform: scale3d(0.1, 0.1, 0.1) translate3d(-1000px, 0, 0);
1706
- animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
1707
- }
1708
-
1709
- 60% {
1710
- opacity: 1;
1711
- transform: scale3d(0.475, 0.475, 0.475) translate3d(10px, 0, 0);
1712
- animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
1713
- }
1714
- `;
1715
-
1716
- const zoomInRight = react.keyframes`
1717
- from {
1718
- opacity: 0;
1719
- transform: scale3d(0.1, 0.1, 0.1) translate3d(1000px, 0, 0);
1720
- animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
1721
- }
1722
-
1723
- 60% {
1724
- opacity: 1;
1725
- transform: scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0);
1726
- animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
1727
- }
1728
- `;
1729
-
1730
- const zoomInUp = react.keyframes`
1731
- from {
1732
- opacity: 0;
1733
- transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 1000px, 0);
1734
- animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
1735
- }
1736
-
1737
- 60% {
1738
- opacity: 1;
1739
- transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0);
1740
- animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
1741
- }
1742
- `;
1743
-
1744
- const zoomOut = react.keyframes`
1745
- from {
1746
- opacity: 1;
1747
- }
1748
-
1749
- 50% {
1750
- opacity: 0;
1751
- transform: scale3d(0.3, 0.3, 0.3);
1752
- }
1753
-
1754
- to {
1755
- opacity: 0;
1756
- }
1757
- `;
1758
-
1759
- const zoomOutDown = react.keyframes`
1760
- 40% {
1761
- opacity: 1;
1762
- transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0);
1763
- animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
1764
- }
1765
-
1766
- to {
1767
- opacity: 0;
1768
- transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 2000px, 0);
1769
- animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
1770
- }
1771
- `;
1772
-
1773
- const zoomOutLeft = react.keyframes`
1774
- 40% {
1775
- opacity: 1;
1776
- transform: scale3d(0.475, 0.475, 0.475) translate3d(42px, 0, 0);
1777
- }
1778
-
1779
- to {
1780
- opacity: 0;
1781
- transform: scale(0.1) translate3d(-2000px, 0, 0);
1782
- }
1783
- `;
1784
-
1785
- const zoomOutRight = react.keyframes`
1786
- 40% {
1787
- opacity: 1;
1788
- transform: scale3d(0.475, 0.475, 0.475) translate3d(-42px, 0, 0);
1789
- }
1790
-
1791
- to {
1792
- opacity: 0;
1793
- transform: scale(0.1) translate3d(2000px, 0, 0);
1794
- }
1795
- `;
1796
-
1797
- const zoomOutUp = react.keyframes`
1798
- 40% {
1799
- opacity: 1;
1800
- transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0);
1801
- animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
1802
- }
1803
-
1804
- to {
1805
- opacity: 0;
1806
- transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -2000px, 0);
1807
- animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
1808
- }
1809
- `;
1810
-
1811
- function getStyles(reverse, direction) {
1812
- switch (direction) {
1813
- case "down":
1814
- return reverse ? zoomOutDown : zoomInDown;
1815
- case "left":
1816
- return reverse ? zoomOutLeft : zoomInLeft;
1817
- case "right":
1818
- return reverse ? zoomOutRight : zoomInRight;
1819
- case "up":
1820
- return reverse ? zoomOutUp : zoomInUp;
1821
- default:
1822
- return reverse ? zoomOut : zoomIn;
1823
- }
1824
- }
1825
- const Zoom = (props) => {
1826
- const { direction, reverse = false, ...rest } = props;
1827
- const keyframes = react$1.useMemo(
1828
- () => getStyles(reverse, direction),
1829
- [direction, reverse]
1830
- );
1831
- return /* @__PURE__ */ jsxRuntime.jsx(Reveal, { keyframes, ...rest });
1832
- };
1833
-
1834
- exports.AttentionSeeker = AttentionSeeker;
1835
- exports.Bounce = Bounce;
1836
- exports.Fade = Fade;
1837
- exports.Flip = Flip;
1838
- exports.Hinge = Hinge;
1839
- exports.JackInTheBox = JackInTheBox;
1840
- exports.Reveal = Reveal;
1841
- exports.Roll = Roll;
1842
- exports.Rotate = Rotate;
1843
- exports.Slide = Slide;
1844
- exports.Zoom = Zoom;
1845
- exports.default = Reveal;