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