diff --git a/app/components/Settings.tsx b/app/components/Settings.tsx index ea1a818..697fb68 100644 --- a/app/components/Settings.tsx +++ b/app/components/Settings.tsx @@ -1,96 +1,8 @@ -import React, { useState, useEffect } from 'react'; +import React, { useState } from'react'; const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = ({ closeSettings, accountName }) => { const [activeSection, setActiveSection] = useState('general'); - // Theme settings state - const [backgroundColor, setBackgroundColor] = useState(getComputedStyle(document.documentElement).getPropertyValue('--background-color').trim()); - const [textColor, setTextColor] = useState(getComputedStyle(document.documentElement).getPropertyValue('--text-color').trim()); - const [inputBackgroundColor, setInputBackgroundColor] = useState(getComputedStyle(document.documentElement).getPropertyValue('--input-background-color').trim()); - const [inputButtonColor, setInputButtonColor] = useState(getComputedStyle(document.documentElement).getPropertyValue('--input-button-color').trim()); - const [inputButtonHoverColor, setInputButtonHoverColor] = useState(getComputedStyle(document.documentElement).getPropertyValue('--input-button-hover-color').trim()); - const [userMessageBackgroundColor, setUserMessageBackgroundColor] = useState(getComputedStyle(document.documentElement).getPropertyValue('--user-message-background-color').trim()); - const [userMessageTextColor, setUserMessageTextColor] = useState(getComputedStyle(document.documentElement).getPropertyValue('--user-message-text-color').trim()); - const [aiMessageBackgroundColor, setAiMessageBackgroundColor] = useState(getComputedStyle(document.documentElement).getPropertyValue('--ai-message-background-color').trim()); - const [aiMessageTextColor, setAiMessageTextColor] = useState(getComputedStyle(document.documentElement).getPropertyValue('--ai-message-text-color').trim()); - const [buttonBackgroundColor, setButtonBackgroundColor] = useState(getComputedStyle(document.documentElement).getPropertyValue('--button-background-color').trim()); - const [buttonHoverBackgroundColor, setButtonHoverBackgroundColor] = useState(getComputedStyle(document.documentElement).getPropertyValue('--button-hover-background-color').trim()); - const [modelsBackgroundColor, setModelsBackgroundColor] = useState(getComputedStyle(document.documentElement).getPropertyValue('--models-background-color').trim()); - const [historyBackgroundColor, setHistoryBackgroundColor] = useState(getComputedStyle(document.documentElement).getPropertyValue('--history-background-color').trim()); - const [leftPanelBackgroundColor, setLeftPanelBackgroundColor] = useState(getComputedStyle(document.documentElement).getPropertyValue('--left-panel-background-color').trim()); - const [conversationBackgroundColor, setConversationBackgroundColor] = useState(getComputedStyle(document.documentElement).getPropertyValue('--conversation-background-color').trim()); - const [popUpTextColor, setPopUpTextColor] = useState(getComputedStyle(document.documentElement).getPropertyValue('--pop-up-text').trim()); - const [inputBorderColor, setInputBorderColor] = useState(getComputedStyle(document.documentElement).getPropertyValue('--input-border-color').trim()); - const [fontFamily, setFontFamily] = useState(getComputedStyle(document.documentElement).getPropertyValue('--font-family').trim()); - const [fontSize, setFontSize] = useState(getComputedStyle(document.documentElement).getPropertyValue('--font-size').trim()); - - // General settings state - const [preferredLanguage, setPreferredLanguage] = useState('English'); - const [preferredCurrency, setPreferredCurrency] = useState('USD'); - const [dateFormat, setDateFormat] = useState('MM/DD/YYYY'); - const [timeFormat, setTimeFormat] = useState('12-hour'); - const [timeZone, setTimeZone] = useState('UTC'); - - // Privacy settings state - const [disableOnlineAI, setDisableOnlineAI] = useState(false); - const [disableChatHistory, setDisableChatHistory] = useState(false); - const [disableAIMemory, setDisableAIMemory] = useState(false); - - // FOSS settings state - const [openSourceMode, setOpenSourceMode] = useState(false); - - // Account settings state - const [newName, setNewName] = useState(''); - const [newEmail, setNewEmail] = useState(''); - const [newPassword, setNewPassword] = useState(''); - - // Theme selection - const [selectedTheme, setSelectedTheme] = useState('IOMARKET'); // Default value can be 'IOMARKET' - - - // Effect to update CSS variables on theme state change - useEffect(() => { - document.documentElement.style.setProperty('--background-color', backgroundColor); - document.documentElement.style.setProperty('--text-color', textColor); - document.documentElement.style.setProperty('--input-background-color', inputBackgroundColor); - document.documentElement.style.setProperty('--input-button-color', inputButtonColor); - document.documentElement.style.setProperty('--input-button-hover-color', inputButtonHoverColor); - document.documentElement.style.setProperty('--user-message-background-color', userMessageBackgroundColor); - document.documentElement.style.setProperty('--user-message-text-color', userMessageTextColor); - document.documentElement.style.setProperty('--ai-message-background-color', aiMessageBackgroundColor); - document.documentElement.style.setProperty('--ai-message-text-color', aiMessageTextColor); - document.documentElement.style.setProperty('--button-background-color', buttonBackgroundColor); - document.documentElement.style.setProperty('--button-hover-background-color', buttonHoverBackgroundColor); - document.documentElement.style.setProperty('--models-background-color', modelsBackgroundColor); - document.documentElement.style.setProperty('--history-background-color', historyBackgroundColor); - document.documentElement.style.setProperty('--left-panel-background-color', leftPanelBackgroundColor); - document.documentElement.style.setProperty('--conversation-background-color', conversationBackgroundColor); - document.documentElement.style.setProperty('--pop-up-text', popUpTextColor); - document.documentElement.style.setProperty('--input-border-color', inputBorderColor); - document.documentElement.style.setProperty('--font-family', fontFamily); - document.documentElement.style.setProperty('--font-size', fontSize); - }, [ - backgroundColor, - textColor, - inputBackgroundColor, - inputButtonColor, - inputButtonHoverColor, - userMessageBackgroundColor, - userMessageTextColor, - aiMessageBackgroundColor, - aiMessageTextColor, - buttonBackgroundColor, - buttonHoverBackgroundColor, - modelsBackgroundColor, - historyBackgroundColor, - leftPanelBackgroundColor, - conversationBackgroundColor, - popUpTextColor, - inputBorderColor, - fontFamily, - fontSize, - ]); - const renderSettingsContent = () => { switch (activeSection) { case 'general': @@ -98,430 +10,209 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (

General Settings

- - setPreferredLanguage(e.target.value)} - /> +

