From 7d3f3d5ead3dd1aa506636d7a93a230136d29b10 Mon Sep 17 00:00:00 2001 From: KorbsStudio Date: Mon, 23 Jan 2023 03:55:41 -0500 Subject: [PATCH] Move main process to Electron folder --- electron/index.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 electron/index.js diff --git a/electron/index.js b/electron/index.js new file mode 100644 index 0000000..24c0d78 --- /dev/null +++ b/electron/index.js @@ -0,0 +1,33 @@ +const {app, BrowserWindow} = require('electron') +const isDev = require('electron-is-dev'); +const {TitlebarRespect} = require('electron-titlebar-respect') +const glasstron = require('glasstron-clarity'); + +function createWindow () { + const mainWindow = new glasstron.BrowserWindow({ + title: 'App Name', + minWidth: 400, + minHeight: 400, + width: 1200, + height: 800, + autoHideMenuBar: true, + blur: true, + frame: global.frame, + titleBarStyle: global.titleBarStyle, + trafficLightPosition: { x: 25, y: 25 }, // Position of Traffic Light buttons on macOS + titleBarOverlay: { // Background and Height of Windows titlebar buttons + color: '#191919', // Background + symbolColor: 'white', // Icon + height: '40px', + }, + webPreferences: { + webviewTag: true + } + }) + if (isDev) { + mainWindow.loadURL('http://localhost:3000') // Use a URL in development mode + } else { + mainWindow.loadFile('app/index.html') // Do NOT use a URL in production mode, as that can create a security risk for your customers who will use this app + } +} +app.whenReady().then(() => {createWindow()})