1
1
const 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
+
2
7
3
8
const {
4
9
app,
@@ -82,7 +87,7 @@ ipcMain.on('update-file', () => {
82
87
const createWindow = ( ) => {
83
88
// Create the browser window.
84
89
// eslint-disable-next-line
85
- const { width, height } = require ( 'electron' ) . screen . getPrimaryDisplay ( ) . size ;
90
+ // const { width, height } = require('electron').screen.getPrimaryDisplay().size;
86
91
mainWindow = new BrowserWindow ( {
87
92
width : 1920 ,
88
93
height : 1080 ,
@@ -98,11 +103,27 @@ const createWindow = () => {
98
103
}
99
104
} ) ;
100
105
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
+
101
121
// and load the index.html of the app.
102
122
mainWindow . loadURL ( `file://${ __dirname } /build/index.html` ) ;
103
123
// load page once window is loaded
104
124
mainWindow . once ( 'ready-to-show' , ( ) => {
105
125
mainWindow . show ( ) ;
126
+ hideSplashscreen ( ) ;
106
127
} ) ;
107
128
108
129
const template = [
0 commit comments