This commit is contained in:
mohammedcifci78
2024-02-09 10:39:28 +01:00
6 changed files with 1477 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
node_modules/

11
app.js Normal file
View File

@@ -0,0 +1,11 @@
function closeWindow() {
window.close();
}
document.getElementById("close").addEventListener("click", closeWindow);
function minimizeWindow() {
remote.getCurrentWindow().minimize();
}
// werkt niet!!!
document.getElementById("minimize").addEventListener("click", minimizeWindow);

11
index.html Normal file
View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>HALLO WERELD!!!!!</h1>
</body>
</html>

46
main.js Normal file
View File

@@ -0,0 +1,46 @@
const { app, BrowserWindow, nativeImage, shell } = require("electron");
const screen = require("electron").screen;
const path = require("path");
let mainWindow;
function createWindow() {
const iconPath = path.join(__dirname, "images/logo.png");
const icon = nativeImage.createFromPath(iconPath);
mainWindow = new BrowserWindow({
width: 450,
height: 500, //moet 500 zijn als frame false is
webPreferences: {
nodeIntegration: true,
},
resizable: false,
frame: false,
icon: icon,
alwaysOnTop: true,
backgroundColor: "red"
});
const { width, height } = screen.getPrimaryDisplay().workAreaSize;
mainWindow.setPosition(width - 450, height - 500);
mainWindow.loadURL("C:/Users/oomen/OneDrive - mboRijnland/Schooljaar 23-24/P3/ALA/GoodGarden/index.html");
mainWindow.on("closed", function () {
mainWindow = null;
});
}
app.on("ready", createWindow);
app.on("window-all-closed", function () {
if (process.platform !== "darwin") {
app.quit();
}
});
app.on("activate", function () {
if (mainWindow === null) {
createWindow();
}
});

1394
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

14
package.json Normal file
View File

@@ -0,0 +1,14 @@
{
"name": "app",
"description": "",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "electron main.js"
},
"author": "",
"license": "ISC",
"devDependencies": {
"electron": "^23.1.1"
}
}