From c11112256db14c1e63551067c074ee78c31a62bc Mon Sep 17 00:00:00 2001 From: Rushil Umaretiya Date: Mon, 14 Nov 2022 13:30:23 -0500 Subject: [PATCH] initial commit --- .gitignore | 2 + index.html | 20 + main.js | 42 + package.json | 50 + preload.js | 8 + renderer.js | 7 + styles.css | 51 + yarn.lock | 3084 ++++++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 3264 insertions(+) create mode 100644 .gitignore create mode 100644 index.html create mode 100644 main.js create mode 100644 package.json create mode 100644 preload.js create mode 100644 renderer.js create mode 100644 styles.css create mode 100644 yarn.lock diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..07d2252 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +out \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..1b57f35 --- /dev/null +++ b/index.html @@ -0,0 +1,20 @@ + + + + + + + + Hello World! + + +
+ +
+ + diff --git a/main.js b/main.js new file mode 100644 index 0000000..3c9bed7 --- /dev/null +++ b/main.js @@ -0,0 +1,42 @@ +// Modules to control application life and create native browser window +const {app, BrowserWindow} = require('electron') +const path = require('path') + +function createWindow () { + // Create the browser window. + const mainWindow = new BrowserWindow({ + fullscreen: true, + webPreferences: { + preload: path.join(__dirname, 'preload.js') + } + }) + + // and load the index.html of the app. + mainWindow.loadFile('index.html') + + // Open the DevTools. + // mainWindow.webContents.openDevTools() +} + +// This method will be called when Electron has finished +// initialization and is ready to create browser windows. +// Some APIs can only be used after this event occurs. +app.whenReady().then(() => { + createWindow() + + app.on('activate', function () { + // On macOS it's common to re-create a window in the app when the + // dock icon is clicked and there are no other windows open. + if (BrowserWindow.getAllWindows().length === 0) createWindow() + }) +}) + +// Quit when all windows are closed, except on macOS. There, it's common +// for applications and their menu bar to stay active until the user quits +// explicitly with Cmd + Q. +app.on('window-all-closed', function () { + if (process.platform !== 'darwin') app.quit() +}) + +// In this file you can include the rest of your app's specific main process +// code. You can also put them in separate files and require them here. diff --git a/package.json b/package.json new file mode 100644 index 0000000..fa49fc1 --- /dev/null +++ b/package.json @@ -0,0 +1,50 @@ +{ + "name": "gigantic-polish-contain-n0a5q", + "productName": "gigantic-polish-contain-n0a5q", + "description": "My Electron application description", + "keywords": [], + "main": "./main.js", + "version": "1.0.0", + "author": "rushilwiz", + "scripts": { + "start": "electron-forge start", + "package": "electron-forge package", + "make": "electron-forge make", + "publish": "electron-forge publish", + "lint": "echo \"No linting configured\"" + }, + "dependencies": {}, + "devDependencies": { + "@electron-forge/cli": "^6.0.0-beta.64", + "@electron-forge/maker-deb": "^6.0.0-beta.64", + "@electron-forge/maker-rpm": "^6.0.0-beta.64", + "@electron-forge/maker-squirrel": "^6.0.0-beta.64", + "@electron-forge/maker-zip": "^6.0.0-beta.64", + "electron": "^21.2.3" + }, + "config": { + "forge": { + "packagerConfig": {}, + "makers": [ + { + "name": "@electron-forge/maker-squirrel" + }, + { + "name": "@electron-forge/maker-zip", + "platforms": [ + "darwin" + ] + }, + { + "name": "@electron-forge/maker-deb", + "config": {} + }, + { + "name": "@electron-forge/maker-rpm", + "config": {} + } + ] + } + }, + "license": "MIT" +} diff --git a/preload.js b/preload.js new file mode 100644 index 0000000..ce1a98e --- /dev/null +++ b/preload.js @@ -0,0 +1,8 @@ +/** + * The preload script runs before. It has access to web APIs + * as well as Electron's renderer process modules and some + * polyfilled Node.js functions. + * + * https://www.electronjs.org/docs/latest/tutorial/sandbox + */ +console.log("stay calm.") \ No newline at end of file diff --git a/renderer.js b/renderer.js new file mode 100644 index 0000000..1e70849 --- /dev/null +++ b/renderer.js @@ -0,0 +1,7 @@ +/** + * This file is loaded via the