This commit is contained in:
avelino
2026-11-03 20:28:20 +01:00
commit c2b2b9e684
15 changed files with 3747 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
const { app, BrowserWindow } = require("electron");
const path = require("node:path");
function createWindow() {
const win = new BrowserWindow({
width: 1120,
height: 760,
minWidth: 760,
minHeight: 560,
backgroundColor: "#7daeb7",
title: "Template Design App",
webPreferences: {
preload: path.join(__dirname, "preload.cjs"),
contextIsolation: true,
nodeIntegration: false
}
});
win.loadURL("http://localhost:5173");
}
app.whenReady().then(() => {
createWindow();
app.on("activate", () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow();
});
});
app.on("window-all-closed", () => {
if (process.platform !== "darwin") app.quit();
});
+6
View File
@@ -0,0 +1,6 @@
const { contextBridge } = require("electron");
// Expose only safe, purpose-specific APIs here when the app needs them.
contextBridge.exposeInMainWorld("desktopApp", {
platform: process.platform
});