From 0efb03f9db46c3612899f7f15566764ad8d015a4 Mon Sep 17 00:00:00 2001 From: Fabio Date: Wed, 7 Jan 2026 22:53:47 +0800 Subject: [PATCH] Aggiungi main.js --- main.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 main.js diff --git a/main.js b/main.js new file mode 100644 index 0000000..7f998e7 --- /dev/null +++ b/main.js @@ -0,0 +1,27 @@ +// electron/main.js +const { app, BrowserWindow } = require('electron'); +const path = require('path'); + +function createWindow() { + const win = new BrowserWindow({ + width: 1200, + height: 800, + webPreferences: { + preload: path.join(__dirname, 'preload.js') + } + }); + + win.loadFile(path.join(__dirname, '../web/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(); +}); \ No newline at end of file