Skip to content

Commit 728e404

Browse files
committed
Use FadeSplashScreenDuration from config.xml on browser platform
1 parent d96c08e commit 728e404

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/browser/SplashScreenProxy.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ var localSplashImage;
2828
var bgColor = "#464646";
2929
var imageSrc = '/img/logo.png';
3030
var splashScreenDelay = 3000; // in milliseconds
31+
var fadeSplashScreenDuration = 500; // in milliseconds
3132
var showSplashScreen = true; // show splashcreen by default
3233
var cordova = require('cordova');
3334
var 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

Comments
 (0)