diff --git a/src/main/index.ts b/src/main/index.ts index 17fdc3a..8f38c14 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -8,6 +8,22 @@ autoUpdater.autoDownload = false; autoUpdater.autoInstallOnAppQuit = true; let mainWindow; +let splashWindow: BrowserWindow; + +function createSplashWindow(): void { + splashWindow = new BrowserWindow({ + width: 350, + height: 350, + transparent: true, + frame: false, + alwaysOnTop: true + }); + splashWindow.loadFile('src/renderer/splash.html'); + splashWindow.center(); + splashWindow.setSkipTaskbar(true); + splashWindow.show(); +} + function createWindow(): void { // Create the browser window. mainWindow = new BrowserWindow({ @@ -22,8 +38,18 @@ function createWindow(): void { } }) + createSplashWindow(); + mainWindow.on('ready-to-show', () => { - mainWindow.show() + if (is.dev) { + setTimeout((): void => { + splashWindow.close(); + mainWindow.show(); + }, 2000); + } else { + splashWindow.close(); + mainWindow.show(); + } }) mainWindow.webContents.setWindowOpenHandler((details) => { diff --git a/src/renderer/splash.html b/src/renderer/splash.html new file mode 100644 index 0000000..6d0aa16 --- /dev/null +++ b/src/renderer/splash.html @@ -0,0 +1,33 @@ + + + + + Splash + + + + + + + + + + +