Move main process to Electron folder
This commit is contained in:
parent
6733814fb0
commit
7d3f3d5ead
1 changed files with 33 additions and 0 deletions
33
electron/index.js
Normal file
33
electron/index.js
Normal 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()})
|
Reference in a new issue