diff --git a/src/index.js b/src/main.js similarity index 52% rename from src/index.js rename to src/main.js index 89275e3..d43d793 100644 --- a/src/index.js +++ b/src/main.js @@ -1,32 +1,42 @@ // tutorial from https://www.twilio.com/blog/an-introduction-to-building-desktop-applications-with-electron -const {app, BrowserWindow} = require("electron"); -const path = require("path"); +const {app, BrowserWindow} = require("electron") +const path = require("path") +require('dotenv').config() const loadMainWindow = () => { const mainWindow = new BrowserWindow({ - width : 1200, - height: 800, + width : 1500, + height: 950, webPreferences: { preload: path.join(__dirname, "preload.js") - } + }, + show: false, + frame: false, + titleBarStyle: "hidden", + trafficLightPosition: {x: 14, y: 12} }); - mainWindow.loadFile(path.join(__dirname, "index.html")); + mainWindow.loadFile(path.join(__dirname, "index.html")) + + mainWindow.once('ready-to-show', mainWindow.show) + + // remove for prod + mainWindow.webContents.openDevTools() } // run above load main window on launch -app.on("ready", loadMainWindow); +app.on("ready", loadMainWindow) // non-macOS systems may not quit on all windows closed // this will quit on all windows closed if not macOS app.on("window-all-closed", () => { - app.quit(); + app.quit() }); // launch app when icon is clicked app.on("activate", () => { if (BrowserWindow.getAllWindows().length === 0) { - loadMainWindow(); + loadMainWindow() } }); \ No newline at end of file