From 6448d0636d224f47dfaee8b90b3d353b4fc195c4 Mon Sep 17 00:00:00 2001 From: vicente Date: Wed, 1 Jul 2026 23:16:42 +0200 Subject: [PATCH] Init electron --- index.html | 21 +++++++++++++++++++++ index.js | 26 ++++++++++++++++++++++++++ package.json | 1 + 3 files changed, 48 insertions(+) create mode 100644 index.html create mode 100644 index.js diff --git a/index.html b/index.html new file mode 100644 index 0000000..4fad4f9 --- /dev/null +++ b/index.html @@ -0,0 +1,21 @@ + + + + + + + Hello from Electron renderer! + + +

Hello from Electron renderer!

+

👋

+

+ + + \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..8e92734 --- /dev/null +++ b/index.js @@ -0,0 +1,26 @@ +const { app, BrowserWindow } = require('electron/main') + +const createWindow = () => { + const win = new BrowserWindow({ + width: 800, + height: 600 + }) + + 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() + } +}) diff --git a/package.json b/package.json index 0b45d11..6f6807e 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "type": "commonjs", "main": "index.js", "scripts": { + "start": "electron .", "test": "echo \"Error: no test specified\" && exit 1" }, "devDependencies": {