-
Notifications
You must be signed in to change notification settings - Fork 0
/
chat.html
54 lines (45 loc) · 1.62 KB
/
chat.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pinterest Chat</title>
<script src = "chat.js"></script>
<script src = "variables.js"></script>
<link rel = "stylesheet" href = "chat.css">
</head>
<body>
<div class="chat-container">
<div class="chat-header">
PinK! Chat
</div>
<div class="chat-body" id="chat-body">
<!-- Chat messages will be displayed here -->
</div>
<!-- New container for images -->
<div class="image-container" id="image-container">
<!-- Images will be displayed here -->
</div>
<div class="input-container">
<input type="text" id="message-input" placeholder="Type your message...">
<button class="send-button" onclick="sendMessage()">✈️</button>
</div>
<div class="softkey"><div class="softkey-left">...</div><div class="softkey-center">💬</div><div class="softkey-right">🚪</div></div>
</div>
<script>
function sendMessage() {
var messageInput = document.getElementById('message-input');
var chatBody = document.getElementById('chat-body');
if (messageInput.value.trim() !== '') {
var message = document.createElement('div');
message.className = 'message user-message';
message.textContent = messageInput.value;
chatBody.appendChild(message);
// You can add logic here to handle the response from the other user or server.
messageInput.value = '';
messageInput.focus();
}
}
</script>
</body>
</html>