-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathmain.js
47 lines (41 loc) · 1.32 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const electron = require('electron');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
const path = require('path');
const url = require('url');
const ipc = require('electron').ipcMain
const dialog = electron.dialog;
let win;
app.on('ready', () => {
let main = null
let loading = new BrowserWindow({width:400, height:300, frame:false, icon: __dirname + '/assets/Icon.png'})
loading.once('show', () => {
main = new BrowserWindow({width:1800, height:800, minWidth:1600, minHeight:600, webPreferences: {
nodeIntegration: true
}, frame: false, icon: __dirname + '/assets/Icon.png', show: false })
main.webContents.once('dom-ready', () => {
main.show()
loading.hide()
loading.close()
})
main.loadURL(url.format({
pathname: path.join(__dirname, 'index.html'),
protocol: 'file:',
slashes: true
}));
})
loading.loadURL(url.format({
pathname: path.join(__dirname, 'loading.html'),
protocol: 'file:',
slashes: true
}));
loading.webContents.on('did-finish-load', function() {
loading.show();
});
});
//Quit when all windows are closed
app.on('window-all-closed', () => {
if(process.platorm !== "darwin"){
app.quit();
}
});