Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/browser/SplashScreenProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var localSplashImage;
var bgColor = "#464646";
var imageSrc = '/img/logo.png';
var splashScreenDelay = 3000; // in milliseconds
var fadeSplashScreenDuration = 500; // in milliseconds
var showSplashScreen = true; // show splashcreen by default
var cordova = require('cordova');
var configHelper = cordova.require('cordova/confighelper');
Expand Down Expand Up @@ -93,11 +94,13 @@ var SplashScreen = {
localSplash = null;
window.removeEventListener("resize", onResize, false);

var transitionCssString = "opacity " + fadeSplashScreenDuration + "ms ease-in-out";

innerLocalSplash.style.opacity = '0';
innerLocalSplash.style["-webkit-transition"] = "opacity 1s ease-in-out";
innerLocalSplash.style["-moz-transition"] = "opacity 1s ease-in-out";
innerLocalSplash.style["-ms-transition"] = "opacity 1s ease-in-out";
innerLocalSplash.style["-o-transition"] = "opacity 1s ease-in-out";
innerLocalSplash.style["-webkit-transition"] =
innerLocalSplash.style["-moz-transition"] =
innerLocalSplash.style["-ms-transition"] =
innerLocalSplash.style["-o-transition"] = transitionCssString;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh, does this work this way with foo = bar = baz = value;?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - wonders of JS :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other thing I'd like to discuss: Do we even need the prefixes besides for the IE? Looking at caniuse (https://caniuse.com/#feat=css-transitions) the only browser which does not support it unprefixed is the IE <10

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess prefixes could be left out .. just didn't want to mess too much with the code.


window.setTimeout(function () {
document.body.removeChild(innerLocalSplash);
Expand Down Expand Up @@ -126,6 +129,7 @@ function readPreferencesFromCfg(cfg) {
bgColor = cfg.getPreferenceValue('SplashScreenBackgroundColor') || bgColor;
splashImageWidth = cfg.getPreferenceValue('SplashScreenWidth') || splashImageWidth;
splashImageHeight = cfg.getPreferenceValue('SplashScreenHeight') || splashImageHeight;
fadeSplashScreenDuration = cfg.getPreferenceValue('FadeSplashScreenDuration') || fadeSplashScreenDuration;
autoHideSplashScreen = cfg.getPreferenceValue('AutoHideSplashScreen') || autoHideSplashScreen;
autoHideSplashScreen = (autoHideSplashScreen === true || autoHideSplashScreen.toLowerCase() === 'true');
} catch(e) {
Expand Down