<!DOCTYPE html> <html> <head> <meta charset="UTF-8"/> <title>Multiplayer chat…
- User
.container { display: flex; flex-direction: column; height: 100%; align-items: center; justify-content: center; }
.chat-window { width: 400px; height: 500px; border: 1px solid #ccc; overflow-y: scroll; display: flex; flex-direction: column-reverse; padding: 10px; margin-bottom: 20px; }
.chat-message { display: flex; margin-bottom: 10px; }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; margin-right: 10px; }
.chat-text { flex-grow: 1; background-color: #f2f2f2; padding: 10px; border-radius: 5px; }
.chat-input { width: 100%; padding: 10px; border: 1px solid #ccc; border-top: none; border-radius: 0 0 5px 5px; }
.chat-input:focus { outline: none; }
.chat-submit { width: 100%; padding: 10px; background-color: #4CAF50; color: #fff; border: none; border-radius: 5px; cursor: pointer; transition: background-color 0.3s; }
.chat-submit:hover { background-color: #45a049; }
.chat-submit:active { background-color: #3c903c; }
.error-message { color: red; margin-bottom: 10px; }
- Assistant
// Code to send the message to the server and display it in the chat window goes here
messageInput.value = ''; // Clear the input field after sending the message } }