react-awesome-reveal 4.3.1 → 5.0.0-next.1

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