move to electronjs folder

This commit is contained in:
Pritimay Sarkar
2023-08-08 10:30:38 +05:30
parent 7bfaee34b5
commit a04b918d8e
9 changed files with 15 additions and 96 deletions

30
electronjs/main.js Normal file
View File

@@ -0,0 +1,30 @@
const { app, BrowserWindow } = require('electron')
const path = require('path')
function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js')
}
})
win.loadFile('index.html')
}
app.whenReady().then(() => {
createWindow()
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})