File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,8 @@ export function crossfade({ fallback, ...defaults }: CrossfadeParams & {
188
188
const to = node . getBoundingClientRect ( ) ;
189
189
const dx = from . left - to . left ;
190
190
const dy = from . top - to . top ;
191
+ const dw = from . width / to . width ;
192
+ const dh = from . height / to . height ;
191
193
const d = Math . sqrt ( dx * dx + dy * dy ) ;
192
194
193
195
const style = getComputedStyle ( node ) ;
@@ -200,7 +202,8 @@ export function crossfade({ fallback, ...defaults }: CrossfadeParams & {
200
202
easing,
201
203
css : ( t , u ) => `
202
204
opacity: ${ t * opacity } ;
203
- transform: ${ transform } translate(${ u * dx } px,${ u * dy } px);
205
+ transform-origin: top left;
206
+ transform: ${ transform } translate(${ u * dx } px,${ u * dy } px) scale(${ t + ( 1 - t ) * dw } , ${ t + ( 1 - t ) * dh } );
204
207
`
205
208
} ;
206
209
}
You can’t perform that action at this time.
0 commit comments