it is a Grok AI gui application based on the grok ai api , an chatbot app. currrently token is fiexed at 200 you can chage it in the code
The Grok AI Chat Bot is a web-based application that facilitates interaction with a conversational AI model. It features a clean and responsive UI with options for settings, message history, and chat customization.
- Features
- Technologies Used
- File Structure
- Setup
- UI Components
- Customization
- Event Listeners
- Storage
- Future Enhancements
- Responsive Chat Interface:
- Dark-themed UI with smooth message scrolling.
- User and bot messages displayed distinctly.
- Settings Modal:
- Customize API key and system role message.
- Chat History:
- View previous chat sessions in a modal.
- Keyboard Input:
- Type messages in the input box and send with a button or Enter key.
- Reset Chat:
- Clear current messages to start fresh.
- Mobile-Friendly:
- Adjusted styles for smaller screens.
- HTML: Structuring the web app.
- CSS: Styling and responsive design.
- JavaScript: Handling interactions and functionality.
- Third-party Libraries:
- index.html # Main HTML file
- styles.css # Contains styling (inline in your case)
- scripts.js # JavaScript functionality
- assets/ # Any additional assets (images, etc.)
- Save the code as
index.html
. - Include the required scripts from the CDN:
marked.min.js
dompurify.min.js
- Open the file in a web browser to run the chat interface.
- HTML:
<div class="chat-container">
- CSS: Styled to occupy the full viewport height and contain messages.
- HTML:
<div class="chat-header">
- Features:
- History button (
🕓
). - Title (
The Grock Head
). - Settings button (
⚙️
).
- History button (
- HTML:
<div class="chat-messages">
- CSS:
overflow-y: auto
for scrollable content.
- HTML:
<div class="input-container"> <input type="text" class="input-box" id="userInput" placeholder="Type your Message..." /> <button class="send-button" id="sendMessage">↵</button> <button class="reset-button" id="resetChat">✎</button> </div>
- JavaScript: Handles sending and resetting of messages.
- Settings Modal:
- Customize API key and system role message.
- Save data in
localStorage
.
- History Modal:
- Display chat history in a tabular format.
- Google Fonts:
Doto
for headings.Space Grotesk
for body text.
- Background:
#202020
(dark theme). - Bot Messages:
#525252
(gray). - User Messages:
#ffffff
(white).
- CSS Variables:
--dot-bg
: Background for the dotted pattern.--dot-color
: Color for dots.
- Send Message:
- Triggered by
#sendMessage
button or pressing Enter. - Appends user message and a placeholder for bot response.
- Triggered by
- Reset Chat:
- Clears all messages when
#resetChat
button is clicked.
- Clears all messages when
- Open Settings:
- Displays the settings modal when
#openSettings
is clicked.
- Displays the settings modal when
- Close Settings:
- Hides the settings modal when
#closeSettings
is clicked.
- Hides the settings modal when
- Save API Key:
- Saves API key and system role message to
localStorage
.
- Saves API key and system role message to
- View History:
- Opens the history modal.
- Close History:
- Closes the history modal.
- LocalStorage:
- API Key:
localStorage.getItem("apiKey")
. - System Role:
localStorage.getItem("systemRoleMessage")
.
- API Key:
- Chat History:
- Saved in a structured format for retrieval.
- Backend Integration:
- Connect with an API endpoint for bot responses.
- Real-Time Chat:
- Add WebSocket support for live updates.
- Message Formatting:
- Allow Markdown and emoji support.
- Export Chat:
- Add an option to export chat history as a file.
- Themes:
- Allow switching between light and dark modes.
##Future Updates -electron app -mobile app -document upload -additional model support -voice ai -token customisation
- Ensure browser compatibility for all features.
- Optimize performance for larger chat histories.
- Use secure methods to store and handle API keys.
For issues or suggestions, please contact [Your Email/Support Link].