mirror of
https://github.com/TheGreyDiamond/Enlight.git
synced 2025-07-18 04:33:50 +02:00
Node.js deal with it
This commit is contained in:
50
index.js
Normal file
50
index.js
Normal file
@ -0,0 +1,50 @@
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
const ejs = require("eja");
|
||||
|
||||
function createWindow () {
|
||||
const win = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
win.setFullScreen(true);
|
||||
|
||||
win.loadFile('ui_templates/index.html')
|
||||
}
|
||||
|
||||
function createStartupInfo(){
|
||||
const win2 = new BrowserWindow({
|
||||
width: 400,
|
||||
height: 200,
|
||||
frame: false,
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
})
|
||||
win2.setFullScreen(false);
|
||||
win2.setAlwaysOnTop(true);
|
||||
|
||||
win2.loadFile('ui_templates/startUp.html')
|
||||
win2.show()
|
||||
}
|
||||
|
||||
function init(){
|
||||
createWindow();
|
||||
createStartupInfo();
|
||||
}
|
||||
|
||||
app.whenReady().then(init)
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('activate', () => {
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
createWindow()
|
||||
}
|
||||
})
|
Reference in New Issue
Block a user