Skip to content

Commit

Permalink
🚧 Add initial project dependencies and configuration files
Browse files Browse the repository at this point in the history
  • Loading branch information
cliftonburt authored Nov 19, 2024
1 parent 0f703f6 commit 33494a5
Show file tree
Hide file tree
Showing 662 changed files with 95,758 additions and 36 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: CI

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Run a one-line script
run: echo Hello, world!
1 change: 0 additions & 1 deletion about.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ You can find the source code for Jekyll at GitHub:
[jekyll][jekyll-organization] /
[jekyll](https://github.com/jekyll/jekyll)


[jekyll-organization]: https://github.com/jekyll
99 changes: 64 additions & 35 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lines of Command</title>
<title>Chat with ChatGPT</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
background-color: #1e1e1e;
color: #d4d4d4;
background-color: #000;
color: #33ff33;
font-family: 'Courier New', Courier, monospace;
font-size: 16px;
text-shadow: 0 0 10px #33ff33;
}

#chat-container {
width: 800px; /* Increased width by 100% (from 400px to 800px) */
border: 1px solid #3c3c3c;
Expand All @@ -27,21 +24,21 @@
#chat-history {
height: 450px; /* Increased height by 150% (from 300px to 450px) */
overflow-y: auto;
border-bottom: 1px solid #3c3c3c;
border: 1px solid #33ff33;
margin-bottom: 10px;
padding: 10px;
background-color: #1e1e1e;
background-color: #000;
}
.message {
margin: 5px 0;
}
.user-message {
text-align: right;
color: #569cd6;
color: #33ff33;
}
.bot-message {
text-align: left;
color: #dcdcaa;
color: #33ff33;
}
#message-input {
width: calc(100% - 22px);
Expand All @@ -58,38 +55,70 @@
#message-input::placeholder {
color: #d4d4d4;
}

input[type="text"] {
background-color: #000;
color: #33ff33;
border: 1px solid #33ff33;
padding: 5px;
font-family: 'Courier New', Courier, monospace;
font-size: 16px;
}

button {
background-color: #000;
color: #33ff33;
border: 1px solid #33ff33;
padding: 5px 10px;
font-family: 'Courier New', Courier, monospace;
font-size: 16px;
cursor: pointer;
}

button:hover {
background-color: #33ff33;
color: #000;
}
</style>
</head>
<body>
<div id="chat-container">
<div id="chat-history"></div>
<input type="text" id="message-input" placeholder="Type a message..." />
<form id="chat-form">
<input type="text" id="user-input" placeholder="Type your message here..." required>
<button type="submit">Send</button>
</form>
</div>

<script>
const chatHistory = document.getElementById('chat-history');
const messageInput = document.getElementById('message-input');
document.getElementById('chat-form').addEventListener('submit', async (e) => {
e.preventDefault();
const userInput = document.getElementById('user-input').value;
document.getElementById('user-input').value = '';

const userMessageDiv = document.createElement('div');
userMessageDiv.classList.add('message', 'user-message');
userMessageDiv.textContent = userInput;
document.getElementById('chat-history').appendChild(userMessageDiv);

messageInput.addEventListener('keypress', function(event) {
if (event.key === 'Enter') {
const userMessage = messageInput.value;
if (userMessage.trim() !== '') {
addMessage(userMessage, 'user-message');
messageInput.value = '';
setTimeout(() => {
addMessage('This is a bot response.', 'bot-message');
}, 1000);
}
try {
const response = await fetch('/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ message: userInput })
});

const data = await response.json();
const botMessageDiv = document.createElement('div');
botMessageDiv.classList.add('message', 'bot-message');
botMessageDiv.textContent = data.message;
document.getElementById('chat-history').appendChild(botMessageDiv);
} catch (error) {
console.error('Error:', error);
}
});

function addMessage(text, className) {
const messageElement = document.createElement('div');
messageElement.className = `message ${className}`;
messageElement.textContent = text;
chatHistory.appendChild(messageElement);
chatHistory.scrollTop = chatHistory.scrollHeight;
}
</script>
</body>
</html>
1 change: 1 addition & 0 deletions node_modules/.bin/mime

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 33494a5

Please sign in to comment.