Change Language

+
- - setPreferredCurrency(e.target.value)} - /> +

Notifications

+
- - setDateFormat(e.target.value)} - /> +

Notification Frequency

+
- - setTimeFormat(e.target.value)} - /> +

Time Zone

+
- - setTimeZone(e.target.value)} - /> +

Auto-Save

+ +
+
+

Auto-Save Frequency

+ +
+
+

Default Currency

+ +
+
+

Date Format

+ +
+
+

Time Format

+
); - case 'privacy': return (

Privacy Settings

+

Data Collection

+

Location Access

+

Two-Factor Authentication

- +

Data Export

+ +
+
+

Cookie Policy

+ +
+
+

GDPR Compliance

+ +
+
+

CCPA Compliance

+ +
+
+

Biometric Data

+
); - - case 'theme': - return ( -
-

Theme Settings

- - {/* Dropdown to select theme */} -
-

Select Theme

- -
- - {/* Conditionally render theme settings only if "CUSTOM" is selected */} - {selectedTheme === 'CUSTOM' && ( - <> -
-

Font Size

- { - const newSize = `${e.target.value}px`; - setFontSize(newSize); - document.documentElement.style.setProperty('--font-size', newSize); // Update the CSS variable - }} - /> - {fontSize} -
-
-

Background Color

- setBackgroundColor(e.target.value)} - /> -
-
-

Text Color

- setTextColor(e.target.value)} - /> -
-
-

Input Background Color

- setInputBackgroundColor(e.target.value)} - /> -
-
-

Input Button Color

- setInputButtonColor(e.target.value)} - /> -
-
-

Input Button Hover Color

