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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
|
| 4 |
+
<head>
|
| 5 |
+
<meta charset="UTF-8">
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
+
<title>Glassmorphism Chat UI</title>
|
| 8 |
+
<!-- Importing Inter font -->
|
| 9 |
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 10 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 11 |
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap" rel="stylesheet">
|
| 12 |
+
<!-- Importing Remix Icon -->
|
| 13 |
+
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
|
| 14 |
+
|
| 15 |
+
<style>
|
| 16 |
+
/* --- CSS Variables & Reset --- */
|
| 17 |
+
:root {
|
| 18 |
+
/* Light Mode Palette */
|
| 19 |
+
--bg-body: #f0f4f8;
|
| 20 |
+
|
| 21 |
+
/* Glass Colors */
|
| 22 |
+
--glass-bg: rgba(255, 255, 255, 0.65);
|
| 23 |
+
--glass-border: rgba(255, 255, 255, 0.8);
|
| 24 |
+
--glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
|
| 25 |
+
--glass-highlight: rgba(255, 255, 255, 0.4);
|
| 26 |
+
|
| 27 |
+
/* Text Colors */
|
| 28 |
+
--text-main: #1e293b; /* Slate 800 */
|
| 29 |
+
--text-muted: #64748b; /* Slate 500 */
|
| 30 |
+
--text-on-gradient: #ffffff;
|
| 31 |
+
|
| 32 |
+
/* Accent / Gradients */
|
| 33 |
+
--primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
|
| 34 |
+
--accent-glow: rgba(168, 85, 247, 0.3);
|
| 35 |
+
|
| 36 |
+
/* Bubbles */
|
| 37 |
+
--bubble-sent-bg: var(--primary-gradient);
|
| 38 |
+
--bubble-sent-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
|
| 39 |
+
|
| 40 |
+
--bubble-received-bg: rgba(255, 255, 255, 0.75);
|
| 41 |
+
--bubble-received-border: rgba(255, 255, 255, 0.9);
|
| 42 |
+
|
| 43 |
+
/* Spacing & Radius */
|
| 44 |
+
--radius-app: 32px;
|
| 45 |
+
--radius-bubble: 20px;
|
| 46 |
+
--radius-input: 28px;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
* {
|
| 50 |
+
margin: 0;
|
| 51 |
+
padding: 0;
|
| 52 |
+
box-sizing: border-box;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
body {
|
| 56 |
+
font-family: 'Inter', sans-serif;
|
| 57 |
+
background-color: var(--bg-body);
|
| 58 |
+
height: 100vh;
|
| 59 |
+
width: 100vw;
|
| 60 |
+
display: flex;
|
| 61 |
+
justify-content: center;
|
| 62 |
+
align-items: center;
|
| 63 |
+
overflow: hidden;
|
| 64 |
+
color: var(--text-main);
|
| 65 |
+
position: relative;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
/* --- Ambient Background Orbs (To show off the blur) --- */
|
| 69 |
+
.orb {
|
| 70 |
+
position: absolute;
|
| 71 |
+
border-radius: 50%;
|
| 72 |
+
filter: blur(80px);
|
| 73 |
+
z-index: -1;
|
| 74 |
+
opacity: 0.8;
|
| 75 |
+
animation: float 10s infinite ease-in-out;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
.orb-1 {
|
| 79 |
+
width: 400px;
|
| 80 |
+
height: 400px;
|
| 81 |
+
background: #c7d2fe; /* Soft Indigo */
|
| 82 |
+
top: -50px;
|
| 83 |
+
left: -100px;
|
| 84 |
+
animation-delay: 0s;
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
.orb-2 {
|
| 88 |
+
width: 350px;
|
| 89 |
+
height: 350px;
|
| 90 |
+
background: #e9d5ff; /* Soft Purple */
|
| 91 |
+
bottom: -50px;
|
| 92 |
+
right: -50px;
|
| 93 |
+
animation-delay: -5s;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
.orb-3 {
|
| 97 |
+
width: 200px;
|
| 98 |
+
height: 200px;
|
| 99 |
+
background: #fecaca; /* Soft Red/Pink */
|
| 100 |
+
top: 40%;
|
| 101 |
+
left: 60%;
|
| 102 |
+
animation-delay: -2s;
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
@keyframes float {
|
| 106 |
+
0%, 100% { transform: translate(0, 0); }
|
| 107 |
+
50% { transform: translate(30px, -30px); }
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
/* --- Main Glass Container --- */
|
| 111 |
+
.app-container {
|
| 112 |
+
width: 100%;
|
| 113 |
+
height: 100%;
|
| 114 |
+
max-width: 480px;
|
| 115 |
+
background: var(--glass-bg);
|
| 116 |
+
backdrop-filter: blur(20px);
|
| 117 |
+
-webkit-backdrop-filter: blur(20px);
|
| 118 |
+
border: 1px solid var(--glass-border);
|
| 119 |
+
box-shadow: var(--glass-shadow);
|
| 120 |
+
display: flex;
|
| 121 |
+
flex-direction: column;
|
| 122 |
+
position: relative;
|
| 123 |
+
overflow: hidden;
|
| 124 |
+
transition: transform 0.3s ease;
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
/* Desktop specific styling */
|
| 128 |
+
@media (min-width: 481px) {
|
| 129 |
+
.app-container {
|
| 130 |
+
height: 90vh;
|
| 131 |
+
border-radius: var(--radius-app);
|
| 132 |
+
}
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
/* --- Header --- */
|
| 136 |
+
.chat-header {
|
| 137 |
+
flex-shrink: 0;
|
| 138 |
+
display: flex;
|
| 139 |
+
flex-direction: column;
|
| 140 |
+
padding: 1.5rem;
|
| 141 |
+
background: rgba(255, 255, 255, 0.4);
|
| 142 |
+
backdrop-filter: blur(10px);
|
| 143 |
+
border-bottom: 1px solid var(--glass-border);
|
| 144 |
+
z-index: 10;
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
.header-top {
|
| 148 |
+
display: flex;
|
| 149 |
+
justify-content: space-between;
|
| 150 |
+
align-items: center;
|
| 151 |
+
margin-bottom: 0.5rem;
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
.header-title h1 {
|
| 155 |
+
font-size: 1.25rem;
|
| 156 |
+
font-weight: 700;
|
| 157 |
+
background: var(--primary-gradient);
|
| 158 |
+
-webkit-background-clip: text;
|
| 159 |
+
-webkit-text-fill-color: transparent;
|
| 160 |
+
letter-spacing: -0.03em;
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
.header-actions button {
|
| 164 |
+
background: rgba(255, 255, 255, 0.6);
|
| 165 |
+
border: 1px solid var(--glass-border);
|
| 166 |
+
color: var(--text-main);
|
| 167 |
+
width: 38px;
|
| 168 |
+
height: 38px;
|
| 169 |
+
border-radius: 12px;
|
| 170 |
+
display: flex;
|
| 171 |
+
align-items: center;
|
| 172 |
+
justify-content: center;
|
| 173 |
+
cursor: pointer;
|
| 174 |
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
| 175 |
+
box-shadow: 0 2px 5px rgba(0,0,0,0.03);
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
.header-actions button:hover {
|
| 179 |
+
background: #ffffff;
|
| 180 |
+
transform: translateY(-2px);
|
| 181 |
+
box-shadow: 0 4px 12px rgba(0,0,0,0.06);
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
.header-meta {
|
| 185 |
+
display: flex;
|
| 186 |
+
justify-content: space-between;
|
| 187 |
+
align-items: center;
|
| 188 |
+
font-size: 0.8rem;
|
| 189 |
+
color: var(--text-muted);
|
| 190 |
+
font-weight: 500;
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
.online-status {
|
| 194 |
+
display: flex;
|
| 195 |
+
align-items: center;
|
| 196 |
+
gap: 6px;
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
.status-dot {
|
| 200 |
+
width: 8px;
|
| 201 |
+
height: 8px;
|
| 202 |
+
background-color: #10b981;
|
| 203 |
+
border-radius: 50%;
|
| 204 |
+
box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
.anycoder-link {
|
| 208 |
+
color: #6366f1;
|
| 209 |
+
text-decoration: none;
|
| 210 |
+
font-weight: 600;
|
| 211 |
+
transition: opacity 0.2s;
|
| 212 |
+
position: relative;
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
.anycoder-link::after {
|
| 216 |
+
content: '';
|
| 217 |
+
position: absolute;
|
| 218 |
+
width: 100%;
|
| 219 |
+
height: 2px;
|
| 220 |
+
bottom: -2px;
|
| 221 |
+
left: 0;
|
| 222 |
+
background-color: #6366f1;
|
| 223 |
+
transform: scaleX(0);
|
| 224 |
+
transform-origin: bottom right;
|
| 225 |
+
transition: transform 0.25s ease-out;
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
.anycoder-link:hover::after {
|
| 229 |
+
transform: scaleX(1);
|
| 230 |
+
transform-origin: bottom left;
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
/* --- Chat Body --- */
|
| 234 |
+
.chat-body {
|
| 235 |
+
flex: 1;
|
| 236 |
+
padding: 1.5rem;
|
| 237 |
+
overflow-y: auto;
|
| 238 |
+
display: flex;
|
| 239 |
+
flex-direction: column;
|
| 240 |
+
gap: 1.25rem;
|
| 241 |
+
scroll-behavior: smooth;
|
| 242 |
+
}
|
| 243 |
+
|
| 244 |
+
/* Light Scrollbar */
|
| 245 |
+
.chat-body::-webkit-scrollbar {
|
| 246 |
+
width: 5px;
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
.chat-body::-webkit-scrollbar-track {
|
| 250 |
+
background: transparent;
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
.chat-body::-webkit-scrollbar-thumb {
|
| 254 |
+
background-color: rgba(0, 0, 0, 0.1);
|
| 255 |
+
border-radius: 10px;
|
| 256 |
+
}
|
| 257 |
+
|
| 258 |
+
/* Messages */
|
| 259 |
+
.message {
|
| 260 |
+
max-width: 80%;
|
| 261 |
+
padding: 14px 20px;
|
| 262 |
+
font-size: 0.95rem;
|
| 263 |
+
line-height: 1.6;
|
| 264 |
+
position: relative;
|
| 265 |
+
animation: messagePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
|
| 266 |
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
|
| 267 |
+
}
|
| 268 |
+
|
| 269 |
+
/* Received (Left) - Glass Style */
|
| 270 |
+
.message.received {
|
| 271 |
+
align-self: flex-start;
|
| 272 |
+
background-color: var(--bubble-received-bg);
|
| 273 |
+
backdrop-filter: blur(8px);
|
| 274 |
+
border: 1px solid var(--bubble-received-border);
|
| 275 |
+
color: var(--text-main);
|
| 276 |
+
border-bottom-left-radius: 4px;
|
| 277 |
+
border-radius: var(--radius-bubble);
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
/* Sent (Right) - Gradient Style */
|
| 281 |
+
.message.sent {
|
| 282 |
+
align-self: flex-end;
|
| 283 |
+
background: var(--bubble-sent-bg);
|
| 284 |
+
color: var(--text-on-gradient);
|
| 285 |
+
border-bottom-right-radius: 4px;
|
| 286 |
+
border-radius: var(--radius-bubble);
|
| 287 |
+
box-shadow: var(--bubble-sent-shadow);
|
| 288 |
+
border: none;
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
.message-meta {
|
| 292 |
+
font-size: 0.65rem;
|
| 293 |
+
margin-top: 6px;
|
| 294 |
+
opacity: 0.7;
|
| 295 |
+
display: block;
|
| 296 |
+
text-align: right;
|
| 297 |
+
font-weight: 500;
|
| 298 |
+
}
|
| 299 |
+
|
| 300 |
+
/* Animations */
|
| 301 |
+
@keyframes messagePop {
|
| 302 |
+
0% {
|
| 303 |
+
opacity: 0;
|
| 304 |
+
transform: translateY(20px) scale(0.9);
|
| 305 |
+
}
|
| 306 |
+
100% {
|
| 307 |
+
opacity: 1;
|
| 308 |
+
transform: translateY(0) scale(1);
|
| 309 |
+
}
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
/* --- Empty State --- */
|
| 313 |
+
.empty-state {
|
| 314 |
+
display: flex;
|
| 315 |
+
flex-direction: column;
|
| 316 |
+
align-items: center;
|
| 317 |
+
justify-content: center;
|
| 318 |
+
height: 100%;
|
| 319 |
+
color: var(--text-muted);
|
| 320 |
+
text-align: center;
|
| 321 |
+
padding-bottom: 80px;
|
| 322 |
+
animation: fadeIn 0.8s ease-out;
|
| 323 |
+
}
|
| 324 |
+
|
| 325 |
+
.empty-state i {
|
| 326 |
+
font-size: 3.5rem;
|
| 327 |
+
margin-bottom: 1rem;
|
| 328 |
+
color: #a855f7;
|
| 329 |
+
opacity: 0.5;
|
| 330 |
+
background: var(--glass-bg);
|
| 331 |
+
padding: 20px;
|
| 332 |
+
border-radius: 50%;
|
| 333 |
+
box-shadow: var(--glass-shadow);
|
| 334 |
+
backdrop-filter: blur(5px);
|
| 335 |
+
}
|
| 336 |
+
|
| 337 |
+
@keyframes fadeIn {
|
| 338 |
+
from { opacity: 0; transform: translateY(10px); }
|
| 339 |
+
to { opacity: 1; transform: translateY(0); }
|
| 340 |
+
}
|
| 341 |
+
|
| 342 |
+
/* --- Input Area --- */
|
| 343 |
+
.chat-input-area {
|
| 344 |
+
padding: 1.5rem;
|
| 345 |
+
background: rgba(255, 255, 255, 0.3);
|
| 346 |
+
backdrop-filter: blur(15px);
|
| 347 |
+
border-top: 1px solid var(--glass-border);
|
| 348 |
+
display: flex;
|
| 349 |
+
align-items: center;
|
| 350 |
+
gap: 12px;
|
| 351 |
+
}
|
| 352 |
+
|
| 353 |
+
.input-wrapper {
|
| 354 |
+
flex: 1;
|
| 355 |
+
position: relative;
|
| 356 |
+
background-color: rgba(255, 255, 255, 0.6);
|
| 357 |
+
border-radius: var(--radius-input);
|
| 358 |
+
border: 1px solid var(--glass-border);
|
| 359 |
+
box-shadow: inset 0 2px 4px rgba(0,0,0,0.01);
|
| 360 |
+
transition: all 0.3s ease;
|
| 361 |
+
display: flex;
|
| 362 |
+
align-items: center;
|
| 363 |
+
}
|
| 364 |
+
|
| 365 |
+
.input-wrapper:focus-within {
|
| 366 |
+
background-color: rgba(255, 255, 255, 0.9);
|
| 367 |
+
border-color: rgba(168, 85, 247, 0.4);
|
| 368 |
+
box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.1);
|
| 369 |
+
transform: translateY(-1px);
|
| 370 |
+
}
|
| 371 |
+
|
| 372 |
+
#messageInput {
|
| 373 |
+
width: 100%;
|
| 374 |
+
border: none;
|
| 375 |
+
background: transparent;
|
| 376 |
+
padding: 16px 20px;
|
| 377 |
+
font-family: inherit;
|
| 378 |
+
font-size: 1rem;
|
| 379 |
+
color: var(--text-main);
|
| 380 |
+
outline: none;
|
| 381 |
+
}
|
| 382 |
+
|
| 383 |
+
#messageInput::placeholder {
|
| 384 |
+
color: var(--text-muted);
|
| 385 |
+
opacity: 0.8;
|
| 386 |
+
}
|
| 387 |
+
|
| 388 |
+
#sendBtn {
|
| 389 |
+
background: var(--primary-gradient);
|
| 390 |
+
color: white;
|
| 391 |
+
border: none;
|
| 392 |
+
width: 52px;
|
| 393 |
+
height: 52px;
|
| 394 |
+
border-radius: 50%;
|
| 395 |
+
display: flex;
|
| 396 |
+
align-items: center;
|
| 397 |
+
justify-content: center;
|
| 398 |
+
cursor: pointer;
|
| 399 |
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
| 400 |
+
box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
|
| 401 |
+
flex-shrink: 0;
|
| 402 |
+
}
|
| 403 |
+
|
| 404 |
+
#sendBtn:hover {
|
| 405 |
+
transform: scale(1.05) translateY(-2px);
|
| 406 |
+
box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
|
| 407 |
+
}
|
| 408 |
+
|
| 409 |
+
#sendBtn:active {
|
| 410 |
+
transform: scale(0.95);
|
| 411 |
+
}
|
| 412 |
+
|
| 413 |
+
#sendBtn i {
|
| 414 |
+
font-size: 1.3rem;
|
| 415 |
+
margin-left: 2px;
|
| 416 |
+
}
|
| 417 |
+
|
| 418 |
+
</style>
|
| 419 |
+
</head>
|
| 420 |
+
|
| 421 |
+
<body>
|
| 422 |
+
|
| 423 |
+
<!-- Animated Background Orbs -->
|
| 424 |
+
<div class="orb orb-1"></div>
|
| 425 |
+
<div class="orb orb-2"></div>
|
| 426 |
+
<div class="orb orb-3"></div>
|
| 427 |
+
|
| 428 |
+
<div class="app-container">
|
| 429 |
+
<!-- Header -->
|
| 430 |
+
<header class="chat-header">
|
| 431 |
+
<div class="header-top">
|
| 432 |
+
<div class="header-title">
|
| 433 |
+
<h1>Aura Chat</h1>
|
| 434 |
+
</div>
|
| 435 |
+
<div class="header-actions">
|
| 436 |
+
<button title="Menu">
|
| 437 |
+
<i class="ri-menu-5-line"></i>
|
| 438 |
+
</button>
|
| 439 |
+
</div>
|
| 440 |
+
</div>
|
| 441 |
+
<div class="header-meta">
|
| 442 |
+
<div class="online-status">
|
| 443 |
+
<span class="status-dot"></span>
|
| 444 |
+
<span>2 members online</span>
|
| 445 |
+
</div>
|
| 446 |
+
<!-- Mandatory Link -->
|
| 447 |
+
<span>Built with <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="anycoder-link">anycoder</a></span>
|
| 448 |
+
</div>
|
| 449 |
+
</header>
|
| 450 |
+
|
| 451 |
+
<!-- Chat Body -->
|
| 452 |
+
<main class="chat-body" id="chatBody">
|
| 453 |
+
<div class="empty-state" id="emptyState">
|
| 454 |
+
<i class="ri-sparkling-2-line"></i>
|
| 455 |
+
<p>Welcome to the Light Mode.<br>Start the conversation.</p>
|
| 456 |
+
</div>
|
| 457 |
+
<!-- Dynamic Messages -->
|
| 458 |
+
</main>
|
| 459 |
+
|
| 460 |
+
<!-- Input Area -->
|
| 461 |
+
<footer class="chat-input-area">
|
| 462 |
+
<div class="input-wrapper">
|
| 463 |
+
<input type="text" id="messageInput" placeholder="Type a message..." autocomplete="off">
|
| 464 |
+
</div>
|
| 465 |
+
<button id="sendBtn" aria-label="Send Message">
|
| 466 |
+
<i class="ri-send-plane-fill"></i>
|
| 467 |
+
</button>
|
| 468 |
+
</footer>
|
| 469 |
+
</div>
|
| 470 |
+
|
| 471 |
+
<script>
|
| 472 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 473 |
+
const chatBody = document.getElementById('chatBody');
|
| 474 |
+
const messageInput = document.getElementById('messageInput');
|
| 475 |
+
const sendBtn = document.getElementById('sendBtn');
|
| 476 |
+
const emptyState = document.getElementById('emptyState');
|
| 477 |
+
|
| 478 |
+
// Initial simulation data
|
| 479 |
+
const initialMessages = [
|
| 480 |
+
{ text: "Hello! This new glassmorphism design is so clean.", type: 'received', time: '10:00 AM' },
|
| 481 |
+
{ text: "I love the light and airy feel. It's very modern.", type: 'sent', time: '10:01 AM' },
|
| 482 |
+
{ text: "The floating background blobs are a nice touch.", type: 'received', time: '10:02 AM' }
|
| 483 |
+
];
|
| 484 |
+
|
| 485 |
+
function getCurrentTime() {
|
| 486 |
+
const now = new Date();
|
| 487 |
+
let hours = now.getHours();
|
| 488 |
+
const minutes = now.getMinutes().toString().padStart(2, '0');
|
| 489 |
+
const ampm = hours >= 12 ? 'PM' : 'AM';
|
| 490 |
+
hours = hours % 12;
|
| 491 |
+
hours = hours ? hours : 12;
|
| 492 |
+
return `${hours}:${minutes} ${ampm}`;
|
| 493 |
+
}
|
| 494 |
+
|
| 495 |
+
function addMessage(text, type) {
|
| 496 |
+
// Hide empty state on first message
|
| 497 |
+
if (emptyState && emptyState.parentNode) {
|
| 498 |
+
emptyState.style.display = 'none';
|
| 499 |
+
}
|
| 500 |
+
|
| 501 |
+
const messageDiv = document.createElement('div');
|
| 502 |
+
messageDiv.classList.add('message', type);
|
| 503 |
+
|
| 504 |
+
const time = getCurrentTime();
|
| 505 |
+
|
| 506 |
+
messageDiv.innerHTML = `
|
| 507 |
+
${escapeHtml(text)}
|
| 508 |
+
<span class="message-meta">${time}</span>
|
| 509 |
+
`;
|
| 510 |
+
|
| 511 |
+
chatBody.appendChild(messageDiv);
|
| 512 |
+
scrollToBottom();
|
| 513 |
+
}
|
| 514 |
+
|
| 515 |
+
function escapeHtml(text) {
|
| 516 |
+
const div = document.createElement('div');
|
| 517 |
+
div.textContent = text;
|
| 518 |
+
return div.innerHTML;
|
| 519 |
+
}
|
| 520 |
+
|
| 521 |
+
function scrollToBottom() {
|
| 522 |
+
// Smooth scroll
|
| 523 |
+
chatBody.scrollTo({
|
| 524 |
+
top: chatBody.scrollHeight,
|
| 525 |
+
behavior: 'smooth'
|
| 526 |
+
});
|
| 527 |
+
}
|
| 528 |
+
|
| 529 |
+
function handleSend() {
|
| 530 |
+
const text = messageInput.value.trim();
|
| 531 |
+
if (text !== "") {
|
| 532 |
+
addMessage(text, 'sent');
|
| 533 |
+
messageInput.value = '';
|
| 534 |
+
messageInput.focus();
|
| 535 |
+
|
| 536 |
+
// Simulate a reply
|
| 537 |
+
setTimeout(() => {
|
| 538 |
+
const replies = [
|
| 539 |
+
"That's a great point!",
|
| 540 |
+
"I totally agree with you.",
|
| 541 |
+
"The UI looks amazing on mobile too.",
|
| 542 |
+
"Let's catch up later.",
|
| 543 |
+
"Sounds like a plan."
|
| 544 |
+
];
|
| 545 |
+
const randomReply = replies[Math.floor(Math.random() * replies.length)];
|
| 546 |
+
addMessage(randomReply, 'received');
|
| 547 |
+
}, 1200 + Math.random() * 1000);
|
| 548 |
+
}
|
| 549 |
+
}
|
| 550 |
+
|
| 551 |
+
// Event Listeners
|
| 552 |
+
sendBtn.addEventListener('click', handleSend);
|
| 553 |
+
|
| 554 |
+
messageInput.addEventListener('keypress', (e) => {
|
| 555 |
+
if (e.key === 'Enter') {
|
| 556 |
+
handleSend();
|
| 557 |
+
}
|
| 558 |
+
});
|
| 559 |
+
|
| 560 |
+
// Load initial messages with staggered animation
|
| 561 |
+
setTimeout(() => {
|
| 562 |
+
initialMessages.forEach((msg, index) => {
|
| 563 |
+
setTimeout(() => {
|
| 564 |
+
addMessage(msg.text, msg.type);
|
| 565 |
+
}, index * 300);
|
| 566 |
+
});
|
| 567 |
+
}, 500);
|
| 568 |
+
});
|
| 569 |
+
</script>
|
| 570 |
+
</body>
|
| 571 |
+
|
| 572 |
+
</html>
|