1
Fork 0

Move main process to Electron folder

This commit is contained in:
KorbsStudio 2023-01-23 03:55:41 -05:00
parent 6733814fb0
commit 7d3f3d5ead
No known key found for this signature in database

33
electron/index.js Normal file
View file

@ -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()})