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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Modern Chat Interface</title>
|
7 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
8 |
+
<style>
|
9 |
+
* {
|
10 |
+
margin: 0;
|
11 |
+
padding: 0;
|
12 |
+
box-sizing: border-box;
|
13 |
+
font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
|
14 |
+
}
|
15 |
+
|
16 |
+
:root {
|
17 |
+
--primary: #4361ee;
|
18 |
+
--primary-light: #4895ef;
|
19 |
+
--secondary: #3f37c9;
|
20 |
+
--success: #4cc9f0;
|
21 |
+
--dark: #1d3557;
|
22 |
+
--light: #f8f9fa;
|
23 |
+
--gray: #6c757d;
|
24 |
+
--light-gray: #e9ecef;
|
25 |
+
--border-radius: 16px;
|
26 |
+
--shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
27 |
+
--transition: all 0.3s ease;
|
28 |
+
}
|
29 |
+
|
30 |
+
body {
|
31 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
32 |
+
height: 100vh;
|
33 |
+
display: flex;
|
34 |
+
justify-content: center;
|
35 |
+
align-items: center;
|
36 |
+
padding: 20px;
|
37 |
+
}
|
38 |
+
|
39 |
+
.chat-container {
|
40 |
+
width: 100%;
|
41 |
+
max-width: 900px;
|
42 |
+
height: 90vh;
|
43 |
+
background: white;
|
44 |
+
border-radius: var(--border-radius);
|
45 |
+
display: flex;
|
46 |
+
flex-direction: column;
|
47 |
+
overflow: hidden;
|
48 |
+
box-shadow: var(--shadow);
|
49 |
+
}
|
50 |
+
|
51 |
+
.chat-header {
|
52 |
+
background: var(--primary);
|
53 |
+
color: white;
|
54 |
+
padding: 20px;
|
55 |
+
display: flex;
|
56 |
+
align-items: center;
|
57 |
+
gap: 15px;
|
58 |
+
box-shadow: 0 2px 8px rgba(67, 97, 238, 0.3);
|
59 |
+
}
|
60 |
+
|
61 |
+
.avatar {
|
62 |
+
width: 45px;
|
63 |
+
height: 45px;
|
64 |
+
border-radius: 50%;
|
65 |
+
background: var(--success);
|
66 |
+
display: flex;
|
67 |
+
align-items: center;
|
68 |
+
justify-content: center;
|
69 |
+
font-weight: bold;
|
70 |
+
font-size: 18px;
|
71 |
+
}
|
72 |
+
|
73 |
+
.chat-header-info h2 {
|
74 |
+
font-weight: 600;
|
75 |
+
font-size: 1.3rem;
|
76 |
+
}
|
77 |
+
|
78 |
+
.chat-header-info p {
|
79 |
+
font-size: 0.85rem;
|
80 |
+
opacity: 0.9;
|
81 |
+
margin-top: 4px;
|
82 |
+
}
|
83 |
+
|
84 |
+
.chat-messages {
|
85 |
+
flex: 1;
|
86 |
+
padding: 20px;
|
87 |
+
overflow-y: auto;
|
88 |
+
background: var(--light);
|
89 |
+
display: flex;
|
90 |
+
flex-direction: column;
|
91 |
+
gap: 15px;
|
92 |
+
}
|
93 |
+
|
94 |
+
.message {
|
95 |
+
max-width: 70%;
|
96 |
+
padding: 12px 16px;
|
97 |
+
border-radius: var(--border-radius);
|
98 |
+
position: relative;
|
99 |
+
animation: fadeIn 0.3s ease;
|
100 |
+
line-height: 1.4;
|
101 |
+
box-shadow: var(--shadow);
|
102 |
+
}
|
103 |
+
|
104 |
+
@keyframes fadeIn {
|
105 |
+
from { opacity: 0; transform: translateY(10px); }
|
106 |
+
to { opacity: 1; transform: translateY(0); }
|
107 |
+
}
|
108 |
+
|
109 |
+
.received {
|
110 |
+
align-self: flex-start;
|
111 |
+
background: white;
|
112 |
+
border-bottom-left-radius: 4px;
|
113 |
+
}
|
114 |
+
|
115 |
+
.sent {
|
116 |
+
align-self: flex-end;
|
117 |
+
background: var(--primary-light);
|
118 |
+
color: white;
|
119 |
+
border-bottom-right-radius: 4px;
|
120 |
+
}
|
121 |
+
|
122 |
+
.message-time {
|
123 |
+
font-size: 0.7rem;
|
124 |
+
opacity: 0.7;
|
125 |
+
margin-top: 8px;
|
126 |
+
display: block;
|
127 |
+
}
|
128 |
+
|
129 |
+
.sent .message-time {
|
130 |
+
color: rgba(255, 255, 255, 0.8);
|
131 |
+
text-align: right;
|
132 |
+
}
|
133 |
+
|
134 |
+
.received .message-time {
|
135 |
+
color: var(--gray);
|
136 |
+
}
|
137 |
+
|
138 |
+
.chat-input-area {
|
139 |
+
padding: 15px;
|
140 |
+
background: white;
|
141 |
+
border-top: 1px solid var(--light-gray);
|
142 |
+
display: flex;
|
143 |
+
gap: 10px;
|
144 |
+
}
|
145 |
+
|
146 |
+
.chat-input {
|
147 |
+
flex: 1;
|
148 |
+
padding: 15px 20px;
|
149 |
+
border: 2px solid var(--light-gray);
|
150 |
+
border-radius: 30px;
|
151 |
+
font-size: 1rem;
|
152 |
+
outline: none;
|
153 |
+
transition: var(--transition);
|
154 |
+
}
|
155 |
+
|
156 |
+
.chat-input:focus {
|
157 |
+
border-color: var(--primary-light);
|
158 |
+
box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
|
159 |
+
}
|
160 |
+
|
161 |
+
.send-button {
|
162 |
+
width: 50px;
|
163 |
+
height: 50px;
|
164 |
+
border-radius: 50%;
|
165 |
+
background: var(--primary);
|
166 |
+
color: white;
|
167 |
+
border: none;
|
168 |
+
cursor: pointer;
|
169 |
+
display: flex;
|
170 |
+
align-items: center;
|
171 |
+
justify-content: center;
|
172 |
+
font-size: 18px;
|
173 |
+
transition: var(--transition);
|
174 |
+
box-shadow: var(--shadow);
|
175 |
+
}
|
176 |
+
|
177 |
+
.send-button:hover {
|
178 |
+
background: var(--secondary);
|
179 |
+
transform: translateY(-2px);
|
180 |
+
}
|
181 |
+
|
182 |
+
.send-button:active {
|
183 |
+
transform: translateY(0);
|
184 |
+
}
|
185 |
+
|
186 |
+
.status-indicator {
|
187 |
+
display: inline-block;
|
188 |
+
width: 8px;
|
189 |
+
height: 8px;
|
190 |
+
border-radius: 50%;
|
191 |
+
background: #20bf6b;
|
192 |
+
margin-left: 8px;
|
193 |
+
}
|
194 |
+
|
195 |
+
/* Responsive design */
|
196 |
+
@media (max-width: 768px) {
|
197 |
+
.chat-container {
|
198 |
+
height: 95vh;
|
199 |
+
border-radius: 12px;
|
200 |
+
}
|
201 |
+
|
202 |
+
.message {
|
203 |
+
max-width: 85%;
|
204 |
+
}
|
205 |
+
|
206 |
+
.chat-header {
|
207 |
+
padding: 15px;
|
208 |
+
}
|
209 |
+
|
210 |
+
.chat-input-area {
|
211 |
+
padding: 12px;
|
212 |
+
}
|
213 |
+
|
214 |
+
.chat-input {
|
215 |
+
padding: 12px 16px;
|
216 |
+
}
|
217 |
+
|
218 |
+
.send-button {
|
219 |
+
width: 45px;
|
220 |
+
height: 45px;
|
221 |
+
}
|
222 |
+
}
|
223 |
+
|
224 |
+
@media (max-width: 480px) {
|
225 |
+
body {
|
226 |
+
padding: 10px;
|
227 |
+
}
|
228 |
+
|
229 |
+
.chat-container {
|
230 |
+
height: 100vh;
|
231 |
+
border-radius: 0;
|
232 |
+
}
|
233 |
+
|
234 |
+
.chat-header {
|
235 |
+
padding: 12px;
|
236 |
+
}
|
237 |
+
|
238 |
+
.avatar {
|
239 |
+
width: 35px;
|
240 |
+
height: 35px;
|
241 |
+
font-size: 14px;
|
242 |
+
}
|
243 |
+
|
244 |
+
.chat-header-info h2 {
|
245 |
+
font-size: 1.1rem;
|
246 |
+
}
|
247 |
+
|
248 |
+
.chat-header-info p {
|
249 |
+
font-size: 0.75rem;
|
250 |
+
}
|
251 |
+
|
252 |
+
.chat-messages {
|
253 |
+
padding: 15px 10px;
|
254 |
+
}
|
255 |
+
|
256 |
+
.message {
|
257 |
+
max-width: 90%;
|
258 |
+
padding: 10px 14px;
|
259 |
+
font-size: 0.9rem;
|
260 |
+
}
|
261 |
+
|
262 |
+
.chat-input-area {
|
263 |
+
padding: 10px;
|
264 |
+
}
|
265 |
+
|
266 |
+
.send-button {
|
267 |
+
width: 40px;
|
268 |
+
height: 40px;
|
269 |
+
font-size: 16px;
|
270 |
+
}
|
271 |
+
}
|
272 |
+
|
273 |
+
/* Scrollbar styling */
|
274 |
+
.chat-messages::-webkit-scrollbar {
|
275 |
+
width: 6px;
|
276 |
+
}
|
277 |
+
|
278 |
+
.chat-messages::-webkit-scrollbar-track {
|
279 |
+
background: var(--light-gray);
|
280 |
+
border-radius: 3px;
|
281 |
+
}
|
282 |
+
|
283 |
+
.chat-messages::-webkit-scrollbar-thumb {
|
284 |
+
background: var(--gray);
|
285 |
+
border-radius: 3px;
|
286 |
+
}
|
287 |
+
|
288 |
+
.chat-messages::-webkit-scrollbar-thumb:hover {
|
289 |
+
background: var(--dark);
|
290 |
+
}
|
291 |
+
</style>
|
292 |
+
</head>
|
293 |
+
<body>
|
294 |
+
<div class="chat-container">
|
295 |
+
<div class="chat-header">
|
296 |
+
<div class="avatar">JD</div>
|
297 |
+
<div class="chat-header-info">
|
298 |
+
<h2>John Doe <span class="status-indicator"></span></h2>
|
299 |
+
<p>Online - Last seen just now</p>
|
300 |
+
</div>
|
301 |
+
</div>
|
302 |
+
|
303 |
+
<div class="chat-messages" id="chat-messages">
|
304 |
+
<div class="message received">
|
305 |
+
Hey there! How's your day going?
|
306 |
+
<span class="message-time">10:02 AM</span>
|
307 |
+
</div>
|
308 |
+
<div class="message sent">
|
309 |
+
Hi! It's going great, thanks for asking. How about yours?
|
310 |
+
<span class="message-time">10:03 AM</span>
|
311 |
+
</div>
|
312 |
+
<div class="message received">
|
313 |
+
Can't complain! Just working on some new projects.
|
314 |
+
<span class="message-time">10:05 AM</span>
|
315 |
+
</div>
|
316 |
+
<div class="message sent">
|
317 |
+
That sounds exciting! What kind of projects?
|
318 |
+
<span class="message-time">10:06 AM</span>
|
319 |
+
</div>
|
320 |
+
<div class="message received">
|
321 |
+
I'm building a new chat interface with modern CSS. It's coming along nicely!
|
322 |
+
<span class="message-time">10:08 AM</span>
|
323 |
+
</div>
|
324 |
+
<div class="message sent">
|
325 |
+
Nice! I love how clean and responsive this chat looks. The design is really modern.
|
326 |
+
<span class="message-time">10:10 AM</span>
|
327 |
+
</div>
|
328 |
+
<div class="message received">
|
329 |
+
Thanks! I used flexbox and some smooth animations to make it feel alive.
|
330 |
+
<span class="message-time">10:12 AM</span>
|
331 |
+
</div>
|
332 |
+
</div>
|
333 |
+
|
334 |
+
<div class="chat-input-area">
|
335 |
+
<input
|
336 |
+
type="text"
|
337 |
+
class="chat-input"
|
338 |
+
id="message-input"
|
339 |
+
placeholder="Type your message here..."
|
340 |
+
autocomplete="off"
|
341 |
+
>
|
342 |
+
<button class="send-button" id="send-button">
|
343 |
+
<i class="fas fa-paper-plane"></i>
|
344 |
+
</button>
|
345 |
+
</div>
|
346 |
+
</div>
|
347 |
+
|
348 |
+
<script>
|
349 |
+
document.addEventListener('DOMContentLoaded', () => {
|
350 |
+
const chatMessages = document.getElementById('chat-messages');
|
351 |
+
const messageInput = document.getElementById('message-input');
|
352 |
+
const sendButton = document.getElementById('send-button');
|
353 |
+
|
354 |
+
// Function to add a new message
|
355 |
+
function addMessage(text, isSent) {
|
356 |
+
if (!text.trim()) return;
|
357 |
+
|
358 |
+
const messageDiv = document.createElement('div');
|
359 |
+
messageDiv.classList.add('message');
|
360 |
+
messageDiv.classList.add(isSent ? 'sent' : 'received');
|
361 |
+
|
362 |
+
const now = new Date();
|
363 |
+
const timeString = now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
|
364 |
+
|
365 |
+
messageDiv.innerHTML = `
|
366 |
+
${text}
|
367 |
+
<span class="message-time">${timeString}</span>
|
368 |
+
`;
|
369 |
+
|
370 |
+
chatMessages.appendChild(messageDiv);
|
371 |
+
|
372 |
+
// Scroll to bottom
|
373 |
+
chatMessages.scrollTop = chatMessages.scrollHeight;
|
374 |
+
|
375 |
+
// Clear input
|
376 |
+
messageInput.value = '';
|
377 |
+
}
|
378 |
+
|
379 |
+
// Send message on button click
|
380 |
+
sendButton.addEventListener('click', () => {
|
381 |
+
addMessage(messageInput.value, true);
|
382 |
+
});
|
383 |
+
|
384 |
+
// Send message on Enter key (but not Shift+Enter)
|
385 |
+
messageInput.addEventListener('keydown', (e) => {
|
386 |
+
if (e.key === 'Enter' && !e.shiftKey) {
|
387 |
+
e.preventDefault();
|
388 |
+
addMessage(messageInput.value, true);
|
389 |
+
}
|
390 |
+
});
|
391 |
+
|
392 |
+
// Auto-scroll to bottom on load
|
393 |
+
chatMessages.scrollTop = chatMessages.scrollHeight;
|
394 |
+
|
395 |
+
// Simulate received messages periodically
|
396 |
+
setInterval(() => {
|
397 |
+
const responses = [
|
398 |
+
"That's interesting!",
|
399 |
+
"I totally agree with you.",
|
400 |
+
"What do you think about that?",
|
401 |
+
"I'm glad you mentioned it.",
|
402 |
+
"Let me know if you need any help!",
|
403 |
+
"Sounds like a plan!",
|
404 |
+
"I was just thinking the same thing."
|
405 |
+
];
|
406 |
+
|
407 |
+
if (Math.random() > 0.7) {
|
408 |
+
const randomResponse = responses[Math.floor(Math.random() * responses.length)];
|
409 |
+
addMessage(randomResponse, false);
|
410 |
+
}
|
411 |
+
}, 10000);
|
412 |
+
});
|
413 |
+
</script>
|
414 |
+
</body>
|
415 |
+
</html>
|