diff options
| author | Kumar Priyansh <[email protected]> | 2019-06-10 18:22:49 +0530 |
|---|---|---|
| committer | Kumar Priyansh <[email protected]> | 2019-06-10 18:22:49 +0530 |
| commit | a0d441c0838038d9d831c009eb3369486b263530 (patch) | |
| tree | 6d46192eb17c8e2ce6dfc1d76a02606bbc330e42 | |
| parent | 13c83faf8cf7e8f7eafe04d76cb9e7ec51f12d10 (diff) | |
| download | authorr-a0d441c0838038d9d831c009eb3369486b263530.tar.xz authorr-a0d441c0838038d9d831c009eb3369486b263530.zip | |
Added Main JS and Starter HTML
| -rw-r--r-- | main.js | 40 | ||||
| -rw-r--r-- | src/index.html | 12 |
2 files changed, 52 insertions, 0 deletions
@@ -0,0 +1,40 @@ +const {app, BrowserWindow} = require('electron') +const path = require('path') +const url = require('url') +let win + +function createWindow () { + // Create the browser window. + win = new BrowserWindow({width: 800, height: 600}) + + // and load the index.html of the app. + win.loadURL(url.format({ + pathname: path.join(__dirname, 'index.html'), + protocol: 'file:', + slashes: true + })) + + // Open the DevTools. + // win.webContents.openDevTools() + + // Emitted when the window is closed. + win.on('closed', () => { + // Dereference the window object, usually you would store windows + // in an array if your app supports multi windows, this is the time + // when you should delete the corresponding element. + win = null + }) +} +app.on('ready', createWindow) + +app.on('window-all-closed', () => { + if (process.platform !== 'darwin') { + app.quit() + } +}) + +app.on('activate', () => { + if (win === null) { + createWindow() + } +})
\ No newline at end of file diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..154412f --- /dev/null +++ b/src/index.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta http-equiv="X-UA-Compatible" content="ie=edge"> + <title>Document</title> +</head> +<body> + this works +</body> +</html>
\ No newline at end of file |
