2025-10-30 08:37:45 +08:00
|
|
|
const { app, BrowserWindow } = require("electron");
|
|
|
|
|
|
2025-10-30 08:55:54 +08:00
|
|
|
const path = require("node:path");
|
|
|
|
|
|
2025-10-30 08:37:45 +08:00
|
|
|
const createWindow = () => {
|
|
|
|
|
const win = new BrowserWindow({
|
|
|
|
|
width: 800,
|
|
|
|
|
height: 600,
|
2025-10-30 08:55:54 +08:00
|
|
|
webPreferences: {
|
|
|
|
|
preload: path.join(__dirname, "preload.js"),
|
|
|
|
|
},
|
2025-10-30 08:37:45 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
win.loadFile("index.html");
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
app.whenReady().then(() => {
|
|
|
|
|
createWindow();
|
|
|
|
|
});
|
2025-10-30 08:41:34 +08:00
|
|
|
|
|
|
|
|
app.on("window-all-closed", () => {
|
|
|
|
|
if (process.platform !== "darwin") app.quit();
|
|
|
|
|
});
|