Merge branch 'main' of https://github.com/6028570/GoodGarden
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
node_modules/
|
||||||
11
app.js
Normal file
11
app.js
Normal 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
11
index.html
Normal 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
46
main.js
Normal 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
1394
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
14
package.json
Normal file
14
package.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user