aboutsummaryrefslogtreecommitdiff
path: root/src/main.js
diff options
context:
space:
mode:
authorKumar Priyansh <[email protected]>2020-07-17 20:17:19 +0530
committerKumar Priyansh <[email protected]>2020-07-17 20:17:19 +0530
commit65cd01d0d7eae5b5e94b32f4de5f62521726c846 (patch)
tree1de3784356ebfb600f734b15e80a9767efc9d702 /src/main.js
parent4281b106199b39822294a59fba0c26809019a006 (diff)
downloadauthorr-65cd01d0d7eae5b5e94b32f4de5f62521726c846.tar.xz
authorr-65cd01d0d7eae5b5e94b32f4de5f62521726c846.zip
Folder organisation & include native kit
Diffstat (limited to 'src/main.js')
-rw-r--r--src/main.js51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/main.js b/src/main.js
new file mode 100644
index 0000000..93e29c7
--- /dev/null
+++ b/src/main.js
@@ -0,0 +1,51 @@
+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,
+ frame: false,
+ // transparent: true,
+ vibrancy: 'dark',
+ titleBarStyle: 'hidden',
+ webPreferences: {
+ nodeIntegration: true
+ }
+ })
+
+ // and load the index.html of the app.
+ win.loadURL(url.format({
+ pathname: path.join(__dirname, 'views/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