@@ -141,11 +141,11 @@ Basic usage examples for a fade transition implemented in popular animation libr
141
141
to: ' (.*)' ,
142
142
in: async () => {
143
143
const container = document .querySelector (' #swup' );
144
- await container .animate ([{ opacity: 0 }, { opacity: 1 }], 500 ).finished ;
144
+ await container .animate ([{ opacity: 0 }, { opacity: 1 }], 250 ).finished ;
145
145
},
146
146
out: async () => {
147
147
const container = document .querySelector (' #swup' );
148
- await container .animate ([{ opacity: 1 }, { opacity: 0 }], 500 ).finished ;
148
+ await container .animate ([{ opacity: 1 }, { opacity: 0 }], 250 ).finished ;
149
149
}
150
150
}
151
151
```
@@ -156,15 +156,11 @@ Basic usage examples for a fade transition implemented in popular animation libr
156
156
{
157
157
from: ' (.*)' ,
158
158
to: ' (.*)' ,
159
- out : (done ) => {
160
- const container = document .querySelector (' #swup' );
161
- container .style .opacity = 1 ;
162
- gsap .to (container, { opacity: 0 , duration: 0.5 , onComplete: done });
159
+ out: async () => {
160
+ await gsap .to (' #swup' , { opacity: 0 , duration: 0.25 });
163
161
},
164
- in : (done ) => {
165
- const container = document .querySelector (' #swup' );
166
- container .style .opacity = 0 ;
167
- gsap .to (container, { opacity: 1 , duration: 0.5 , onComplete: done });
162
+ in: async () => {
163
+ await gsap .fromTo (' #swup' , { opacity: 0 }, { opacity: 1 , duration: 0.25 });
168
164
}
169
165
}
170
166
```
@@ -175,15 +171,11 @@ Basic usage examples for a fade transition implemented in popular animation libr
175
171
{
176
172
from: ' (.*)' ,
177
173
to: ' (.*)' ,
178
- out : (done ) => {
179
- const container = document .querySelector (' #swup' );
180
- container .style .opacity = 1 ;
181
- anime ({ targets: container, opacity: 0 , duration: 500 , complete: done });
174
+ out: async () => {
175
+ await anime ({ targets: ' #swup' , opacity: 0 , duration: 250 , easing: ' linear' }).finished ;
182
176
},
183
- in : (done ) => {
184
- const container = document .querySelector (' #swup' );
185
- container .style .opacity = 0 ;
186
- anime ({ targets: container, opacity: 1 , duration: 500 , complete: done });
177
+ in: async () => {
178
+ await anime ({ targets: ' #swup' , opacity: [0 , 1 ], duration: 250 , easing: ' linear' }).finished ;
187
179
}
188
180
}
189
181
```
0 commit comments