@@ -28,6 +28,7 @@ var localSplashImage;
28
28
var bgColor = "#464646" ;
29
29
var imageSrc = '/img/logo.png' ;
30
30
var splashScreenDelay = 3000 ; // in milliseconds
31
+ var fadeSplashScreenDuration = 500 ; // in milliseconds
31
32
var showSplashScreen = true ; // show splashcreen by default
32
33
var cordova = require ( 'cordova' ) ;
33
34
var configHelper = cordova . require ( 'cordova/confighelper' ) ;
@@ -93,11 +94,13 @@ var SplashScreen = {
93
94
localSplash = null ;
94
95
window . removeEventListener ( "resize" , onResize , false ) ;
95
96
97
+ var transitionCssString = "opacity " + fadeSplashScreenDuration + "ms ease-in-out" ;
98
+
96
99
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 ;
101
104
102
105
window . setTimeout ( function ( ) {
103
106
document . body . removeChild ( innerLocalSplash ) ;
@@ -126,6 +129,7 @@ function readPreferencesFromCfg(cfg) {
126
129
bgColor = cfg . getPreferenceValue ( 'SplashScreenBackgroundColor' ) || bgColor ;
127
130
splashImageWidth = cfg . getPreferenceValue ( 'SplashScreenWidth' ) || splashImageWidth ;
128
131
splashImageHeight = cfg . getPreferenceValue ( 'SplashScreenHeight' ) || splashImageHeight ;
132
+ fadeSplashScreenDuration = cfg . getPreferenceValue ( 'FadeSplashScreenDuration' ) || fadeSplashScreenDuration ;
129
133
autoHideSplashScreen = cfg . getPreferenceValue ( 'AutoHideSplashScreen' ) || autoHideSplashScreen ;
130
134
autoHideSplashScreen = ( autoHideSplashScreen === true || autoHideSplashScreen . toLowerCase ( ) === 'true' ) ;
131
135
} catch ( e ) {
0 commit comments