From ee6f775b5b64bbca5a8a6d6b4840eb52b2a5be16 Mon Sep 17 00:00:00 2001 From: Wizzard Date: Sat, 9 Mar 2024 16:19:47 -0500 Subject: [PATCH] Restructure GUI folder & modify styles.css --- gui/css/styles.css | 19 +++++++++++++++++++ gui/{ => html}/index.html | 7 +++---- gui/{ => html}/prompt.html | 2 +- gui/{ => js}/kuzcoCore.js | 0 gui/{ => js}/preload.js | 0 gui/{ => js}/renderer.js | 0 gui/kuzco-gui.js | 10 +++++----- gui/package.json | 5 ++++- 8 files changed, 32 insertions(+), 11 deletions(-) rename gui/{ => html}/index.html (83%) rename gui/{ => html}/prompt.html (89%) rename gui/{ => js}/kuzcoCore.js (100%) rename gui/{ => js}/preload.js (100%) rename gui/{ => js}/renderer.js (100%) diff --git a/gui/css/styles.css b/gui/css/styles.css index 66bd07e..fecaa65 100644 --- a/gui/css/styles.css +++ b/gui/css/styles.css @@ -38,6 +38,16 @@ body { background-color: #6c757d; cursor: not-allowed; } +#submitApiKey { + padding: 10px 20px; + font-size: 1rem; + color: white; + background-color: #007BFF; + border: none; + border-radius: 5px; + cursor: pointer; + transition: background-color 0.2s; +} #stopButton { padding: 10px 20px; font-size: 1rem; @@ -85,6 +95,15 @@ body { color: inherit; background-color: #2c3e50; } +#apiKeyInput { + flex-grow: 1; + padding: 10px; + border: 1px solid #34495e; + border-radius: 5px; + color: inherit; + background-color: #2c3e50; +} + #promptInput:focus { outline: none; box-shadow: 0 0 0 2px #007BFF; diff --git a/gui/index.html b/gui/html/index.html similarity index 83% rename from gui/index.html rename to gui/html/index.html index ca6bd49..7e63c11 100644 --- a/gui/index.html +++ b/gui/html/index.html @@ -3,7 +3,7 @@ Kuzco Chat - +
@@ -22,12 +22,11 @@
- +
- - + diff --git a/gui/prompt.html b/gui/html/prompt.html similarity index 89% rename from gui/prompt.html rename to gui/html/prompt.html index 0087191..42c6b67 100644 --- a/gui/prompt.html +++ b/gui/html/prompt.html @@ -2,7 +2,7 @@ Enter API Key - +

Enter API Key

diff --git a/gui/kuzcoCore.js b/gui/js/kuzcoCore.js similarity index 100% rename from gui/kuzcoCore.js rename to gui/js/kuzcoCore.js diff --git a/gui/preload.js b/gui/js/preload.js similarity index 100% rename from gui/preload.js rename to gui/js/preload.js diff --git a/gui/renderer.js b/gui/js/renderer.js similarity index 100% rename from gui/renderer.js rename to gui/js/renderer.js diff --git a/gui/kuzco-gui.js b/gui/kuzco-gui.js index 66a1f3e..263b5fc 100644 --- a/gui/kuzco-gui.js +++ b/gui/kuzco-gui.js @@ -2,21 +2,21 @@ const { app, BrowserWindow, ipcMain, dialog } = require('electron'); const fs = require('fs'); const path = require('path'); const os = require('os'); -const KuzcoCore = require('./kuzcoCore'); +const KuzcoCore = require('./js/kuzcoCore'); function createWindow() { const mainWindow = new BrowserWindow({ width: 800, height: 600, webPreferences: { - preload: path.join(__dirname, 'preload.js'), + preload: path.join(__dirname, 'js/preload.js'), nodeIntegration: false, contextIsolation: true, enableRemoteModule: false, }, }); - mainWindow.loadFile('index.html'); + mainWindow.loadFile('html/index.html'); if (!kuzcoCore.apiKeyExists()) { promptForApiKey(mainWindow); @@ -44,7 +44,7 @@ let inputWindow; function promptForApiKey() { inputWindow = new BrowserWindow({ width: 300, - height: 200, + height: 300, webPreferences: { nodeIntegration: true, contextIsolation: false, @@ -52,7 +52,7 @@ function promptForApiKey() { }, }); - inputWindow.loadFile('prompt.html'); + inputWindow.loadFile('html/prompt.html'); inputWindow.on('closed', () => { inputWindow = null; }); diff --git a/gui/package.json b/gui/package.json index bf57659..0e94ff5 100644 --- a/gui/package.json +++ b/gui/package.json @@ -14,13 +14,16 @@ "dist-all": "electron-builder -mwl" }, "build": { - "appId": "com.yourname.kuzco", + "appId": "com.codjointops.kuzco", "productName": "KuzcoChat", "directories": { "output": "dist" }, "files": [ "**/*", + "css/**/*", + "js/**/*", + "html/**/*", "!**/*.ts", "!*.code-workspace", "!**/*.js.map",