source: src/components/animate/variants/flip.ts@ 5d6f37a

main
Last change on this file since 5d6f37a was 5d6f37a, checked in by Naum Shapkarovski <naumshapkarovski@…>, 7 weeks ago

add customer

  • Property mode set to 100644
File size: 1.4 KB
Line 
1import { VariantsType } from '../types';
2//
3import { varTranEnter, varTranExit } from './transition';
4
5// ----------------------------------------------------------------------
6
7export const varFlip = (props?: VariantsType) => {
8 const durationIn = props?.durationIn;
9 const durationOut = props?.durationOut;
10 const easeIn = props?.easeIn;
11 const easeOut = props?.easeOut;
12
13 return {
14 // IN
15 inX: {
16 initial: { rotateX: -180, opacity: 0 },
17 animate: {
18 rotateX: 0,
19 opacity: 1,
20 transition: varTranEnter({ durationIn, easeIn }),
21 },
22 exit: {
23 rotateX: -180,
24 opacity: 0,
25 transition: varTranExit({ durationOut, easeOut }),
26 },
27 },
28 inY: {
29 initial: { rotateY: -180, opacity: 0 },
30 animate: {
31 rotateY: 0,
32 opacity: 1,
33 transition: varTranEnter({ durationIn, easeIn }),
34 },
35 exit: {
36 rotateY: -180,
37 opacity: 0,
38 transition: varTranExit({ durationOut, easeOut }),
39 },
40 },
41
42 // OUT
43 outX: {
44 initial: { rotateX: 0, opacity: 1 },
45 animate: {
46 rotateX: 70,
47 opacity: 0,
48 transition: varTranExit({ durationOut, easeOut }),
49 },
50 },
51 outY: {
52 initial: { rotateY: 0, opacity: 1 },
53 animate: {
54 rotateY: 70,
55 opacity: 0,
56 transition: varTranExit({ durationOut, easeOut }),
57 },
58 },
59 };
60};
Note: See TracBrowser for help on using the repository browser.