11const path = require ( 'path' ) ;
2+ //import for spalsh screen dependency
3+ const { initSplashScreen, OfficeTemplate } = require ( 'electron-splashscreen' ) ;
4+ //path resolver dependency for splash screen
5+ const { resolve } = require ( 'app-root-path' ) ;
6+
27
38const {
49 app,
@@ -82,7 +87,7 @@ ipcMain.on('update-file', () => {
8287const createWindow = ( ) => {
8388 // Create the browser window.
8489 // eslint-disable-next-line
85- const { width, height } = require ( 'electron' ) . screen . getPrimaryDisplay ( ) . size ;
90+ // const { width, height } = require('electron').screen.getPrimaryDisplay().size;
8691 mainWindow = new BrowserWindow ( {
8792 width : 1920 ,
8893 height : 1080 ,
@@ -98,11 +103,27 @@ const createWindow = () => {
98103 }
99104 } ) ;
100105
106+ //splash screen deets
107+ const hideSplashscreen = initSplashScreen ( {
108+ mainWindow,
109+ icon : resolve ( '/src/public/icons/png/64x64.png' ) ,
110+ url : OfficeTemplate ,
111+ width : 500 ,
112+ height : 300 ,
113+ brand : 'OS Labs' ,
114+ productName : 'ReacType' ,
115+ logo : resolve ( '/src/public/icons/png/64x64.png' ) ,
116+ color : '#3BBCAF' ,
117+ website : 'www.reactype.io' ,
118+ text : 'Initializing ...'
119+ } ) ;
120+
101121 // and load the index.html of the app.
102122 mainWindow . loadURL ( `file://${ __dirname } /build/index.html` ) ;
103123 // load page once window is loaded
104124 mainWindow . once ( 'ready-to-show' , ( ) => {
105125 mainWindow . show ( ) ;
126+ hideSplashscreen ( ) ;
106127 } ) ;
107128
108129 const template = [
0 commit comments