@@ -39,9 +39,18 @@ namespace SharedElement {
3939 "ease-out"
4040 }
4141
42+ enum TransitionAnimationEnum {
43+ "move" ,
44+ "fade-in" ,
45+ "fade-out" ,
46+ "cross-fade"
47+ }
48+
49+ type TransitionAnimation = keyof typeof TransitionAnimationEnum ;
50+
4251 type EasingFunctionKeyword = keyof typeof EasingFunctionKeywordEnum ;
4352
44- type EasingFunction = EasingFunctionKeyword | `cubic-bezier(${ number } , ${ number } , ${ number } , ${ number } )` ;
53+ type EasingFunction = EasingFunctionKeyword | string ;
4554
4655 type TransformOriginGlobal = keyof typeof TransformOriginGlobalEnum ;
4756
@@ -58,16 +67,17 @@ namespace SharedElement {
5867
5968 interface SharedElementConfig {
6069 transform_origin ?: TransformOrigin ;
61- easing_function ?: EasingFunction ,
62- duration ?: number ,
70+ easing_function ?: EasingFunction ;
71+ duration ?: number ;
72+ animation ?: TransitionAnimation ;
6373 x ?: {
6474 duration ?: number ;
6575 easing_function ?: EasingFunction
66- }
76+ } ;
6777 y ?: {
6878 duration ?: number ;
6979 easing_function ?: EasingFunction
70- }
80+ } ;
7181 }
7282
7383
@@ -254,7 +264,15 @@ namespace SharedElement {
254264 { ( scene ) => {
255265 this . _scene = scene ;
256266 return (
257- < div ref = { this . set_ref . bind ( this ) } id = { `shared-element-${ this . _id } ` } className = { "shared-element" } style = { { opacity : this . _hidden ? '0' : '1' } } >
267+ < div
268+ ref = { this . set_ref . bind ( this ) }
269+ id = { `shared-element-${ this . _id } ` }
270+ className = { "shared-element" }
271+ style = { {
272+ display : this . _hidden ? 'block' : 'contents' ,
273+ opacity : this . _hidden ? '0' : '1'
274+ }
275+ } >
258276 { this . props . children }
259277 </ div >
260278 ) ;
0 commit comments