body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
#search-container {
max-width: 800px;
margin: 50px auto;
background-color: #fff;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
#chat-container {
max-width: 800px;
margin: 20px auto;
background-color: #fff;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
input, button {
padding: 10px;
margin: 5px;
}
#chat-log {
height: 200px;
overflow-y: auto;
border: 1px solid #ccc;
padding: 10px;
margin-bottom: 10px;
}
Search
Chat
function performSearch() {
const searchInput = document.getElementById('search-input').value;
// Implement search logic here (e.g., display search results)
alert(`Performing search: ${searchInput}`);
}
function sendMessage() {
const chatInput = document.getElementById('chat-input').value;
const chatLog = document.getElementById('chat-log');
// Implement chat logic here (e.g., using ChatGPT)
const response = `You: ${chatInput}
ChatGPT: Hello! How can I assist you?`;
chatLog.innerText += response + '
';
// Clear the input field
document.getElementById('chat-input').value = '';
}
0 Comments