@pyreon/kinetic-presets 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js ADDED
@@ -0,0 +1,1162 @@
1
+ //#region src/factories.ts
2
+ const directionToTranslate = (direction, distance) => {
3
+ switch (direction) {
4
+ case "up": return `translateY(${distance}px)`;
5
+ case "down": return `translateY(${-distance}px)`;
6
+ case "left": return `translateX(${distance}px)`;
7
+ case "right": return `translateX(${-distance}px)`;
8
+ }
9
+ };
10
+ const directionToZero = (direction) => {
11
+ switch (direction) {
12
+ case "up":
13
+ case "down": return "translateY(0)";
14
+ case "left":
15
+ case "right": return "translateX(0)";
16
+ }
17
+ };
18
+ const createFade = ({ direction, distance = 16, duration = 300, leaveDuration = 200, easing = "ease-out", leaveEasing = "ease-in" } = {}) => {
19
+ if (!direction) return {
20
+ enterStyle: { opacity: 0 },
21
+ enterToStyle: { opacity: 1 },
22
+ enterTransition: `all ${duration}ms ${easing}`,
23
+ leaveStyle: { opacity: 1 },
24
+ leaveToStyle: { opacity: 0 },
25
+ leaveTransition: `all ${leaveDuration}ms ${leaveEasing}`
26
+ };
27
+ const translate = directionToTranslate(direction, distance);
28
+ const zero = directionToZero(direction);
29
+ return {
30
+ enterStyle: {
31
+ opacity: 0,
32
+ transform: translate
33
+ },
34
+ enterToStyle: {
35
+ opacity: 1,
36
+ transform: zero
37
+ },
38
+ enterTransition: `all ${duration}ms ${easing}`,
39
+ leaveStyle: {
40
+ opacity: 1,
41
+ transform: zero
42
+ },
43
+ leaveToStyle: {
44
+ opacity: 0,
45
+ transform: translate
46
+ },
47
+ leaveTransition: `all ${leaveDuration}ms ${leaveEasing}`
48
+ };
49
+ };
50
+ const createSlide = ({ direction = "up", distance = 16, duration = 300, leaveDuration = 200, easing = "ease-out", leaveEasing = "ease-in" } = {}) => {
51
+ const translate = directionToTranslate(direction, distance);
52
+ const zero = directionToZero(direction);
53
+ return {
54
+ enterStyle: {
55
+ opacity: 0,
56
+ transform: translate
57
+ },
58
+ enterToStyle: {
59
+ opacity: 1,
60
+ transform: zero
61
+ },
62
+ enterTransition: `all ${duration}ms ${easing}`,
63
+ leaveStyle: {
64
+ opacity: 1,
65
+ transform: zero
66
+ },
67
+ leaveToStyle: {
68
+ opacity: 0,
69
+ transform: translate
70
+ },
71
+ leaveTransition: `all ${leaveDuration}ms ${leaveEasing}`
72
+ };
73
+ };
74
+ const createScale = ({ from = .9, duration = 300, leaveDuration = 200, easing = "ease-out", leaveEasing = "ease-in" } = {}) => ({
75
+ enterStyle: {
76
+ opacity: 0,
77
+ transform: `scale(${from})`
78
+ },
79
+ enterToStyle: {
80
+ opacity: 1,
81
+ transform: "scale(1)"
82
+ },
83
+ enterTransition: `all ${duration}ms ${easing}`,
84
+ leaveStyle: {
85
+ opacity: 1,
86
+ transform: "scale(1)"
87
+ },
88
+ leaveToStyle: {
89
+ opacity: 0,
90
+ transform: `scale(${from})`
91
+ },
92
+ leaveTransition: `all ${leaveDuration}ms ${leaveEasing}`
93
+ });
94
+ const createRotate = ({ degrees = 15, duration = 300, leaveDuration = 200, easing = "ease-out", leaveEasing = "ease-in" } = {}) => ({
95
+ enterStyle: {
96
+ opacity: 0,
97
+ transform: `rotate(${-degrees}deg)`
98
+ },
99
+ enterToStyle: {
100
+ opacity: 1,
101
+ transform: "rotate(0)"
102
+ },
103
+ enterTransition: `all ${duration}ms ${easing}`,
104
+ leaveStyle: {
105
+ opacity: 1,
106
+ transform: "rotate(0)"
107
+ },
108
+ leaveToStyle: {
109
+ opacity: 0,
110
+ transform: `rotate(${degrees}deg)`
111
+ },
112
+ leaveTransition: `all ${leaveDuration}ms ${leaveEasing}`
113
+ });
114
+ const createBlur = ({ amount = 8, scale, duration = 300, leaveDuration = 200, easing = "ease-out", leaveEasing = "ease-in" } = {}) => {
115
+ const hidden = {
116
+ opacity: 0,
117
+ filter: `blur(${amount}px)`
118
+ };
119
+ const visible = {
120
+ opacity: 1,
121
+ filter: "blur(0px)"
122
+ };
123
+ if (scale !== void 0) {
124
+ hidden.transform = `scale(${scale})`;
125
+ visible.transform = "scale(1)";
126
+ }
127
+ return {
128
+ enterStyle: hidden,
129
+ enterToStyle: visible,
130
+ enterTransition: `all ${duration}ms ${easing}`,
131
+ leaveStyle: visible,
132
+ leaveToStyle: hidden,
133
+ leaveTransition: `all ${leaveDuration}ms ${leaveEasing}`
134
+ };
135
+ };
136
+
137
+ //#endregion
138
+ //#region src/presets.ts
139
+ const s = (hidden, visible, enterDuration = "300ms", leaveDuration = "200ms", enterEasing = "ease-out", leaveEasing = "ease-in") => ({
140
+ enterStyle: hidden,
141
+ enterToStyle: visible,
142
+ enterTransition: `all ${enterDuration} ${enterEasing}`,
143
+ leaveStyle: visible,
144
+ leaveToStyle: hidden,
145
+ leaveTransition: `all ${leaveDuration} ${leaveEasing}`
146
+ });
147
+ const SPRING = "cubic-bezier(0.34, 1.56, 0.64, 1)";
148
+ const BOUNCE = "cubic-bezier(0.68, -0.55, 0.265, 1.55)";
149
+ const fade = s({ opacity: 0 }, { opacity: 1 });
150
+ const fadeUp = s({
151
+ opacity: 0,
152
+ transform: "translateY(16px)"
153
+ }, {
154
+ opacity: 1,
155
+ transform: "translateY(0)"
156
+ });
157
+ const fadeDown = s({
158
+ opacity: 0,
159
+ transform: "translateY(-16px)"
160
+ }, {
161
+ opacity: 1,
162
+ transform: "translateY(0)"
163
+ });
164
+ const fadeLeft = s({
165
+ opacity: 0,
166
+ transform: "translateX(16px)"
167
+ }, {
168
+ opacity: 1,
169
+ transform: "translateX(0)"
170
+ });
171
+ const fadeRight = s({
172
+ opacity: 0,
173
+ transform: "translateX(-16px)"
174
+ }, {
175
+ opacity: 1,
176
+ transform: "translateX(0)"
177
+ });
178
+ const fadeUpBig = s({
179
+ opacity: 0,
180
+ transform: "translateY(48px)"
181
+ }, {
182
+ opacity: 1,
183
+ transform: "translateY(0)"
184
+ });
185
+ const fadeDownBig = s({
186
+ opacity: 0,
187
+ transform: "translateY(-48px)"
188
+ }, {
189
+ opacity: 1,
190
+ transform: "translateY(0)"
191
+ });
192
+ const fadeLeftBig = s({
193
+ opacity: 0,
194
+ transform: "translateX(48px)"
195
+ }, {
196
+ opacity: 1,
197
+ transform: "translateX(0)"
198
+ });
199
+ const fadeRightBig = s({
200
+ opacity: 0,
201
+ transform: "translateX(-48px)"
202
+ }, {
203
+ opacity: 1,
204
+ transform: "translateX(0)"
205
+ });
206
+ const fadeScale = s({
207
+ opacity: 0,
208
+ transform: "scale(0.95)"
209
+ }, {
210
+ opacity: 1,
211
+ transform: "scale(1)"
212
+ });
213
+ const fadeUpLeft = s({
214
+ opacity: 0,
215
+ transform: "translate(16px, 16px)"
216
+ }, {
217
+ opacity: 1,
218
+ transform: "translate(0, 0)"
219
+ });
220
+ const fadeUpRight = s({
221
+ opacity: 0,
222
+ transform: "translate(-16px, 16px)"
223
+ }, {
224
+ opacity: 1,
225
+ transform: "translate(0, 0)"
226
+ });
227
+ const fadeDownLeft = s({
228
+ opacity: 0,
229
+ transform: "translate(16px, -16px)"
230
+ }, {
231
+ opacity: 1,
232
+ transform: "translate(0, 0)"
233
+ });
234
+ const fadeDownRight = s({
235
+ opacity: 0,
236
+ transform: "translate(-16px, -16px)"
237
+ }, {
238
+ opacity: 1,
239
+ transform: "translate(0, 0)"
240
+ });
241
+ const slideUp = s({
242
+ opacity: 0,
243
+ transform: "translateY(16px)"
244
+ }, {
245
+ opacity: 1,
246
+ transform: "translateY(0)"
247
+ });
248
+ const slideDown = s({
249
+ opacity: 0,
250
+ transform: "translateY(-16px)"
251
+ }, {
252
+ opacity: 1,
253
+ transform: "translateY(0)"
254
+ });
255
+ const slideLeft = s({
256
+ opacity: 0,
257
+ transform: "translateX(16px)"
258
+ }, {
259
+ opacity: 1,
260
+ transform: "translateX(0)"
261
+ });
262
+ const slideRight = s({
263
+ opacity: 0,
264
+ transform: "translateX(-16px)"
265
+ }, {
266
+ opacity: 1,
267
+ transform: "translateX(0)"
268
+ });
269
+ const slideUpBig = s({
270
+ opacity: 0,
271
+ transform: "translateY(48px)"
272
+ }, {
273
+ opacity: 1,
274
+ transform: "translateY(0)"
275
+ });
276
+ const slideDownBig = s({
277
+ opacity: 0,
278
+ transform: "translateY(-48px)"
279
+ }, {
280
+ opacity: 1,
281
+ transform: "translateY(0)"
282
+ });
283
+ const slideLeftBig = s({
284
+ opacity: 0,
285
+ transform: "translateX(48px)"
286
+ }, {
287
+ opacity: 1,
288
+ transform: "translateX(0)"
289
+ });
290
+ const slideRightBig = s({
291
+ opacity: 0,
292
+ transform: "translateX(-48px)"
293
+ }, {
294
+ opacity: 1,
295
+ transform: "translateX(0)"
296
+ });
297
+ const scaleIn = s({
298
+ opacity: 0,
299
+ transform: "scale(0.9)"
300
+ }, {
301
+ opacity: 1,
302
+ transform: "scale(1)"
303
+ });
304
+ const scaleOut = s({
305
+ opacity: 0,
306
+ transform: "scale(1.1)"
307
+ }, {
308
+ opacity: 1,
309
+ transform: "scale(1)"
310
+ });
311
+ const scaleUp = s({
312
+ opacity: 0,
313
+ transform: "scale(0.5)"
314
+ }, {
315
+ opacity: 1,
316
+ transform: "scale(1)"
317
+ });
318
+ const scaleDown = s({
319
+ opacity: 0,
320
+ transform: "scale(1.5)"
321
+ }, {
322
+ opacity: 1,
323
+ transform: "scale(1)"
324
+ });
325
+ const scaleInUp = s({
326
+ opacity: 0,
327
+ transform: "scale(0.9) translateY(16px)"
328
+ }, {
329
+ opacity: 1,
330
+ transform: "scale(1) translateY(0)"
331
+ });
332
+ const scaleInDown = s({
333
+ opacity: 0,
334
+ transform: "scale(0.9) translateY(-16px)"
335
+ }, {
336
+ opacity: 1,
337
+ transform: "scale(1) translateY(0)"
338
+ });
339
+ const scaleInLeft = s({
340
+ opacity: 0,
341
+ transform: "scale(0.9) translateX(16px)"
342
+ }, {
343
+ opacity: 1,
344
+ transform: "scale(1) translateX(0)"
345
+ });
346
+ const scaleInRight = s({
347
+ opacity: 0,
348
+ transform: "scale(0.9) translateX(-16px)"
349
+ }, {
350
+ opacity: 1,
351
+ transform: "scale(1) translateX(0)"
352
+ });
353
+ const zoomIn = s({
354
+ opacity: 0,
355
+ transform: "scale(0)"
356
+ }, {
357
+ opacity: 1,
358
+ transform: "scale(1)"
359
+ }, "400ms", "250ms");
360
+ const zoomOut = s({
361
+ opacity: 0,
362
+ transform: "scale(2)"
363
+ }, {
364
+ opacity: 1,
365
+ transform: "scale(1)"
366
+ }, "400ms", "250ms");
367
+ const zoomInUp = s({
368
+ opacity: 0,
369
+ transform: "scale(0.5) translateY(48px)"
370
+ }, {
371
+ opacity: 1,
372
+ transform: "scale(1) translateY(0)"
373
+ }, "400ms", "250ms");
374
+ const zoomInDown = s({
375
+ opacity: 0,
376
+ transform: "scale(0.5) translateY(-48px)"
377
+ }, {
378
+ opacity: 1,
379
+ transform: "scale(1) translateY(0)"
380
+ }, "400ms", "250ms");
381
+ const zoomInLeft = s({
382
+ opacity: 0,
383
+ transform: "scale(0.5) translateX(48px)"
384
+ }, {
385
+ opacity: 1,
386
+ transform: "scale(1) translateX(0)"
387
+ }, "400ms", "250ms");
388
+ const zoomInRight = s({
389
+ opacity: 0,
390
+ transform: "scale(0.5) translateX(-48px)"
391
+ }, {
392
+ opacity: 1,
393
+ transform: "scale(1) translateX(0)"
394
+ }, "400ms", "250ms");
395
+ const zoomOutUp = s({
396
+ opacity: 0,
397
+ transform: "scale(2) translateY(48px)"
398
+ }, {
399
+ opacity: 1,
400
+ transform: "scale(1) translateY(0)"
401
+ }, "400ms", "250ms");
402
+ const zoomOutDown = s({
403
+ opacity: 0,
404
+ transform: "scale(2) translateY(-48px)"
405
+ }, {
406
+ opacity: 1,
407
+ transform: "scale(1) translateY(0)"
408
+ }, "400ms", "250ms");
409
+ const zoomOutLeft = s({
410
+ opacity: 0,
411
+ transform: "scale(2) translateX(48px)"
412
+ }, {
413
+ opacity: 1,
414
+ transform: "scale(1) translateX(0)"
415
+ }, "400ms", "250ms");
416
+ const zoomOutRight = s({
417
+ opacity: 0,
418
+ transform: "scale(2) translateX(-48px)"
419
+ }, {
420
+ opacity: 1,
421
+ transform: "scale(1) translateX(0)"
422
+ }, "400ms", "250ms");
423
+ const flipX = s({
424
+ opacity: 0,
425
+ transform: "perspective(600px) rotateX(90deg)"
426
+ }, {
427
+ opacity: 1,
428
+ transform: "perspective(600px) rotateX(0)"
429
+ }, "500ms", "300ms");
430
+ const flipY = s({
431
+ opacity: 0,
432
+ transform: "perspective(600px) rotateY(90deg)"
433
+ }, {
434
+ opacity: 1,
435
+ transform: "perspective(600px) rotateY(0)"
436
+ }, "500ms", "300ms");
437
+ const flipXReverse = s({
438
+ opacity: 0,
439
+ transform: "perspective(600px) rotateX(-90deg)"
440
+ }, {
441
+ opacity: 1,
442
+ transform: "perspective(600px) rotateX(0)"
443
+ }, "500ms", "300ms");
444
+ const flipYReverse = s({
445
+ opacity: 0,
446
+ transform: "perspective(600px) rotateY(-90deg)"
447
+ }, {
448
+ opacity: 1,
449
+ transform: "perspective(600px) rotateY(0)"
450
+ }, "500ms", "300ms");
451
+ const flipDiagonal = s({
452
+ opacity: 0,
453
+ transform: "perspective(600px) rotate3d(1, 1, 0, 90deg)"
454
+ }, {
455
+ opacity: 1,
456
+ transform: "perspective(600px) rotate3d(1, 1, 0, 0deg)"
457
+ }, "500ms", "300ms");
458
+ const flipDiagonalReverse = s({
459
+ opacity: 0,
460
+ transform: "perspective(600px) rotate3d(1, -1, 0, 90deg)"
461
+ }, {
462
+ opacity: 1,
463
+ transform: "perspective(600px) rotate3d(1, -1, 0, 0deg)"
464
+ }, "500ms", "300ms");
465
+ const rotateIn = s({
466
+ opacity: 0,
467
+ transform: "rotate(-15deg)"
468
+ }, {
469
+ opacity: 1,
470
+ transform: "rotate(0)"
471
+ });
472
+ const rotateInReverse = s({
473
+ opacity: 0,
474
+ transform: "rotate(15deg)"
475
+ }, {
476
+ opacity: 1,
477
+ transform: "rotate(0)"
478
+ });
479
+ const rotateInUp = s({
480
+ opacity: 0,
481
+ transform: "rotate(-5deg) translateY(16px)"
482
+ }, {
483
+ opacity: 1,
484
+ transform: "rotate(0) translateY(0)"
485
+ });
486
+ const rotateInDown = s({
487
+ opacity: 0,
488
+ transform: "rotate(5deg) translateY(-16px)"
489
+ }, {
490
+ opacity: 1,
491
+ transform: "rotate(0) translateY(0)"
492
+ });
493
+ const spinIn = s({
494
+ opacity: 0,
495
+ transform: "rotate(-180deg)"
496
+ }, {
497
+ opacity: 1,
498
+ transform: "rotate(0)"
499
+ }, "500ms", "300ms");
500
+ const spinInReverse = s({
501
+ opacity: 0,
502
+ transform: "rotate(180deg)"
503
+ }, {
504
+ opacity: 1,
505
+ transform: "rotate(0)"
506
+ }, "500ms", "300ms");
507
+ const scaleRotateIn = s({
508
+ opacity: 0,
509
+ transform: "scale(0) rotate(-180deg)"
510
+ }, {
511
+ opacity: 1,
512
+ transform: "scale(1) rotate(0)"
513
+ }, "500ms", "300ms");
514
+ const newspaperIn = s({
515
+ opacity: 0,
516
+ transform: "scale(0) rotate(-720deg)"
517
+ }, {
518
+ opacity: 1,
519
+ transform: "scale(1) rotate(0)"
520
+ }, "700ms", "400ms");
521
+ const bounceIn = s({
522
+ opacity: 0,
523
+ transform: "scale(0.5)"
524
+ }, {
525
+ opacity: 1,
526
+ transform: "scale(1)"
527
+ }, "500ms", "200ms", BOUNCE);
528
+ const bounceInUp = s({
529
+ opacity: 0,
530
+ transform: "translateY(40px)"
531
+ }, {
532
+ opacity: 1,
533
+ transform: "translateY(0)"
534
+ }, "500ms", "200ms", BOUNCE);
535
+ const bounceInDown = s({
536
+ opacity: 0,
537
+ transform: "translateY(-40px)"
538
+ }, {
539
+ opacity: 1,
540
+ transform: "translateY(0)"
541
+ }, "500ms", "200ms", BOUNCE);
542
+ const bounceInLeft = s({
543
+ opacity: 0,
544
+ transform: "translateX(40px)"
545
+ }, {
546
+ opacity: 1,
547
+ transform: "translateX(0)"
548
+ }, "500ms", "200ms", BOUNCE);
549
+ const bounceInRight = s({
550
+ opacity: 0,
551
+ transform: "translateX(-40px)"
552
+ }, {
553
+ opacity: 1,
554
+ transform: "translateX(0)"
555
+ }, "500ms", "200ms", BOUNCE);
556
+ const springIn = s({
557
+ opacity: 0,
558
+ transform: "scale(0.8)"
559
+ }, {
560
+ opacity: 1,
561
+ transform: "scale(1)"
562
+ }, "400ms", "200ms", SPRING);
563
+ const popIn = s({
564
+ opacity: 0,
565
+ transform: "scale(0.3)"
566
+ }, {
567
+ opacity: 1,
568
+ transform: "scale(1)"
569
+ }, "300ms", "200ms", SPRING);
570
+ const rubberIn = s({
571
+ opacity: 0,
572
+ transform: "scale(0.6)"
573
+ }, {
574
+ opacity: 1,
575
+ transform: "scale(1)"
576
+ }, "500ms", "250ms", "cubic-bezier(0.175, 0.885, 0.32, 1.275)");
577
+ const squishX = s({
578
+ opacity: 0,
579
+ transform: "scaleX(1.4) scaleY(0.6)"
580
+ }, {
581
+ opacity: 1,
582
+ transform: "scaleX(1) scaleY(1)"
583
+ }, "400ms", "250ms", SPRING);
584
+ const squishY = s({
585
+ opacity: 0,
586
+ transform: "scaleX(0.6) scaleY(1.4)"
587
+ }, {
588
+ opacity: 1,
589
+ transform: "scaleX(1) scaleY(1)"
590
+ }, "400ms", "250ms", SPRING);
591
+ const blurIn = s({
592
+ opacity: 0,
593
+ filter: "blur(8px)"
594
+ }, {
595
+ opacity: 1,
596
+ filter: "blur(0px)"
597
+ });
598
+ const blurInUp = s({
599
+ opacity: 0,
600
+ filter: "blur(8px)",
601
+ transform: "translateY(16px)"
602
+ }, {
603
+ opacity: 1,
604
+ filter: "blur(0px)",
605
+ transform: "translateY(0)"
606
+ });
607
+ const blurInDown = s({
608
+ opacity: 0,
609
+ filter: "blur(8px)",
610
+ transform: "translateY(-16px)"
611
+ }, {
612
+ opacity: 1,
613
+ filter: "blur(0px)",
614
+ transform: "translateY(0)"
615
+ });
616
+ const blurInLeft = s({
617
+ opacity: 0,
618
+ filter: "blur(8px)",
619
+ transform: "translateX(16px)"
620
+ }, {
621
+ opacity: 1,
622
+ filter: "blur(0px)",
623
+ transform: "translateX(0)"
624
+ });
625
+ const blurInRight = s({
626
+ opacity: 0,
627
+ filter: "blur(8px)",
628
+ transform: "translateX(-16px)"
629
+ }, {
630
+ opacity: 1,
631
+ filter: "blur(0px)",
632
+ transform: "translateX(0)"
633
+ });
634
+ const blurScale = s({
635
+ opacity: 0,
636
+ filter: "blur(8px)",
637
+ transform: "scale(0.95)"
638
+ }, {
639
+ opacity: 1,
640
+ filter: "blur(0px)",
641
+ transform: "scale(1)"
642
+ });
643
+ const puffIn = s({
644
+ opacity: 0,
645
+ filter: "blur(4px)",
646
+ transform: "scale(1.5)"
647
+ }, {
648
+ opacity: 1,
649
+ filter: "blur(0px)",
650
+ transform: "scale(1)"
651
+ }, "400ms", "250ms");
652
+ const puffOut = s({
653
+ opacity: 0,
654
+ filter: "blur(4px)",
655
+ transform: "scale(0.5)"
656
+ }, {
657
+ opacity: 1,
658
+ filter: "blur(0px)",
659
+ transform: "scale(1)"
660
+ }, "400ms", "250ms");
661
+ const clipTop = s({ clipPath: "inset(0 0 100% 0)" }, { clipPath: "inset(0 0 0 0)" }, "400ms", "250ms");
662
+ const clipBottom = s({ clipPath: "inset(100% 0 0 0)" }, { clipPath: "inset(0 0 0 0)" }, "400ms", "250ms");
663
+ const clipLeft = s({ clipPath: "inset(0 100% 0 0)" }, { clipPath: "inset(0 0 0 0)" }, "400ms", "250ms");
664
+ const clipRight = s({ clipPath: "inset(0 0 0 100%)" }, { clipPath: "inset(0 0 0 0)" }, "400ms", "250ms");
665
+ const clipCircle = s({ clipPath: "circle(0% at 50% 50%)" }, { clipPath: "circle(75% at 50% 50%)" }, "500ms", "300ms");
666
+ const clipCenter = s({ clipPath: "inset(50% 50% 50% 50%)" }, { clipPath: "inset(0 0 0 0)" }, "400ms", "250ms");
667
+ const clipDiamond = s({ clipPath: "polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%)" }, { clipPath: "polygon(50% -10%, 110% 50%, 50% 110%, -10% 50%)" }, "500ms", "300ms");
668
+ const clipCorner = s({ clipPath: "polygon(0 0, 0 0, 0 0, 0 0)" }, { clipPath: "polygon(0 0, 100% 0, 100% 100%, 0 100%)" }, "500ms", "300ms");
669
+ const perspectiveUp = s({
670
+ opacity: 0,
671
+ transform: "perspective(600px) rotateX(15deg)"
672
+ }, {
673
+ opacity: 1,
674
+ transform: "perspective(600px) rotateX(0)"
675
+ });
676
+ const perspectiveDown = s({
677
+ opacity: 0,
678
+ transform: "perspective(600px) rotateX(-15deg)"
679
+ }, {
680
+ opacity: 1,
681
+ transform: "perspective(600px) rotateX(0)"
682
+ });
683
+ const perspectiveLeft = s({
684
+ opacity: 0,
685
+ transform: "perspective(600px) rotateY(-15deg)"
686
+ }, {
687
+ opacity: 1,
688
+ transform: "perspective(600px) rotateY(0)"
689
+ });
690
+ const perspectiveRight = s({
691
+ opacity: 0,
692
+ transform: "perspective(600px) rotateY(15deg)"
693
+ }, {
694
+ opacity: 1,
695
+ transform: "perspective(600px) rotateY(0)"
696
+ });
697
+ const expandX = s({
698
+ opacity: 0,
699
+ transform: "scaleX(0)"
700
+ }, {
701
+ opacity: 1,
702
+ transform: "scaleX(1)"
703
+ });
704
+ const expandY = s({
705
+ opacity: 0,
706
+ transform: "scaleY(0)"
707
+ }, {
708
+ opacity: 1,
709
+ transform: "scaleY(1)"
710
+ });
711
+ const skewIn = s({
712
+ opacity: 0,
713
+ transform: "skewX(-5deg)"
714
+ }, {
715
+ opacity: 1,
716
+ transform: "skewX(0)"
717
+ });
718
+ const skewInReverse = s({
719
+ opacity: 0,
720
+ transform: "skewX(5deg)"
721
+ }, {
722
+ opacity: 1,
723
+ transform: "skewX(0)"
724
+ });
725
+ const skewInY = s({
726
+ opacity: 0,
727
+ transform: "skewY(-5deg)"
728
+ }, {
729
+ opacity: 1,
730
+ transform: "skewY(0)"
731
+ });
732
+ const skewInYReverse = s({
733
+ opacity: 0,
734
+ transform: "skewY(5deg)"
735
+ }, {
736
+ opacity: 1,
737
+ transform: "skewY(0)"
738
+ });
739
+ const drop = s({
740
+ opacity: 0,
741
+ transform: "translateY(-100%)"
742
+ }, {
743
+ opacity: 1,
744
+ transform: "translateY(0)"
745
+ }, "400ms", "250ms");
746
+ const rise = s({
747
+ opacity: 0,
748
+ transform: "translateY(100%)"
749
+ }, {
750
+ opacity: 1,
751
+ transform: "translateY(0)"
752
+ }, "400ms", "250ms");
753
+ const backInUp = s({
754
+ opacity: 0,
755
+ transform: "scale(0.7) translateY(80px)"
756
+ }, {
757
+ opacity: 1,
758
+ transform: "scale(1) translateY(0)"
759
+ }, "400ms", "250ms");
760
+ const backInDown = s({
761
+ opacity: 0,
762
+ transform: "scale(0.7) translateY(-80px)"
763
+ }, {
764
+ opacity: 1,
765
+ transform: "scale(1) translateY(0)"
766
+ }, "400ms", "250ms");
767
+ const backInLeft = s({
768
+ opacity: 0,
769
+ transform: "scale(0.7) translateX(80px)"
770
+ }, {
771
+ opacity: 1,
772
+ transform: "scale(1) translateX(0)"
773
+ }, "400ms", "250ms");
774
+ const backInRight = s({
775
+ opacity: 0,
776
+ transform: "scale(0.7) translateX(-80px)"
777
+ }, {
778
+ opacity: 1,
779
+ transform: "scale(1) translateX(0)"
780
+ }, "400ms", "250ms");
781
+ const lightSpeedInLeft = s({
782
+ opacity: 0,
783
+ transform: "translateX(100%) skewX(-30deg)"
784
+ }, {
785
+ opacity: 1,
786
+ transform: "translateX(0) skewX(0)"
787
+ }, "400ms", "250ms");
788
+ const lightSpeedInRight = s({
789
+ opacity: 0,
790
+ transform: "translateX(-100%) skewX(30deg)"
791
+ }, {
792
+ opacity: 1,
793
+ transform: "translateX(0) skewX(0)"
794
+ }, "400ms", "250ms");
795
+ const rollInLeft = s({
796
+ opacity: 0,
797
+ transform: "translateX(-100%) rotate(-120deg)"
798
+ }, {
799
+ opacity: 1,
800
+ transform: "translateX(0) rotate(0)"
801
+ }, "500ms", "300ms");
802
+ const rollInRight = s({
803
+ opacity: 0,
804
+ transform: "translateX(100%) rotate(120deg)"
805
+ }, {
806
+ opacity: 1,
807
+ transform: "translateX(0) rotate(0)"
808
+ }, "500ms", "300ms");
809
+ const swingInTop = s({
810
+ opacity: 0,
811
+ transform: "perspective(600px) rotateX(-90deg)",
812
+ transformOrigin: "top"
813
+ }, {
814
+ opacity: 1,
815
+ transform: "perspective(600px) rotateX(0)",
816
+ transformOrigin: "top"
817
+ }, "500ms", "300ms");
818
+ const swingInBottom = s({
819
+ opacity: 0,
820
+ transform: "perspective(600px) rotateX(90deg)",
821
+ transformOrigin: "bottom"
822
+ }, {
823
+ opacity: 1,
824
+ transform: "perspective(600px) rotateX(0)",
825
+ transformOrigin: "bottom"
826
+ }, "500ms", "300ms");
827
+ const swingInLeft = s({
828
+ opacity: 0,
829
+ transform: "perspective(600px) rotateY(90deg)",
830
+ transformOrigin: "left"
831
+ }, {
832
+ opacity: 1,
833
+ transform: "perspective(600px) rotateY(0)",
834
+ transformOrigin: "left"
835
+ }, "500ms", "300ms");
836
+ const swingInRight = s({
837
+ opacity: 0,
838
+ transform: "perspective(600px) rotateY(-90deg)",
839
+ transformOrigin: "right"
840
+ }, {
841
+ opacity: 1,
842
+ transform: "perspective(600px) rotateY(0)",
843
+ transformOrigin: "right"
844
+ }, "500ms", "300ms");
845
+ const slitHorizontal = s({
846
+ opacity: 0,
847
+ transform: "perspective(600px) rotateY(90deg) scaleX(0)"
848
+ }, {
849
+ opacity: 1,
850
+ transform: "perspective(600px) rotateY(0) scaleX(1)"
851
+ }, "500ms", "300ms");
852
+ const slitVertical = s({
853
+ opacity: 0,
854
+ transform: "perspective(600px) rotateX(90deg) scaleY(0)"
855
+ }, {
856
+ opacity: 1,
857
+ transform: "perspective(600px) rotateX(0) scaleY(1)"
858
+ }, "500ms", "300ms");
859
+ const swirlIn = s({
860
+ opacity: 0,
861
+ transform: "rotate(-540deg) scale(0)"
862
+ }, {
863
+ opacity: 1,
864
+ transform: "rotate(0) scale(1)"
865
+ }, "600ms", "400ms");
866
+ const swirlInReverse = s({
867
+ opacity: 0,
868
+ transform: "rotate(540deg) scale(0)"
869
+ }, {
870
+ opacity: 1,
871
+ transform: "rotate(0) scale(1)"
872
+ }, "600ms", "400ms");
873
+ const flyInUp = s({
874
+ opacity: 0,
875
+ transform: "translateY(100vh)"
876
+ }, {
877
+ opacity: 1,
878
+ transform: "translateY(0)"
879
+ }, "500ms", "300ms");
880
+ const flyInDown = s({
881
+ opacity: 0,
882
+ transform: "translateY(-100vh)"
883
+ }, {
884
+ opacity: 1,
885
+ transform: "translateY(0)"
886
+ }, "500ms", "300ms");
887
+ const flyInLeft = s({
888
+ opacity: 0,
889
+ transform: "translateX(100vw)"
890
+ }, {
891
+ opacity: 1,
892
+ transform: "translateX(0)"
893
+ }, "500ms", "300ms");
894
+ const flyInRight = s({
895
+ opacity: 0,
896
+ transform: "translateX(-100vw)"
897
+ }, {
898
+ opacity: 1,
899
+ transform: "translateX(0)"
900
+ }, "500ms", "300ms");
901
+ const floatUp = s({
902
+ opacity: 0,
903
+ transform: "translateY(32px) scale(0.97)"
904
+ }, {
905
+ opacity: 1,
906
+ transform: "translateY(0) scale(1)"
907
+ }, "500ms", "300ms", "cubic-bezier(0.23, 1, 0.32, 1)");
908
+ const floatDown = s({
909
+ opacity: 0,
910
+ transform: "translateY(-32px) scale(0.97)"
911
+ }, {
912
+ opacity: 1,
913
+ transform: "translateY(0) scale(1)"
914
+ }, "500ms", "300ms", "cubic-bezier(0.23, 1, 0.32, 1)");
915
+ const floatLeft = s({
916
+ opacity: 0,
917
+ transform: "translateX(32px) scale(0.97)"
918
+ }, {
919
+ opacity: 1,
920
+ transform: "translateX(0) scale(1)"
921
+ }, "500ms", "300ms", "cubic-bezier(0.23, 1, 0.32, 1)");
922
+ const floatRight = s({
923
+ opacity: 0,
924
+ transform: "translateX(-32px) scale(0.97)"
925
+ }, {
926
+ opacity: 1,
927
+ transform: "translateX(0) scale(1)"
928
+ }, "500ms", "300ms", "cubic-bezier(0.23, 1, 0.32, 1)");
929
+ const pushInLeft = s({
930
+ opacity: 0,
931
+ transform: "translateX(-48px) scale(0.9)"
932
+ }, {
933
+ opacity: 1,
934
+ transform: "translateX(0) scale(1)"
935
+ });
936
+ const pushInRight = s({
937
+ opacity: 0,
938
+ transform: "translateX(48px) scale(0.9)"
939
+ }, {
940
+ opacity: 1,
941
+ transform: "translateX(0) scale(1)"
942
+ });
943
+ const tiltInUp = s({
944
+ opacity: 0,
945
+ transform: "perspective(600px) rotateX(15deg) translateY(24px)"
946
+ }, {
947
+ opacity: 1,
948
+ transform: "perspective(600px) rotateX(0) translateY(0)"
949
+ });
950
+ const tiltInDown = s({
951
+ opacity: 0,
952
+ transform: "perspective(600px) rotateX(-15deg) translateY(-24px)"
953
+ }, {
954
+ opacity: 1,
955
+ transform: "perspective(600px) rotateX(0) translateY(0)"
956
+ });
957
+ const tiltInLeft = s({
958
+ opacity: 0,
959
+ transform: "perspective(600px) rotateY(-15deg) translateX(24px)"
960
+ }, {
961
+ opacity: 1,
962
+ transform: "perspective(600px) rotateY(0) translateX(0)"
963
+ });
964
+ const tiltInRight = s({
965
+ opacity: 0,
966
+ transform: "perspective(600px) rotateY(15deg) translateX(-24px)"
967
+ }, {
968
+ opacity: 1,
969
+ transform: "perspective(600px) rotateY(0) translateX(0)"
970
+ });
971
+ const presets = {
972
+ fade,
973
+ fadeUp,
974
+ fadeDown,
975
+ fadeLeft,
976
+ fadeRight,
977
+ fadeUpBig,
978
+ fadeDownBig,
979
+ fadeLeftBig,
980
+ fadeRightBig,
981
+ fadeScale,
982
+ fadeUpLeft,
983
+ fadeUpRight,
984
+ fadeDownLeft,
985
+ fadeDownRight,
986
+ slideUp,
987
+ slideDown,
988
+ slideLeft,
989
+ slideRight,
990
+ slideUpBig,
991
+ slideDownBig,
992
+ slideLeftBig,
993
+ slideRightBig,
994
+ scaleIn,
995
+ scaleOut,
996
+ scaleUp,
997
+ scaleDown,
998
+ scaleInUp,
999
+ scaleInDown,
1000
+ scaleInLeft,
1001
+ scaleInRight,
1002
+ zoomIn,
1003
+ zoomOut,
1004
+ zoomInUp,
1005
+ zoomInDown,
1006
+ zoomInLeft,
1007
+ zoomInRight,
1008
+ zoomOutUp,
1009
+ zoomOutDown,
1010
+ zoomOutLeft,
1011
+ zoomOutRight,
1012
+ flipX,
1013
+ flipY,
1014
+ flipXReverse,
1015
+ flipYReverse,
1016
+ flipDiagonal,
1017
+ flipDiagonalReverse,
1018
+ rotateIn,
1019
+ rotateInReverse,
1020
+ rotateInUp,
1021
+ rotateInDown,
1022
+ spinIn,
1023
+ spinInReverse,
1024
+ scaleRotateIn,
1025
+ newspaperIn,
1026
+ bounceIn,
1027
+ bounceInUp,
1028
+ bounceInDown,
1029
+ bounceInLeft,
1030
+ bounceInRight,
1031
+ springIn,
1032
+ popIn,
1033
+ rubberIn,
1034
+ squishX,
1035
+ squishY,
1036
+ blurIn,
1037
+ blurInUp,
1038
+ blurInDown,
1039
+ blurInLeft,
1040
+ blurInRight,
1041
+ blurScale,
1042
+ puffIn,
1043
+ puffOut,
1044
+ clipTop,
1045
+ clipBottom,
1046
+ clipLeft,
1047
+ clipRight,
1048
+ clipCircle,
1049
+ clipCenter,
1050
+ clipDiamond,
1051
+ clipCorner,
1052
+ perspectiveUp,
1053
+ perspectiveDown,
1054
+ perspectiveLeft,
1055
+ perspectiveRight,
1056
+ expandX,
1057
+ expandY,
1058
+ skewIn,
1059
+ skewInReverse,
1060
+ skewInY,
1061
+ skewInYReverse,
1062
+ drop,
1063
+ rise,
1064
+ backInUp,
1065
+ backInDown,
1066
+ backInLeft,
1067
+ backInRight,
1068
+ lightSpeedInLeft,
1069
+ lightSpeedInRight,
1070
+ rollInLeft,
1071
+ rollInRight,
1072
+ swingInTop,
1073
+ swingInBottom,
1074
+ swingInLeft,
1075
+ swingInRight,
1076
+ slitHorizontal,
1077
+ slitVertical,
1078
+ swirlIn,
1079
+ swirlInReverse,
1080
+ flyInUp,
1081
+ flyInDown,
1082
+ flyInLeft,
1083
+ flyInRight,
1084
+ floatUp,
1085
+ floatDown,
1086
+ floatLeft,
1087
+ floatRight,
1088
+ pushInLeft,
1089
+ pushInRight,
1090
+ tiltInUp,
1091
+ tiltInDown,
1092
+ tiltInLeft,
1093
+ tiltInRight
1094
+ };
1095
+
1096
+ //#endregion
1097
+ //#region src/utils.ts
1098
+ const mergeStyle = (a, b) => b ? {
1099
+ ...a,
1100
+ ...b
1101
+ } : a;
1102
+ const concatClass = (a, b) => b ? a ? `${a} ${b}` : b : a;
1103
+ const mergeStyles = (result, p) => {
1104
+ result.enterStyle = mergeStyle(result.enterStyle, p.enterStyle);
1105
+ result.enterToStyle = mergeStyle(result.enterToStyle, p.enterToStyle);
1106
+ result.leaveStyle = mergeStyle(result.leaveStyle, p.leaveStyle);
1107
+ result.leaveToStyle = mergeStyle(result.leaveToStyle, p.leaveToStyle);
1108
+ if (p.enterTransition) result.enterTransition = p.enterTransition;
1109
+ if (p.leaveTransition) result.leaveTransition = p.leaveTransition;
1110
+ };
1111
+ const mergeClasses = (result, p) => {
1112
+ result.enter = concatClass(result.enter, p.enter);
1113
+ result.enterFrom = concatClass(result.enterFrom, p.enterFrom);
1114
+ result.enterTo = concatClass(result.enterTo, p.enterTo);
1115
+ result.leave = concatClass(result.leave, p.leave);
1116
+ result.leaveFrom = concatClass(result.leaveFrom, p.leaveFrom);
1117
+ result.leaveTo = concatClass(result.leaveTo, p.leaveTo);
1118
+ };
1119
+ const compose = (...items) => {
1120
+ const result = {};
1121
+ for (const p of items) {
1122
+ mergeStyles(result, p);
1123
+ mergeClasses(result, p);
1124
+ }
1125
+ return result;
1126
+ };
1127
+ const withDuration = (preset, enterMs, leaveMs) => ({
1128
+ ...preset,
1129
+ enterTransition: replaceDuration(preset.enterTransition ?? "", `${enterMs}ms`),
1130
+ leaveTransition: replaceDuration(preset.leaveTransition ?? "", `${leaveMs ?? enterMs}ms`)
1131
+ });
1132
+ const withEasing = (preset, enterEasing, leaveEasing) => ({
1133
+ ...preset,
1134
+ enterTransition: replaceEasing(preset.enterTransition ?? "", enterEasing),
1135
+ leaveTransition: replaceEasing(preset.leaveTransition ?? "", leaveEasing ?? enterEasing)
1136
+ });
1137
+ const withDelay = (preset, enterDelayMs, leaveDelayMs) => ({
1138
+ ...preset,
1139
+ enterTransition: addDelay(preset.enterTransition ?? "", `${enterDelayMs}ms`),
1140
+ leaveTransition: addDelay(preset.leaveTransition ?? "", `${leaveDelayMs ?? enterDelayMs}ms`)
1141
+ });
1142
+ const reverse = (preset) => ({
1143
+ enterStyle: preset.leaveStyle,
1144
+ enterToStyle: preset.leaveToStyle,
1145
+ enterTransition: preset.leaveTransition,
1146
+ leaveStyle: preset.enterStyle,
1147
+ leaveToStyle: preset.enterToStyle,
1148
+ leaveTransition: preset.enterTransition,
1149
+ enter: preset.leave,
1150
+ enterFrom: preset.leaveFrom,
1151
+ enterTo: preset.leaveTo,
1152
+ leave: preset.enter,
1153
+ leaveFrom: preset.enterFrom,
1154
+ leaveTo: preset.enterTo
1155
+ });
1156
+ const replaceDuration = (transition, newDuration) => transition.replace(/\d{1,10}(?:ms|s)/, newDuration);
1157
+ const replaceEasing = (transition, newEasing) => transition.replace(/(?:ease-in-out|ease-in|ease-out|ease|linear|cubic-bezier\([^)]{1,100}\))\s*$/, newEasing);
1158
+ const addDelay = (transition, delay) => transition.replace(/(\d{1,10}(?:ms|s))(\s)/, `$1 ${delay}$2`);
1159
+
1160
+ //#endregion
1161
+ export { backInDown, backInLeft, backInRight, backInUp, blurIn, blurInDown, blurInLeft, blurInRight, blurInUp, blurScale, bounceIn, bounceInDown, bounceInLeft, bounceInRight, bounceInUp, clipBottom, clipCenter, clipCircle, clipCorner, clipDiamond, clipLeft, clipRight, clipTop, compose, createBlur, createFade, createRotate, createScale, createSlide, drop, expandX, expandY, fade, fadeDown, fadeDownBig, fadeDownLeft, fadeDownRight, fadeLeft, fadeLeftBig, fadeRight, fadeRightBig, fadeScale, fadeUp, fadeUpBig, fadeUpLeft, fadeUpRight, flipDiagonal, flipDiagonalReverse, flipX, flipXReverse, flipY, flipYReverse, floatDown, floatLeft, floatRight, floatUp, flyInDown, flyInLeft, flyInRight, flyInUp, lightSpeedInLeft, lightSpeedInRight, newspaperIn, perspectiveDown, perspectiveLeft, perspectiveRight, perspectiveUp, popIn, presets, puffIn, puffOut, pushInLeft, pushInRight, reverse, rise, rollInLeft, rollInRight, rotateIn, rotateInDown, rotateInReverse, rotateInUp, rubberIn, scaleDown, scaleIn, scaleInDown, scaleInLeft, scaleInRight, scaleInUp, scaleOut, scaleRotateIn, scaleUp, skewIn, skewInReverse, skewInY, skewInYReverse, slideDown, slideDownBig, slideLeft, slideLeftBig, slideRight, slideRightBig, slideUp, slideUpBig, slitHorizontal, slitVertical, spinIn, spinInReverse, springIn, squishX, squishY, swingInBottom, swingInLeft, swingInRight, swingInTop, swirlIn, swirlInReverse, tiltInDown, tiltInLeft, tiltInRight, tiltInUp, withDelay, withDuration, withEasing, zoomIn, zoomInDown, zoomInLeft, zoomInRight, zoomInUp, zoomOut, zoomOutDown, zoomOutLeft, zoomOutRight, zoomOutUp };
1162
+ //# sourceMappingURL=index.js.map