|
1 | 1 | @import "../lib.less"; |
2 | 2 |
|
3 | 3 | .@{veui-prefix}-transition { |
4 | | - // 渐隐渐现 |
5 | | - &-fade-leave-active { |
6 | | - transition-duration: 100ms; |
7 | | - } |
8 | | - |
9 | | - &-fade-enter-active { |
| 4 | + // 渐现 fade-in |
| 5 | + &-fade-in-enter-active { |
10 | 6 | transition-duration: 200ms; |
11 | | - } |
12 | | - |
13 | | - &-fade-leave-active, |
14 | | - &-fade-enter-active { |
15 | 7 | transition-property: opacity; |
16 | 8 | transition-timing-function: linear; |
17 | 9 | } |
18 | 10 |
|
19 | | - &-fade-leave-to, |
20 | | - &-fade-enter { |
| 11 | + &-fade-in-enter { |
21 | 12 | opacity: 0; |
22 | 13 | } |
23 | 14 |
|
24 | | - // 放大渐现,缩小渐隐 |
25 | | - &-fade-scale-leave-active { |
26 | | - transition-duration: 100ms; |
27 | | - } |
28 | | - |
29 | | - &-fade-scale-enter-active { |
| 15 | + // 放大渐现 scale-fade-in |
| 16 | + &-scale-fade-in-enter-active { |
30 | 17 | transition-duration: 200ms; |
31 | | - } |
32 | | - |
33 | | - &-fade-scale-leave-active, |
34 | | - &-fade-scale-enter-active { |
35 | 18 | transition-property: opacity, transform; |
36 | 19 | transition-timing-function: linear; |
37 | 20 | } |
38 | 21 |
|
39 | | - &-fade-scale-leave-to, |
40 | | - &-fade-scale-enter { |
| 22 | + &-scale-fade-in-enter { |
41 | 23 | opacity: 0; |
42 | 24 | transform: scale3d(0, 0, 1); |
43 | 25 | } |
44 | 26 |
|
45 | | - &-fade-scale-x-leave-active { |
46 | | - transition-duration: 100ms; |
| 27 | + // 移入 slide-in |
| 28 | + &-slide-in-enter-active { |
| 29 | + transition-property: transform; |
| 30 | + transition-duration: 200ms; |
| 31 | + transition-timing-function: ease-out; |
47 | 32 | } |
48 | 33 |
|
49 | | - &-fade-scale-x-enter-active { |
50 | | - transition-duration: 200ms; |
| 34 | + &-slide-in-enter { |
| 35 | + transform: translate3d( |
| 36 | + var(--dls-transition-translate-from-x, 0), |
| 37 | + var(--dls-transition-translate-from-y, 0), |
| 38 | + 0 |
| 39 | + ); |
51 | 40 | } |
52 | 41 |
|
53 | | - &-fade-scale-x-leave-active, |
54 | | - &-fade-scale-x-enter-active { |
| 42 | + // 渐现移入 slide-fade-in |
| 43 | + &-slide-fade-in-enter-active { |
55 | 44 | transition-property: opacity, transform; |
| 45 | + transition-duration: 200ms; |
56 | 46 | transition-timing-function: linear; |
57 | 47 | } |
58 | 48 |
|
59 | | - &-fade-scale-x-leave-to, |
60 | | - &-fade-scale-x-enter { |
| 49 | + &-slide-fade-in-enter { |
61 | 50 | opacity: 0; |
62 | | - transform: scale3d(0, 1, 1); |
| 51 | + transform: translate3d( |
| 52 | + var(--dls-transition-translate-from-x, 0), |
| 53 | + var(--dls-transition-translate-from-y, 0), |
| 54 | + 0 |
| 55 | + ); |
63 | 56 | } |
64 | 57 |
|
65 | | - &-fade-scale-y-leave-active { |
66 | | - transition-duration: 100ms; |
| 58 | + // 渐变移入 slide-scale-fade-in |
| 59 | + &-slide-scale-fade-in-enter-active { |
| 60 | + transition-property: opacity, transform; |
| 61 | + transition-duration: 200ms; |
| 62 | + transition-timing-function: linear; |
| 63 | + } |
| 64 | + |
| 65 | + &-slide-scale-fade-in-enter { |
| 66 | + opacity: 0; |
| 67 | + transform: translate3d( |
| 68 | + var(--dls-transition-translate-from-x, 0), |
| 69 | + var(--dls-transition-translate-from-y, 0), |
| 70 | + 0 |
| 71 | + ) |
| 72 | + scale3d(0, 0, 1); |
67 | 73 | } |
68 | 74 |
|
69 | | - &-fade-scale-y-enter-active { |
| 75 | + // 移动 move |
| 76 | + &-move { |
| 77 | + transition-property: transform; |
70 | 78 | transition-duration: 200ms; |
| 79 | + transform: translate3d( |
| 80 | + var(--dls-transition-translate-x, 0), |
| 81 | + var(--dls-transition-translate-y, 0), |
| 82 | + 0 |
| 83 | + ); |
71 | 84 | } |
72 | 85 |
|
73 | | - &-fade-scale-y-leave-active, |
74 | | - &-fade-scale-y-enter-active { |
75 | | - transition-property: opacity, transform; |
| 86 | + // 渐隐 fade-out |
| 87 | + &-fade-out-leave-active { |
| 88 | + transition-duration: 100ms; |
| 89 | + transition-property: opacity; |
76 | 90 | transition-timing-function: linear; |
77 | 91 | } |
78 | 92 |
|
79 | | - &-fade-scale-y-leave-to, |
80 | | - &-fade-scale-y-enter { |
| 93 | + &-fade-out-leave-to { |
81 | 94 | opacity: 0; |
82 | | - transform: scale3d(1, 0, 1); |
83 | 95 | } |
84 | 96 |
|
85 | | - // 移入,移出 |
86 | | - &-translate-leave-active { |
87 | | - transition-property: transform; |
| 97 | + // 缩小渐隐 scale-fade-out |
| 98 | + &-scale-fade-out-leave-active { |
88 | 99 | transition-duration: 100ms; |
89 | | - transition-timing-function: ease-in; |
| 100 | + transition-property: opacity, transform; |
| 101 | + transition-timing-function: linear; |
| 102 | + } |
| 103 | + |
| 104 | + &-scale-fade-out-leave-to { |
| 105 | + opacity: 0; |
| 106 | + transform: scale3d(0, 0, 1); |
90 | 107 | } |
91 | 108 |
|
92 | | - &-translate-enter-active { |
| 109 | + // 移出 slide-out |
| 110 | + &-slide-out-leave-active { |
| 111 | + transition-duration: 100ms; |
93 | 112 | transition-property: transform; |
94 | | - transition-duration: 200ms; |
95 | | - transition-timing-function: ease-out; |
| 113 | + transition-timing-function: ease-in; |
96 | 114 | } |
97 | 115 |
|
98 | | - &-translate-enter { |
| 116 | + &-slide-out-leave-to { |
99 | 117 | transform: translate3d( |
100 | | - var(--dls-transition-translate-from-x, 0), |
101 | | - var(--dls-transition-translate-from-y, 0), |
| 118 | + var(--dls-transition-translate-to-x, 0), |
| 119 | + var(--dls-transition-translate-to-y, 0), |
102 | 120 | 0 |
103 | 121 | ); |
104 | 122 | } |
105 | 123 |
|
106 | | - &-translate-leave-to { |
| 124 | + // 渐隐移出 slide-fade-out |
| 125 | + &-slide-fade-out-leave-active { |
| 126 | + transition-duration: 100ms; |
| 127 | + transition-property: opacity, transform; |
| 128 | + transition-timing-function: ease-in; |
| 129 | + } |
| 130 | + |
| 131 | + &-slide-fade-out-leave-to { |
| 132 | + opacity: 0; |
107 | 133 | transform: translate3d( |
108 | 134 | var(--dls-transition-translate-to-x, 0), |
109 | 135 | var(--dls-transition-translate-to-y, 0), |
110 | 136 | 0 |
111 | 137 | ); |
112 | 138 | } |
113 | 139 |
|
114 | | - &-fade-translate-scale-leave-active { |
115 | | - transition-property: opacity, transform; |
| 140 | + // 渐变移出 slide-scale-fade-out |
| 141 | + &-slide-scale-fade-out-leave-active { |
116 | 142 | transition-duration: 100ms; |
117 | | - } |
118 | | - |
119 | | - &-fade-translate-scale-enter-active { |
120 | 143 | transition-property: opacity, transform; |
121 | | - transition-duration: 200ms; |
122 | | - } |
123 | | - |
124 | | - &-fade-translate-scale-enter { |
125 | | - transform: translate3d( |
126 | | - var(--dls-transition-translate-from-x, 0), |
127 | | - var(--dls-transition-translate-from-y, 0), |
128 | | - 0 |
129 | | - ) |
130 | | - scale3d(0, 0, 1); |
| 144 | + transition-timing-function: ease-in; |
131 | 145 | } |
132 | 146 |
|
133 | | - &-fade-translate-scale-leave-to { |
| 147 | + &-slide-scale-fade-out-leave-to { |
| 148 | + opacity: 0; |
134 | 149 | transform: translate3d( |
135 | 150 | var(--dls-transition-translate-to-x, 0), |
136 | 151 | var(--dls-transition-translate-to-y, 0), |
137 | 152 | 0 |
138 | 153 | ) |
139 | 154 | scale3d(0, 0, 1); |
140 | 155 | } |
141 | | - |
142 | | - &-move { |
143 | | - transition-property: transform; |
144 | | - transition-duration: 200ms; |
145 | | - transform: translate3d( |
146 | | - var(--dls-transition-translate-x, 0), |
147 | | - var(--dls-transition-translate-y, 0), |
148 | | - 0 |
149 | | - ); |
150 | | - } |
151 | 156 | } |
0 commit comments