- setInputButtonHoverColor(e.target.value)} - /> -
-
-

User Message Background Color

- setUserMessageBackgroundColor(e.target.value)} - /> -
-
-

User Message Text Color

- setUserMessageTextColor(e.target.value)} - /> -
-
-

AI Message Background Color

- setAiMessageBackgroundColor(e.target.value)} - /> -
-
-

AI Message Text Color

- setAiMessageTextColor(e.target.value)} - /> -
-
-

Button Background Color

- setButtonBackgroundColor(e.target.value)} - /> -
-
-

Button Hover Background Color

- setButtonHoverBackgroundColor(e.target.value)} - /> -
-
-

Models Background Color

- setModelsBackgroundColor(e.target.value)} - /> -
-
-

History Background Color

- setHistoryBackgroundColor(e.target.value)} - /> -
-
-

Left Panel Background Color

- setLeftPanelBackgroundColor(e.target.value)} - /> -
-
-

Conversation Background Color

- setConversationBackgroundColor(e.target.value)} - /> -
-
-

Pop-up Text Color

- setPopUpTextColor(e.target.value)} - /> -
-
-

Input Border Color

- setInputBorderColor(e.target.value)} - /> -
-
-

Font Family

- -
- - )} -
- ); - - case 'foss': + case 'theme': return (
-

Free and Open Source Software (FOSS) Settings

+

Theme Settings

- +

Choose Theme Color

+ +
+
+

Font Size

+ +
+
+

Background Pattern

+ +
+
+

Font Family

+ +
+
+

Button Style

+
); - case 'account': return (

Account Settings

- - setNewName(e.target.value)} - /> +

Change Name

+
- - setNewEmail(e.target.value)} - /> +

Change Email

+
- - setNewPassword(e.target.value)} - /> +

Change Password

+ +
+
+

Delete Account

