diff options
| author | yum <yum.food.vr@gmail.com> | 2025-05-29 15:56:51 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-05-29 15:57:18 -0700 |
| commit | 1ede199387c072a85e8757a6aaec04d2c7cdeba4 (patch) | |
| tree | 68ecedd5f2f4c000c8f8e9045cfed7a49bdee0e4 /ui/index.js | |
| parent | 0ebc79354ace812731a5c9a0a670cecd1ea941d7 (diff) | |
Add basic electron+tailwind hello world
Diffstat (limited to 'ui/index.js')
| -rw-r--r-- | ui/index.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ui/index.js b/ui/index.js new file mode 100644 index 0000000..9751fb2 --- /dev/null +++ b/ui/index.js @@ -0,0 +1,29 @@ +const { app, BrowserWindow, ipcMain } = require('electron'); +const path = require('node:path'); + +function createWindow () { + const mainWindow = new BrowserWindow({ + width: 800, + height: 600, + webPreferences: { + preload: path.join(__dirname, 'preload.js'), + contextIsolation: true, + nodeIntegration: false + } + }); + + mainWindow.loadFile('index.html'); +} + +app.whenReady().then(() => { + createWindow(); + + app.on('activate', function () { + if (BrowserWindow.getAllWindows().length === 0) createWindow(); + }); +}); + +app.on('window-all-closed', function () { + if (process.platform !== 'darwin') app.quit(); +}); + |
