@@ -28,6 +28,7 @@ var localSplashImage;
2828var bgColor = "#464646" ;
2929var imageSrc = '/img/logo.png' ;
3030var splashScreenDelay = 3000 ; // in milliseconds
31+ var fadeSplashScreenDuration = 500 ; // in milliseconds
3132var showSplashScreen = true ; // show splashcreen by default
3233var cordova = require ( 'cordova' ) ;
3334var configHelper = cordova . require ( 'cordova/confighelper' ) ;
@@ -93,11 +94,13 @@ var SplashScreen = {
9394 localSplash = null ;
9495 window . removeEventListener ( "resize" , onResize , false ) ;
9596
97+ var transitionCssString = "opacity " + fadeSplashScreenDuration + "ms ease-in-out" ;
98+
9699 innerLocalSplash . style . opacity = '0' ;
97- innerLocalSplash . style [ "-webkit-transition" ] = "opacity 1s ease-in-out" ;
98- innerLocalSplash . style [ "-moz-transition" ] = "opacity 1s ease-in-out" ;
99- innerLocalSplash . style [ "-ms-transition" ] = "opacity 1s ease-in-out" ;
100- innerLocalSplash . style [ "-o-transition" ] = "opacity 1s ease-in-out" ;
100+ innerLocalSplash . style [ "-webkit-transition" ] =
101+ innerLocalSplash . style [ "-moz-transition" ] =
102+ innerLocalSplash . style [ "-ms-transition" ] =
103+ innerLocalSplash . style [ "-o-transition" ] = transitionCssString ;
101104
102105 window . setTimeout ( function ( ) {
103106 document . body . removeChild ( innerLocalSplash ) ;
@@ -126,6 +129,7 @@ function readPreferencesFromCfg(cfg) {
126129 bgColor = cfg . getPreferenceValue ( 'SplashScreenBackgroundColor' ) || bgColor ;
127130 splashImageWidth = cfg . getPreferenceValue ( 'SplashScreenWidth' ) || splashImageWidth ;
128131 splashImageHeight = cfg . getPreferenceValue ( 'SplashScreenHeight' ) || splashImageHeight ;
132+ fadeSplashScreenDuration = cfg . getPreferenceValue ( 'FadeSplashScreenDuration' ) || fadeSplashScreenDuration ;
129133 autoHideSplashScreen = cfg . getPreferenceValue ( 'AutoHideSplashScreen' ) || autoHideSplashScreen ;
130134 autoHideSplashScreen = ( autoHideSplashScreen === true || autoHideSplashScreen . toLowerCase ( ) === 'true' ) ;
131135 } catch ( e ) {
0 commit comments