react-awesome-reveal 4.3.0 → 5.0.0-next.0

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