+
); - default: return null; } @@ -536,7 +227,6 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
  • setActiveSection('general')}>General
  • setActiveSection('privacy')}>Privacy
  • setActiveSection('theme')}>Theme
  • -
  • setActiveSection('foss')}>FOSS
  • setActiveSection('account')}>Account
  • @@ -548,8 +238,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = ( - ); }; -export default Settings; +export default Settings; \ No newline at end of file diff --git a/app/styles/Login.css b/app/styles/Login.css index c8c559e..c2754a9 100644 --- a/app/styles/Login.css +++ b/app/styles/Login.css @@ -36,8 +36,8 @@ /* Popup content box */ .popup-content { - background: var(--popup-background-color); /* Use variable for background color */ - color: var(--popup-text-color); /* Use variable for text color */ + background: var(--background-color); + color: var(--text-color); padding: 30px; border-radius: 10px; width: 300px; @@ -63,7 +63,7 @@ /* Close button */ .close-popup { - background: var(--close-button-color); /* Use variable for close button color */ + background: red; /* Exception to the rule */ color: var(--text-color); border: none; border-radius: 5px; @@ -73,7 +73,7 @@ } .log-into-account { - background: var(--login-button-color); /* Use variable for login button color */ + background: green; /* Exception to the rule */ color: var(--text-color); border: none; border-radius: 5px; @@ -111,6 +111,6 @@ } .popup-content p { - color: var(--popup-text-color); /* Use variable for paragraph text color */ + color: var(--pop-up-text); margin: 10px; } diff --git a/app/styles/Settings.css b/app/styles/Settings.css index 014a3a8..a3c7fa0 100644 --- a/app/styles/Settings.css +++ b/app/styles/Settings.css @@ -12,27 +12,18 @@ z-index: 10000; } -.settings-main h2 { - margin-bottom: 1em; -} +.settings-container{ -.settings-main p { - padding-bottom: 7px; -} - -/* Main container for the settings */ -.settings-container { display: grid; grid-template-columns: 1fr 3fr; /* 1fr for sidebar, 3fr for main content */ grid-auto-flow: column; - overflow-x: hidden; - height: 100%; /* Ensure it takes full height */ + overflow-x:hidden; } /* Settings content */ .settings-content { - background: var(--history-background-color); - color: var(--text-color); + background: #f5f5f5; + color: #333; padding: 20px; border-radius: 10px; width: 90%; @@ -40,15 +31,13 @@ height: 90%; max-height: 600px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); - overflow: hidden; /* Prevents overflow of the content */ + overflow: scroll; /* Prevents overflow of the content */ position: relative; /* Needed for absolute positioning of close button */ - display: flex; - flex-direction: column; /* Flexbox for vertical stacking */ } /* Sidebar styles */ .sidebar { - background: var(--settings-background-color); + background: #e0e0e0; padding: 20px; border-radius: 10px 0 0 10px; /* Rounded corners on the left side */ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); @@ -56,17 +45,15 @@ display: flex; flex-direction: column; grid-column: 1; /* Places sidebar in the first grid column */ - height: 100%; /* Ensures sidebar takes full height */ } /* Sidebar item styles */ .sidebar ul { list-style-type: none; padding: 0; - margin: 0; + margin: 0; /* Ensure no margin for the list */ display: flex; flex-direction: column; /* Make the ul a column */ - flex-grow: 1; /* Allows the list to take available space */ } .sidebar li { @@ -78,11 +65,11 @@ } .sidebar li:hover { - background: var(--input-button-hover-color); /* Highlight on hover */ + background: #d0d0d0; /* Highlight on hover */ } .sidebar li.active { - background: var(--button-hover-background-color); /* Active section highlight */ + background: #b0b0b0; /* Active section highlight */ } /* Main settings area */ @@ -91,14 +78,14 @@ padding: 20px; border-radius: 0 10px 10px 0; /* Rounded corners on the right side */ overflow-y: auto; /* Scroll if content exceeds height */ - display: flex; + display: flex; /* Ensure main settings area displays content correctly */ flex-direction: column; /* Stack content vertically */ } /* Close button positioning */ .close-popup { - background-color: var(--close-button-color); - color: var(--user-message-text-color); + background-color: #ff4d4d; + color: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); padding: 10px 20px; border: none; @@ -111,39 +98,21 @@ } .close-popup:hover { - background-color: var(--close-button-hover-color); /* Darker red on hover */ + background-color: #e63939; /* Darker red on hover */ } /* Additional styles for inputs and options */ -.settings-option { - margin-bottom: 20px; /* Adds space between each setting option */ - padding-bottom: 10px; /* Adds internal spacing */ - border-bottom: 1px solid var(--input-border-color); /* Optional, creates a separator between options */ -} - -.settings-option:last-child { - margin-bottom: 0; /* Removes bottom margin from last option */ - border-bottom: none; /* Removes separator from last option */ -} - .settings-option input[type="text"], .settings-option input[type="email"], .settings-option input[type="password"], .settings-option input[type="color"], .settings-option input[type="range"], .settings-option select { - border-color: var(--input-border-color); - color: var(--text-color); + border-color: #ccc; + color: #333; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); padding: 10px; border-radius: 5px; width: 100%; - margin-bottom: 10px; /* Adds spacing between inputs */ -} - -/* Optional additional spacing for labels */ -.settings-option label { - margin-bottom: 5px; - display: block; - font-weight: bold; + margin-bottom: 10px; /* Add spacing between inputs */ } diff --git a/app/styles/container.css b/app/styles/container.css index 08f254a..528c675 100644 --- a/app/styles/container.css +++ b/app/styles/container.css @@ -12,8 +12,6 @@ .left-panel { width: 25vw; /* Adjust as needed */ transition: width 0.3s ease, opacity 0.3s ease, visibility 0.3s ease; /* Smooth transitions for all properties */ - background-color: var(--left-panel-background-color); /* Use variable for background color */ - border-radius: 0 1em 0 0; } .left-panel.hidden { @@ -25,8 +23,6 @@ .conversation-container { flex: 1; transition: margin-left 0.3s ease; /* Smooth margin adjustment */ - background-color: var(--conversation-background-color); /* Use variable for background color */ - border-radius: 1em 0 0 0; } /* Adjust margin-left when panel is shown or hidden */ diff --git a/app/styles/doc.css b/app/styles/doc.css index eb06945..d924358 100644 --- a/app/styles/doc.css +++ b/app/styles/doc.css @@ -9,7 +9,7 @@ max-width: 900px; height: 80vh; margin: 0 auto; - background: var(--doc-background-color); /* Use variable for background */ + background: #fff; padding: 2rem; border-radius: 8px; box-shadow: 0 0 20px rgba(0, 0, 0, 0.3); @@ -18,27 +18,29 @@ .title { font-size: 2rem; - color: var(--doc-title-color); /* Use variable for title color */ + color: #333; margin-bottom: 1.5rem; } .subtitle { font-size: 1.5rem; - color: var(--doc-subtitle-color); /* Use variable for subtitle color */ + color: #555; margin-top: 2rem; margin-bottom: 1rem; } .subsection-title { font-size: 1.25rem; - color: var(--doc-subsection-title-color); /* Use variable for subsection title color */ + color: #666; margin-top: 1.5rem; margin-bottom: 0.75rem; } .paragraph { font-size: 1rem; - color: var(--doc-paragraph-color); /* Use variable for paragraph color */ + color: #333; margin-bottom: 1.5rem; line-height: 1.6; } + + diff --git a/app/styles/faq.css b/app/styles/faq.css index 1484722..05e93e5 100644 --- a/app/styles/faq.css +++ b/app/styles/faq.css @@ -11,7 +11,7 @@ max-width: 800px; width: 90%; padding: 20px; - background-color: var(--faq-background-color); /* Use variable for background */ + background-color: #222; border-radius: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); overflow-y: scroll; /* Allow vertical scrolling if content overflows */ @@ -21,7 +21,7 @@ #faq h2 { text-align: center; - color: var(--faq-heading-color); /* Use variable for heading color */ + color: #00ccff; font-size: 2em; margin-bottom: 20px; } @@ -30,22 +30,22 @@ margin-bottom: 20px; padding: 10px; border-radius: 5px; - background-color: var(--faq-item-background-color); /* Use variable for item background */ + background-color: #333; transition: background-color 0.3s ease-in-out; } .faq-item h3 { - color: var(--faq-item-heading-color); /* Use variable for item heading color */ + color: #00ccff; margin-bottom: 10px; font-size: 1.5em; } .faq-item p { - color: var(--faq-item-text-color); /* Use variable for item text color */ + color: #ddd; font-size: 1.1em; line-height: 1.5; } .faq-item:hover { - background-color: var(--faq-item-hover-background-color); /* Use variable for hover background */ + background-color: #444; } diff --git a/app/styles/global.css b/app/styles/global.css index f1bcfdf..2a2b956 100644 --- a/app/styles/global.css +++ b/app/styles/global.css @@ -14,34 +14,5 @@ body { background-color: var(--background-color); color: var(--text-color); font-family: var(--font-family); - font-size: var(--font-size); margin-bottom: 0.5em; } - - -header { - background-color: var(--header-background-color); - color: var(--header-text-color); - padding: 1rem; /* Adjust padding as needed */ -} - -button { - background-color: var(--button-background-color); - color: var(--text-color); - border: 1px solid var(--input-border-color); - transition: background-color 0.3s ease; -} - -button:hover { - background-color: var(--button-hover-background-color); -} - -input { - background-color: var(--input-background-color); - border: 1px solid var(--input-border-color); - color: var(--text-color); -} - -input:hover { - border-color: var(--button-hover-background-color); -} diff --git a/app/styles/header.css b/app/styles/header.css index eed0f9e..8ecc019 100644 --- a/app/styles/header.css +++ b/app/styles/header.css @@ -1,6 +1,6 @@ header { - background-color: var(--header-background-color); /* Use the new header background color */ - color: var(--header-text-color); /* Use the new header text color */ + background-color: var(--background-color); + color: black; width: 100%; text-decoration: none; position: fixed; @@ -24,7 +24,7 @@ header img { header a, header li button { - color: var(--header-text-color); /* Use the new header text color */ + color: black; text-decoration: none; transition: color 0.3s; border: none; @@ -34,5 +34,5 @@ header li button { header a:hover, header li button:hover { - color: var(--input-button-color); /* Keep the hover color */ + color: var(--input-button-color); } diff --git a/app/styles/history.css b/app/styles/history.css index 7bc9bcd..d1adcd0 100644 --- a/app/styles/history.css +++ b/app/styles/history.css @@ -29,7 +29,7 @@ .history ul li a { display: block; text-decoration: none; - color: var(--text-color); /* Use variable for link text color */ + color: white; width: 100%; padding: 5px; } diff --git a/app/styles/input.css b/app/styles/input.css index ceeb0b3..12b71e2 100644 --- a/app/styles/input.css +++ b/app/styles/input.css @@ -22,8 +22,8 @@ border: 2px solid var(--input-button-color); outline: none; margin-right: 10px; - background-color: var(--input-background-color); /* Use variable for background */ - color: var(--text-color); /* Use variable for text color */ + background-color: rgba(255, 255, 255, 0.9); + color: #333; transition: border-color 0.3s ease-in-out; height: 7vh; } @@ -36,7 +36,7 @@ padding: 1em; margin: 5px; background-color: var(--input-button-color); - color: var(--user-message-text-color); /* Use variable for button text color */ + color: white; border: none; border-radius: 50%; font-size: 1.5em; diff --git a/app/styles/models.css b/app/styles/models.css index c53d14b..9f853f1 100644 --- a/app/styles/models.css +++ b/app/styles/models.css @@ -1,20 +1,21 @@ .model-background { - grid-column: 1 / 2; - grid-row: 2 / 5; + grid-column: 1/2; + grid-row: 2/5; overflow-y: auto; - background-color: var(--models-background-color); /* Ensure this variable is defined */ + background-color: var(--models-background-color); border-radius: 2em; padding: 1em; margin-left: 1em; height: 40vh; box-sizing: border-box; + overflow: hidden; } .models { - grid-column: 1 / 2; - grid-row: 2 / 5; + grid-column: 1/2; + grid-row: 2/5; overflow-y: auto; - background-color: var(--models-background-color); /* Ensure this variable is defined */ + background-color: var(--models-background-color); border-radius: 2em; padding: 1em; height: 100%; @@ -54,7 +55,7 @@ display: flex; align-items: center; justify-content: center; - color: var(--text-color); /* Use variable for text color */ + color: #fff; border-radius: 5%; overflow: hidden; position: relative; @@ -69,7 +70,7 @@ width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); - color: var(--text-color); /* Use variable for overlay text color */ + color: white; display: flex; justify-content: center; align-items: center; @@ -102,7 +103,7 @@ .math-model { background-image: url(/img/math.jpg); - background-color: var(--background-color); /* Use variable for background color */ + background-color: white; background-position: center; background-repeat: no-repeat; background-size: contain; @@ -110,7 +111,7 @@ .language-model { background-image: url(/img/language.jpg); - background-color: #72cce4; /* Use variable for background color */ + background-color: #72cce4; background-repeat: no-repeat; background-size: contain; background-position: center; diff --git a/app/styles/output.css b/app/styles/output.css index f5d7924..f105f90 100644 --- a/app/styles/output.css +++ b/app/styles/output.css @@ -11,7 +11,8 @@ justify-content: flex-start; font-size: 1em; overflow-y: auto; - width: calc(100% - 2em); /* Corrected calculation for width */ + margin-bottom: 0; + width: 100% -2em; height: 70vh; margin-bottom: 1vh; } @@ -58,8 +59,10 @@ background: none; border: none; cursor: pointer; + background-color: var(--button-background-color); border-radius: 50%; padding: 10px; + padding-top: 0; transition: background-color 0.3s ease; } diff --git a/app/styles/responsive.css b/app/styles/responsive.css index 31f563d..b995946 100644 --- a/app/styles/responsive.css +++ b/app/styles/responsive.css @@ -1,6 +1,6 @@ /* Responsive behavior - applies only on smaller screens */ @media (max-width: 1200px) { - * { + *{ margin: 0; padding: 0; } @@ -28,7 +28,7 @@ padding: 0; } - header li { + header li{ display: flex; flex-direction: column; justify-content: center; @@ -47,46 +47,46 @@ } /* Left panel styles */ - .left-panel { + .left-panel { display: none; /* Initially hidden */ min-width: 90%; /* Takes full width when visible */ margin: 0; } - .left-panel.visible { + .left-panel.visible { display: block; } /* Conversation container styles */ - .conversation-container { + .conversation-container { width: 90%; height: 90%; } - .conversation-container.collapsed { + .conversation-container.collapsed { width: 0; padding: 0; border: none; overflow: hidden; } - .conversation-container.expanded { + .conversation-container.expanded { width: 100%; } /* Grid styles */ - .grid { + .grid { grid-template-columns: 1fr; /* One item per line */ } /* Model box styles */ - .model-box { + .model-box { max-width: none; /* Remove max-width */ margin: 0 auto; /* Center each model-box */ } /* Input styles */ - .input { + .input { grid-column: 1 / -1; gap: 10px; padding: 0.5em; @@ -95,35 +95,32 @@ width: 90%; } - .input input { + .input input { font-size: 1em; /* Adjust font size */ max-width: 65%; margin-right: 0; - border-color: var(--input-border-color); /* Use variable for input border */ - color: var(--text-color); /* Use variable for text color */ } - .input button { + .input button { height: 40px; /* Adjust button height */ width: 40px; /* Adjust button width */ font-size: 1.2em; /* Adjust button font size */ margin: auto; - background-color: var(--input-button-color); /* Use variable for button color */ - color: var(--user-message-text-color); /* Use variable for button text color */ } } -/* Responsive adjustments for the settings */ + +/* Responsive adjustments for the settings*/ @media (max-width: 768px) { .settings-content { - flex-direction: column; /* Stack sidebar and main content on smaller screens */ + flex-direction: column; /* Stack sidebar and main content on smaller screens */ } .sidebar { - width: 100%; /* Full width for sidebar */ + width: 100%; /* Full width for sidebar */ } .settings-main { - width: 100%; /* Full width for main content */ + width: 100%; /* Full width for main content */ } -} +} \ No newline at end of file diff --git a/app/styles/scrollbar.css b/app/styles/scrollbar.css index 7608126..5e2f6a1 100644 --- a/app/styles/scrollbar.css +++ b/app/styles/scrollbar.css @@ -8,10 +8,10 @@ } .scrollbar::-webkit-scrollbar-thumb { - background-color: var(--input-border-color); /* Use variable for thumb color */ + background-color: #ccc; border-radius: 4px; } .scrollbar::-webkit-scrollbar-track { - background-color: var(--history-background-color); /* Use variable for track color */ -} + background-color: #f1f1f1; +} \ No newline at end of file diff --git a/app/styles/user-ai-messages.css b/app/styles/user-ai-messages.css index ebb9da1..91a04d6 100644 --- a/app/styles/user-ai-messages.css +++ b/app/styles/user-ai-messages.css @@ -11,7 +11,7 @@ } .user-message { - background-color: var(--user-message-background-color); + background-color: var(--user-message-color); color: var(--text-color); border-bottom-right-radius: 0; margin-left: auto; @@ -19,9 +19,9 @@ } .ai-message { - background-color: var(--ai-message-background-color); + background-color: var(--ai-message-color); color: var(--text-color); border-bottom-left-radius: 0; margin-right: auto; text-align: left; -} +} \ No newline at end of file diff --git a/app/styles/variables.css b/app/styles/variables.css index e5b3bbc..97b3628 100644 --- a/app/styles/variables.css +++ b/app/styles/variables.css @@ -1,34 +1,16 @@ :root { - /* Colors */ - --header-background-color: #7e7e7e; /* New header background color */ - --header-text-color: #ffffff; /* Header text color */ - --background-color: #8B9635; /* Main background color */ - --text-color: #474D22; /* Main text color */ - --input-background-color: #ffffff; /* Background color for input fields */ - --input-button-color: #8B9635; /* Button color */ - --input-button-hover-color: #6b7c2b; /* Hover color for input buttons */ - --user-message-background-color: #8B9635; /* Background color for user messages */ - --user-message-text-color: #000; /* Text color for user messages */ - --ai-message-background-color: #FCFCEB; /* Background color for AI messages */ - --ai-message-text-color: #000; /* Text color for AI messages */ - --button-background-color: #8B9635; /* Button background color */ - --button-hover-background-color: #6b7c2b; /* Button hover color */ - --models-background-color: #ffffff; /* Background for models section */ - --history-background-color: #f9f9f9; /* Background color for history */ - --left-panel-background-color: #79832e; /* Background color for left panel */ - --conversation-background-color: #79832e; /* Background color for conversation container */ - --doc-background-color: #ffffff; /* Background color for documents */ - - /* FAQ Colors */ - --faq-background-color: #474D22; /* Background color for FAQ section */ - --faq-heading-color: #8B9635; /* Heading color for FAQ section */ - --faq-item-background-color: #fefefe; /* Background color for FAQ items */ - --faq-item-heading-color: #474D22; /* Heading color for FAQ items */ - --faq-item-text-color: #333; /* Text color for FAQ items */ - --faq-item-hover-background-color: #e0e0e0; /* Hover background color for FAQ items */ - - --pop-up-text: #000; /* Text color for pop-ups */ - --input-border-color: #8B9635; /* Input border color */ - --font-family: 'Poppins', 'sans-serif';/* Default font family */ - --font-size: 16px; + --background-color: white; + --text-color: white; + --font-family: Arial, sans-serif; + --history-background-color: rgb(0, 0, 48); + --models-background-color: rgb(0, 0, 48); + --output-background-color: black; + --user-message-color: rgb(0, 128, 255); + --ai-message-color: rgb(100, 100, 255); + --input-background-color: rgb(0, 0, 48); + --input-button-color: rgb(0, 128, 255); + --input-button-hover-color: rgb(0, 100, 200); + --scrollbar-track: rgb(91, 172, 253); + --scrollbar-thumb: rgb(0, 88, 176); + --pop-up-text: darkgrey; } diff --git a/py/ai.py b/py/ai.py index a8c5537..bfde713 100644 --- a/py/ai.py +++ b/py/ai.py @@ -1,6 +1,5 @@ from mistralai import Mistral from openai import OpenAI -import anthropic import ollama @@ -45,8 +44,7 @@ class AI: stream_response = client.chat.completions.create( model=model, - messages=messages, - stream=True + messages=messages ) with return_class.ai_response_lock: @@ -54,21 +52,4 @@ class AI: for chunk in stream_response: with return_class.ai_response_lock: - return_class.ai_response[access_token] += chunk.choices[0].delta.content - - @staticmethod - def process_anthropic(model, messages, return_class, access_token, api_key): - - client = anthropic.Anthropic(api_key=api_key) - - with return_class.ai_response_lock: - return_class.ai_response[access_token] = "" - - with client.messages.stream( - max_tokens=1024, - model=model, - messages=messages, - ) as stream: - for text in stream.text_stream: - with return_class.ai_response_lock: - return_class.ai_response[access_token] += text + return_class.ai_response[access_token] += chunk.choices[0].delta.content \ No newline at end of file diff --git a/py/api.py b/py/api.py index 55d0483..386cd4f 100644 --- a/py/api.py +++ b/py/api.py @@ -46,18 +46,6 @@ class API: thread.start() thread.join() return jsonify({'status': 200}) - elif model_type == "openai": - api_key = data.get('api_key') - thread = threading.Thread(target=self.ai.process_openai, args=(ai_model, messages, self, access_token, api_key)) - thread.start() - thread.join() - return jsonify({'status': 200}) - elif model_type == "anthropic": - api_key = data.get('api_key') - thread = threading.Thread(target=self.ai.process_anthropic, args=(ai_model, messages, self, access_token, api_key)) - thread.start() - thread.join() - return jsonify({'status': 200}) return jsonify({'status': 401, 'error': 'Invalid AI model type'}) diff --git a/py/requirements.txt b/py/requirements.txt index 8a79dc1..3c2be3b 100644 --- a/py/requirements.txt +++ b/py/requirements.txt @@ -3,6 +3,4 @@ flask-cors ollama mistralai openai -anthropic -pyOpenSSL -pywebview \ No newline at end of file +pyOpenSSL \ No newline at end of file diff --git a/py/webapp.py b/py/webapp.py deleted file mode 100644 index 6ad4725..0000000 --- a/py/webapp.py +++ /dev/null @@ -1,3 +0,0 @@ -import webview -webview.create_window('Interstellar AI', 'http://localhost:3000') -webview.start()