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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="fa" dir="rtl">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>چت روم - Glassmorphism Design</title>
|
| 7 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 8 |
+
<style>
|
| 9 |
+
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap');
|
| 10 |
+
|
| 11 |
+
* {
|
| 12 |
+
margin: 0;
|
| 13 |
+
padding: 0;
|
| 14 |
+
box-sizing: border-box;
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
:root {
|
| 18 |
+
--primary: #6366f1;
|
| 19 |
+
--primary-light: #818cf8;
|
| 20 |
+
--secondary: #ec4899;
|
| 21 |
+
--accent: #06b6d4;
|
| 22 |
+
--success: #10b981;
|
| 23 |
+
--warning: #f59e0b;
|
| 24 |
+
--error: #ef4444;
|
| 25 |
+
--bg-gradient-1: #0f0c29;
|
| 26 |
+
--bg-gradient-2: #302b63;
|
| 27 |
+
--bg-gradient-3: #24243e;
|
| 28 |
+
--glass-bg: rgba(255, 255, 255, 0.08);
|
| 29 |
+
--glass-border: rgba(255, 255, 255, 0.15);
|
| 30 |
+
--glass-highlight: rgba(255, 255, 255, 0.05);
|
| 31 |
+
--text-primary: #f8fafc;
|
| 32 |
+
--text-secondary: #cbd5e1;
|
| 33 |
+
--text-muted: #94a3b8;
|
| 34 |
+
--shadow-glow: 0 8px 32px rgba(99, 102, 241, 0.3);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
body {
|
| 38 |
+
font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
|
| 39 |
+
background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 50%, var(--bg-gradient-3) 100%);
|
| 40 |
+
min-height: 100vh;
|
| 41 |
+
color: var(--text-primary);
|
| 42 |
+
overflow-x: hidden;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
/* Animated background particles */
|
| 46 |
+
body::before {
|
| 47 |
+
content: '';
|
| 48 |
+
position: fixed;
|
| 49 |
+
top: 0;
|
| 50 |
+
left: 0;
|
| 51 |
+
width: 100%;
|
| 52 |
+
height: 100%;
|
| 53 |
+
background:
|
| 54 |
+
radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
|
| 55 |
+
radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
|
| 56 |
+
radial-gradient(circle at 40% 40%, rgba(6, 182, 212, 0.1) 0%, transparent 40%);
|
| 57 |
+
pointer-events: none;
|
| 58 |
+
z-index: 0;
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
.chat-page {
|
| 62 |
+
position: relative;
|
| 63 |
+
z-index: 1;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
.chat-container {
|
| 67 |
+
display: flex;
|
| 68 |
+
height: 100vh;
|
| 69 |
+
gap: 1rem;
|
| 70 |
+
padding: 1rem;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
/* Glassmorphism Sidebar */
|
| 74 |
+
.chat-sidebar {
|
| 75 |
+
width: 320px;
|
| 76 |
+
background: var(--glass-bg);
|
| 77 |
+
backdrop-filter: blur(20px);
|
| 78 |
+
-webkit-backdrop-filter: blur(20px);
|
| 79 |
+
border: 1px solid var(--glass-border);
|
| 80 |
+
border-radius: 24px;
|
| 81 |
+
display: flex;
|
| 82 |
+
flex-direction: column;
|
| 83 |
+
overflow: hidden;
|
| 84 |
+
box-shadow:
|
| 85 |
+
0 8px 32px rgba(0, 0, 0, 0.3),
|
| 86 |
+
inset 0 1px 0 var(--glass-highlight);
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
.sidebar-header {
|
| 90 |
+
padding: 1.5rem;
|
| 91 |
+
background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(236, 72, 153, 0.1) 100%);
|
| 92 |
+
border-bottom: 1px solid var(--glass-border);
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
.sidebar-header h3 {
|
| 96 |
+
display: flex;
|
| 97 |
+
align-items: center;
|
| 98 |
+
gap: 0.75rem;
|
| 99 |
+
font-size: 1.125rem;
|
| 100 |
+
font-weight: 600;
|
| 101 |
+
color: var(--text-primary);
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
.sidebar-header h3 i {
|
| 105 |
+
width: 40px;
|
| 106 |
+
height: 40px;
|
| 107 |
+
display: flex;
|
| 108 |
+
align-items: center;
|
| 109 |
+
justify-content: center;
|
| 110 |
+
background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
|
| 111 |
+
border-radius: 12px;
|
| 112 |
+
font-size: 1rem;
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
.room-name {
|
| 116 |
+
display: block;
|
| 117 |
+
margin-top: 0.5rem;
|
| 118 |
+
font-size: 0.875rem;
|
| 119 |
+
color: var(--text-secondary);
|
| 120 |
+
font-weight: 400;
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
.users-list {
|
| 124 |
+
flex: 1;
|
| 125 |
+
overflow-y: auto;
|
| 126 |
+
padding: 1rem;
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
.users-list::-webkit-scrollbar {
|
| 130 |
+
width: 6px;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
.users-list::-webkit-scrollbar-track {
|
| 134 |
+
background: transparent;
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
.users-list::-webkit-scrollbar-thumb {
|
| 138 |
+
background: var(--glass-border);
|
| 139 |
+
border-radius: 3px;
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
.user-item {
|
| 143 |
+
display: flex;
|
| 144 |
+
align-items: center;
|
| 145 |
+
gap: 0.875rem;
|
| 146 |
+
padding: 0.875rem;
|
| 147 |
+
margin-bottom: 0.5rem;
|
| 148 |
+
background: var(--glass-highlight);
|
| 149 |
+
border: 1px solid transparent;
|
| 150 |
+
border-radius: 16px;
|
| 151 |
+
transition: all 0.3s ease;
|
| 152 |
+
cursor: pointer;
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
.user-item:hover {
|
| 156 |
+
background: rgba(99, 102, 241, 0.1);
|
| 157 |
+
border-color: var(--glass-border);
|
| 158 |
+
transform: translateX(-4px);
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
.user-avatar {
|
| 162 |
+
width: 44px;
|
| 163 |
+
height: 44px;
|
| 164 |
+
display: flex;
|
| 165 |
+
align-items: center;
|
| 166 |
+
justify-content: center;
|
| 167 |
+
background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary) 100%);
|
| 168 |
+
border-radius: 14px;
|
| 169 |
+
font-size: 1.25rem;
|
| 170 |
+
color: white;
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
.user-info {
|
| 174 |
+
flex: 1;
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
.user-name {
|
| 178 |
+
display: block;
|
| 179 |
+
font-size: 0.9375rem;
|
| 180 |
+
font-weight: 500;
|
| 181 |
+
color: var(--text-primary);
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
.user-status {
|
| 185 |
+
display: flex;
|
| 186 |
+
align-items: center;
|
| 187 |
+
gap: 0.375rem;
|
| 188 |
+
font-size: 0.75rem;
|
| 189 |
+
margin-top: 0.25rem;
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
.user-status.online {
|
| 193 |
+
color: var(--success);
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
.user-status.offline {
|
| 197 |
+
color: var(--text-muted);
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
.user-status i {
|
| 201 |
+
font-size: 0.5rem;
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
.sidebar-footer {
|
| 205 |
+
padding: 1rem 1.5rem;
|
| 206 |
+
border-top: 1px solid var(--glass-border);
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
/* Main Chat Area */
|
| 210 |
+
.chat-main {
|
| 211 |
+
flex: 1;
|
| 212 |
+
display: flex;
|
| 213 |
+
flex-direction: column;
|
| 214 |
+
background: var(--glass-bg);
|
| 215 |
+
backdrop-filter: blur(20px);
|
| 216 |
+
-webkit-backdrop-filter: blur(20px);
|
| 217 |
+
border: 1px solid var(--glass-border);
|
| 218 |
+
border-radius: 24px;
|
| 219 |
+
overflow: hidden;
|
| 220 |
+
box-shadow:
|
| 221 |
+
0 8px 32px rgba(0, 0, 0, 0.3),
|
| 222 |
+
inset 0 1px 0 var(--glass-highlight);
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
.chat-header {
|
| 226 |
+
display: flex;
|
| 227 |
+
align-items: center;
|
| 228 |
+
justify-content: space-between;
|
| 229 |
+
padding: 1.25rem 1.5rem;
|
| 230 |
+
background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(6, 182, 212, 0.1) 100%);
|
| 231 |
+
border-bottom: 1px solid var(--glass-border);
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
.header-info h1 {
|
| 235 |
+
display: flex;
|
| 236 |
+
align-items: center;
|
| 237 |
+
gap: 0.75rem;
|
| 238 |
+
font-size: 1.25rem;
|
| 239 |
+
font-weight: 600;
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
.header-info h1 i {
|
| 243 |
+
width: 44px;
|
| 244 |
+
height: 44px;
|
| 245 |
+
display: flex;
|
| 246 |
+
align-items: center;
|
| 247 |
+
justify-content: center;
|
| 248 |
+
background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
|
| 249 |
+
border-radius: 14px;
|
| 250 |
+
font-size: 1.125rem;
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
.header-info p {
|
| 254 |
+
margin-top: 0.375rem;
|
| 255 |
+
font-size: 0.875rem;
|
| 256 |
+
color: var(--text-secondary);
|
| 257 |
+
}
|
| 258 |
+
|
| 259 |
+
.header-actions {
|
| 260 |
+
display: flex;
|
| 261 |
+
gap: 0.75rem;
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
/* Buttons */
|
| 265 |
+
.btn {
|
| 266 |
+
display: inline-flex;
|
| 267 |
+
align-items: center;
|
| 268 |
+
gap: 0.5rem;
|
| 269 |
+
padding: 0.625rem 1.25rem;
|
| 270 |
+
font-size: 0.875rem;
|
| 271 |
+
font-weight: 500;
|
| 272 |
+
font-family: inherit;
|
| 273 |
+
border: none;
|
| 274 |
+
border-radius: 12px;
|
| 275 |
+
cursor: pointer;
|
| 276 |
+
transition: all 0.3s ease;
|
| 277 |
+
text-decoration: none;
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
.btn-primary {
|
| 281 |
+
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
|
| 282 |
+
color: white;
|
| 283 |
+
box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
|
| 284 |
+
}
|
| 285 |
+
|
| 286 |
+
.btn-primary:hover {
|
| 287 |
+
transform: translateY(-2px);
|
| 288 |
+
box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
.btn-secondary {
|
| 292 |
+
background: var(--glass-highlight);
|
| 293 |
+
color: var(--text-primary);
|
| 294 |
+
border: 1px solid var(--glass-border);
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
.btn-secondary:hover {
|
| 298 |
+
background: rgba(255, 255, 255, 0.1);
|
| 299 |
+
transform: translateY(-2px);
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
.btn-icon {
|
| 303 |
+
width: 40px;
|
| 304 |
+
height: 40px;
|
| 305 |
+
display: flex;
|
| 306 |
+
align-items: center;
|
| 307 |
+
justify-content: center;
|
| 308 |
+
background: var(--glass-highlight);
|
| 309 |
+
border: 1px solid var(--glass-border);
|
| 310 |
+
border-radius: 12px;
|
| 311 |
+
font-size: 1.25rem;
|
| 312 |
+
cursor: pointer;
|
| 313 |
+
transition: all 0.2s ease;
|
| 314 |
+
}
|
| 315 |
+
|
| 316 |
+
.btn-icon:hover {
|
| 317 |
+
background: rgba(255, 255, 255, 0.15);
|
| 318 |
+
transform: scale(1.1);
|
| 319 |
+
}
|
| 320 |
+
|
| 321 |
+
/* Messages Area */
|
| 322 |
+
.chat-messages {
|
| 323 |
+
flex: 1;
|
| 324 |
+
overflow-y: auto;
|
| 325 |
+
padding: 1.5rem;
|
| 326 |
+
display: flex;
|
| 327 |
+
flex-direction: column;
|
| 328 |
+
gap: 1rem;
|
| 329 |
+
}
|
| 330 |
+
|
| 331 |
+
.chat-messages::-webkit-scrollbar {
|
| 332 |
+
width: 8px;
|
| 333 |
+
}
|
| 334 |
+
|
| 335 |
+
.chat-messages::-webkit-scrollbar-track {
|
| 336 |
+
background: transparent;
|
| 337 |
+
}
|
| 338 |
+
|
| 339 |
+
.chat-messages::-webkit-scrollbar-thumb {
|
| 340 |
+
background: var(--glass-border);
|
| 341 |
+
border-radius: 4px;
|
| 342 |
+
}
|
| 343 |
+
|
| 344 |
+
.chat-messages::-webkit-scrollbar-thumb:hover {
|
| 345 |
+
background: rgba(255, 255, 255, 0.2);
|
| 346 |
+
}
|
| 347 |
+
|
| 348 |
+
.message {
|
| 349 |
+
max-width: 75%;
|
| 350 |
+
padding: 1rem 1.25rem;
|
| 351 |
+
background: var(--glass-highlight);
|
| 352 |
+
border: 1px solid var(--glass-border);
|
| 353 |
+
border-radius: 20px 20px 20px 4px;
|
| 354 |
+
animation: messageSlide 0.3s ease;
|
| 355 |
+
}
|
| 356 |
+
|
| 357 |
+
@keyframes messageSlide {
|
| 358 |
+
from {
|
| 359 |
+
opacity: 0;
|
| 360 |
+
transform: translateY(10px);
|
| 361 |
+
}
|
| 362 |
+
to {
|
| 363 |
+
opacity: 1;
|
| 364 |
+
transform: translateY(0);
|
| 365 |
+
}
|
| 366 |
+
}
|
| 367 |
+
|
| 368 |
+
.message.own {
|
| 369 |
+
align-self: flex-start;
|
| 370 |
+
background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(236, 72, 153, 0.15) 100%);
|
| 371 |
+
border-color: rgba(99, 102, 241, 0.3);
|
| 372 |
+
border-radius: 20px 20px 4px 20px;
|
| 373 |
+
}
|
| 374 |
+
|
| 375 |
+
.message-header {
|
| 376 |
+
display: flex;
|
| 377 |
+
align-items: center;
|
| 378 |
+
gap: 0.75rem;
|
| 379 |
+
margin-bottom: 0.5rem;
|
| 380 |
+
flex-wrap: wrap;
|
| 381 |
+
}
|
| 382 |
+
|
| 383 |
+
.message-sender {
|
| 384 |
+
font-size: 0.875rem;
|
| 385 |
+
font-weight: 600;
|
| 386 |
+
color: var(--primary-light);
|
| 387 |
+
}
|
| 388 |
+
|
| 389 |
+
.message-time {
|
| 390 |
+
font-size: 0.75rem;
|
| 391 |
+
color: var(--text-muted);
|
| 392 |
+
}
|
| 393 |
+
|
| 394 |
+
.sending-status {
|
| 395 |
+
font-size: 0.75rem;
|
| 396 |
+
color: var(--accent);
|
| 397 |
+
}
|
| 398 |
+
|
| 399 |
+
.message-content {
|
| 400 |
+
font-size: 0.9375rem;
|
| 401 |
+
line-height: 1.7;
|
| 402 |
+
color: var(--text-primary);
|
| 403 |
+
word-wrap: break-word;
|
| 404 |
+
}
|
| 405 |
+
|
| 406 |
+
.message-actions-admin {
|
| 407 |
+
display: flex;
|
| 408 |
+
gap: 0.5rem;
|
| 409 |
+
margin-right: auto;
|
| 410 |
+
}
|
| 411 |
+
|
| 412 |
+
.message-actions-admin button {
|
| 413 |
+
width: 28px;
|
| 414 |
+
height: 28px;
|
| 415 |
+
display: flex;
|
| 416 |
+
align-items: center;
|
| 417 |
+
justify-content: center;
|
| 418 |
+
background: rgba(239, 68, 68, 0.2);
|
| 419 |
+
border: none;
|
| 420 |
+
border-radius: 8px;
|
| 421 |
+
color: var(--error);
|
| 422 |
+
font-size: 0.75rem;
|
| 423 |
+
cursor: pointer;
|
| 424 |
+
transition: all 0.2s ease;
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
.message-actions-admin button:hover {
|
| 428 |
+
background: var(--error);
|
| 429 |
+
color: white;
|
| 430 |
+
}
|
| 431 |
+
|
| 432 |
+
/* Footer & Input */
|
| 433 |
+
.chat-footer {
|
| 434 |
+
padding: 1.25rem 1.5rem;
|
| 435 |
+
background: linear-gradient(0deg, rgba(0,0,0,0.2) 0%, transparent 100%);
|
| 436 |
+
border-top: 1px solid var(--glass-border);
|
| 437 |
+
}
|
| 438 |
+
|
| 439 |
+
#message-form {
|
| 440 |
+
display: flex;
|
| 441 |
+
flex-direction: column;
|
| 442 |
+
gap: 0.875rem;
|
| 443 |
+
}
|
| 444 |
+
|
| 445 |
+
.message-input {
|
| 446 |
+
display: flex;
|
| 447 |
+
gap: 0.875rem;
|
| 448 |
+
align-items: center;
|
| 449 |
+
}
|
| 450 |
+
|
| 451 |
+
#message-input {
|
| 452 |
+
flex: 1;
|
| 453 |
+
padding: 0.875rem 1.25rem;
|
| 454 |
+
background: var(--glass-highlight);
|
| 455 |
+
border: 1px solid var(--glass-border);
|
| 456 |
+
border-radius: 16px;
|
| 457 |
+
color: var(--text-primary);
|
| 458 |
+
font-size: 0.9375rem;
|
| 459 |
+
font-family: inherit;
|
| 460 |
+
transition: all 0.3s ease;
|
| 461 |
+
}
|
| 462 |
+
|
| 463 |
+
#message-input::placeholder {
|
| 464 |
+
color: var(--text-muted);
|
| 465 |
+
}
|
| 466 |
+
|
| 467 |
+
#message-input:focus {
|
| 468 |
+
outline: none;
|
| 469 |
+
border-color: var(--primary-light);
|
| 470 |
+
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
|
| 471 |
+
}
|
| 472 |
+
|
| 473 |
+
.message-actions {
|
| 474 |
+
display: flex;
|
| 475 |
+
gap: 0.5rem;
|
| 476 |
+
padding: 0 0.5rem;
|
| 477 |
+
}
|
| 478 |
+
|
| 479 |
+
/* Loading & Empty States */
|
| 480 |
+
.loading, .empty, .error {
|
| 481 |
+
text-align: center;
|
| 482 |
+
padding: 2rem;
|
| 483 |
+
color: var(--text-muted);
|
| 484 |
+
}
|
| 485 |
+
|
| 486 |
+
.loading::after {
|
| 487 |
+
content: '';
|
| 488 |
+
display: inline-block;
|
| 489 |
+
width: 20px;
|
| 490 |
+
height: 20px;
|
| 491 |
+
margin-right: 0.5rem;
|
| 492 |
+
border: 2px solid var(--glass-border);
|
| 493 |
+
border-top-color: var(--primary);
|
| 494 |
+
border-radius: 50%;
|
| 495 |
+
animation: spin 1s linear infinite;
|
| 496 |
+
}
|
| 497 |
+
|
| 498 |
+
@keyframes spin {
|
| 499 |
+
to { transform: rotate(360deg); }
|
| 500 |
+
}
|
| 501 |
+
|
| 502 |
+
.empty-state, .error-state {
|
| 503 |
+
display: flex;
|
| 504 |
+
flex-direction: column;
|
| 505 |
+
align-items: center;
|
| 506 |
+
justify-content: center;
|
| 507 |
+
padding: 3rem;
|
| 508 |
+
text-align: center;
|
| 509 |
+
color: var(--text-secondary);
|
| 510 |
+
}
|
| 511 |
+
|
| 512 |
+
.empty-state i, .error-state i {
|
| 513 |
+
width: 80px;
|
| 514 |
+
height: 80px;
|
| 515 |
+
display: flex;
|
| 516 |
+
align-items: center;
|
| 517 |
+
justify-content: center;
|
| 518 |
+
background: var(--glass-highlight);
|
| 519 |
+
border-radius: 24px;
|
| 520 |
+
font-size: 2rem;
|
| 521 |
+
margin-bottom: 1rem;
|
| 522 |
+
}
|
| 523 |
+
|
| 524 |
+
.empty-state i {
|
| 525 |
+
color: var(--accent);
|
| 526 |
+
}
|
| 527 |
+
|
| 528 |
+
.error-state i {
|
| 529 |
+
color: var(--error);
|
| 530 |
+
}
|
| 531 |
+
|
| 532 |
+
.empty-state p, .error-state p {
|
| 533 |
+
font-size: 1rem;
|
| 534 |
+
margin-bottom: 0.5rem;
|
| 535 |
+
}
|
| 536 |
+
|
| 537 |
+
.small-text {
|
| 538 |
+
font-size: 0.875rem;
|
| 539 |
+
color: var(--text-muted);
|
| 540 |
+
}
|
| 541 |
+
|
| 542 |
+
/* Alert Notifications */
|
| 543 |
+
.alert {
|
| 544 |
+
display: flex;
|
| 545 |
+
align-items: center;
|
| 546 |
+
gap: 0.75rem;
|
| 547 |
+
padding: 1rem 1.25rem;
|
| 548 |
+
border-radius: 16px;
|
| 549 |
+
font-size: 0.9375rem;
|
| 550 |
+
font-weight: 500;
|
| 551 |
+
backdrop-filter: blur(20px);
|
| 552 |
+
-webkit-backdrop-filter: blur(20px);
|
| 553 |
+
animation: alertSlide 0.3s ease;
|
| 554 |
+
}
|
| 555 |
+
|
| 556 |
+
@keyframes alertSlide {
|
| 557 |
+
from {
|
| 558 |
+
opacity: 0;
|
| 559 |
+
transform: translateY(-20px);
|
| 560 |
+
}
|
| 561 |
+
to {
|
| 562 |
+
opacity: 1;
|
| 563 |
+
transform: translateY(0);
|
| 564 |
+
}
|
| 565 |
+
}
|
| 566 |
+
|
| 567 |
+
.alert.success {
|
| 568 |
+
background: rgba(16, 185, 129, 0.15);
|
| 569 |
+
border: 1px solid rgba(16, 185, 129, 0.3);
|
| 570 |
+
color: var(--success);
|
| 571 |
+
}
|
| 572 |
+
|
| 573 |
+
.alert.error {
|
| 574 |
+
background: rgba(239, 68, 68, 0.15);
|
| 575 |
+
border: 1px solid rgba(239, 68, 68, 0.3);
|
| 576 |
+
color: var(--error);
|
| 577 |
+
}
|
| 578 |
+
|
| 579 |
+
/* Temp Message */
|
| 580 |
+
.temp-message {
|
| 581 |
+
opacity: 0.7;
|
| 582 |
+
}
|
| 583 |
+
|
| 584 |
+
/* Responsive Design */
|
| 585 |
+
@media (max-width: 1024px) {
|
| 586 |
+
.chat-sidebar {
|
| 587 |
+
width: 280px;
|
| 588 |
+
}
|
| 589 |
+
}
|
| 590 |
+
|
| 591 |
+
@media (max-width: 768px) {
|
| 592 |
+
.chat-container {
|
| 593 |
+
flex-direction: column;
|
| 594 |
+
padding: 0.5rem;
|
| 595 |
+
}
|
| 596 |
+
|
| 597 |
+
.chat-sidebar {
|
| 598 |
+
width: 100%;
|
| 599 |
+
height: auto;
|
| 600 |
+
max-height: 200px;
|
| 601 |
+
}
|
| 602 |
+
|
| 603 |
+
.users-list {
|
| 604 |
+
max-height: 120px;
|
| 605 |
+
}
|
| 606 |
+
|
| 607 |
+
.sidebar-footer {
|
| 608 |
+
display: none;
|
| 609 |
+
}
|
| 610 |
+
|
| 611 |
+
.chat-header {
|
| 612 |
+
flex-direction: column;
|
| 613 |
+
gap: 1rem;
|
| 614 |
+
align-items: flex-start;
|
| 615 |
+
}
|
| 616 |
+
|
| 617 |
+
.header-actions {
|
| 618 |
+
width: 100%;
|
| 619 |
+
justify-content: flex-end;
|
| 620 |
+
}
|
| 621 |
+
|
| 622 |
+
.message {
|
| 623 |
+
max-width: 90%;
|
| 624 |
+
}
|
| 625 |
+
|
| 626 |
+
.message-input {
|
| 627 |
+
flex-wrap: wrap;
|
| 628 |
+
}
|
| 629 |
+
|
| 630 |
+
#message-input {
|
| 631 |
+
width: 100%;
|
| 632 |
+
}
|
| 633 |
+
}
|
| 634 |
+
|
| 635 |
+
@media (max-width: 480px) {
|
| 636 |
+
.chat-header h1 {
|
| 637 |
+
font-size: 1rem;
|
| 638 |
+
}
|
| 639 |
+
|
| 640 |
+
.chat-header h1 i {
|
| 641 |
+
width: 36px;
|
| 642 |
+
height: 36px;
|
| 643 |
+
font-size: 1rem;
|
| 644 |
+
}
|
| 645 |
+
|
| 646 |
+
.btn {
|
| 647 |
+
padding: 0.5rem 1rem;
|
| 648 |
+
font-size: 0.8125rem;
|
| 649 |
+
}
|
| 650 |
+
|
| 651 |
+
.btn span {
|
| 652 |
+
display: none;
|
| 653 |
+
}
|
| 654 |
+
|
| 655 |
+
.message {
|
| 656 |
+
padding: 0.875rem;
|
| 657 |
+
}
|
| 658 |
+
|
| 659 |
+
.message-content {
|
| 660 |
+
font-size: 0.875rem;
|
| 661 |
+
}
|
| 662 |
+
}
|
| 663 |
+
|
| 664 |
+
/* Focus visible for accessibility */
|
| 665 |
+
*:focus-visible {
|
| 666 |
+
outline: 2px solid var(--primary-light);
|
| 667 |
+
outline-offset: 2px;
|
| 668 |
+
}
|
| 669 |
+
|
| 670 |
+
/* Selection color */
|
| 671 |
+
::selection {
|
| 672 |
+
background: rgba(99, 102, 241, 0.3);
|
| 673 |
+
color: var(--text-primary);
|
| 674 |
+
}
|
| 675 |
+
</style>
|
| 676 |
+
</head>
|
| 677 |
+
<body class="chat-page">
|
| 678 |
+
<div class="chat-container">
|
| 679 |
+
<!-- نوار کناری کاربران -->
|
| 680 |
+
<aside class="chat-sidebar">
|
| 681 |
+
<div class="sidebar-header">
|
| 682 |
+
<h3><i class="fas fa-users"></i> کاربران آنلاین</h3>
|
| 683 |
+
<span class="room-name">اتاق گفتگوی عمومی</span>
|
| 684 |
+
</div>
|
| 685 |
+
|
| 686 |
+
<div class="users-list" id="users-list">
|
| 687 |
+
<!-- نمونه کاربران -->
|
| 688 |
+
<div class="user-item">
|
| 689 |
+
<div class="user-avatar">
|
| 690 |
+
<i class="fas fa-user-circle"></i>
|
| 691 |
+
</div>
|
| 692 |
+
<div class="user-info">
|
| 693 |
+
<span class="user-name">علی احمدی</span>
|
| 694 |
+
<span class="user-status online">
|
| 695 |
+
<i class="fas fa-circle"></i> آنلاین
|
| 696 |
+
</span>
|
| 697 |
+
</div>
|
| 698 |
+
</div>
|
| 699 |
+
<div class="user-item">
|
| 700 |
+
<div class="user-avatar">
|
| 701 |
+
<i class="fas fa-user-circle"></i>
|
| 702 |
+
</div>
|
| 703 |
+
<div class="user-info">
|
| 704 |
+
<span class="user-name">مریم رضایی</span>
|
| 705 |
+
<span class="user-status online">
|
| 706 |
+
<i class="fas fa-circle"></i> آنلاین
|
| 707 |
+
</span>
|
| 708 |
+
</div>
|
| 709 |
+
</div>
|
| 710 |
+
<div class="user-item">
|
| 711 |
+
<div class="user-avatar">
|
| 712 |
+
<i class="fas fa-user-circle"></i>
|
| 713 |
+
</div>
|
| 714 |
+
<div class="user-info">
|
| 715 |
+
<span class="user-name">حسن محمدی</span>
|
| 716 |
+
<span class="user-status offline">
|
| 717 |
+
<i class="fas fa-circle"></i> آفلاین
|
| 718 |
+
</span>
|
| 719 |
+
</div>
|
| 720 |
+
</div>
|
| 721 |
+
</div>
|
| 722 |
+
|
| 723 |
+
<div class="sidebar-footer">
|
| 724 |
+
<a href="dashboard.php" class="btn btn-secondary">
|
| 725 |
+
<i class="fas fa-arrow-right"></i> بازگشت
|
| 726 |
+
</a>
|
| 727 |
+
</div>
|
| 728 |
+
</aside>
|
| 729 |
+
|
| 730 |
+
<!-- بخش اصلی چت -->
|
| 731 |
+
<main class="chat-main">
|
| 732 |
+
<header class="chat-header">
|
| 733 |
+
<div class="header-info">
|
| 734 |
+
<h1><i class="fas fa-comments"></i> اتاق گفتگوی عمومی</h1>
|
| 735 |
+
<p>فضایی برای گفتگو و تبادل نظر</p>
|
| 736 |
+
</div>
|
| 737 |
+
<div class="header-actions">
|
| 738 |
+
<button class="btn btn-primary" onclick="clearChat()">
|
| 739 |
+
<i class="fas fa-trash"></i> <span>پاک کردن چت</span>
|
| 740 |
+
</button>
|
| 741 |
+
<button class="btn btn-secondary" onclick="leaveRoom()">
|
| 742 |
+
<i class="fas fa-sign-out-alt"></i> <span>ترک اتاق</span>
|
| 743 |
+
</button>
|
| 744 |
+
</div>
|
| 745 |
+
</header>
|
| 746 |
+
|
| 747 |
+
<div class="chat-messages" id="chat-messages">
|
| 748 |
+
<!-- نمونه پیام -->
|
| 749 |
+
<div class="message">
|
| 750 |
+
<div class="message-header">
|
| 751 |
+
<span class="message-sender">علی احمدی</span>
|
| 752 |
+
<span class="message-time">۱۴:۳۰</span>
|
| 753 |
+
</div>
|
| 754 |
+
<div class="message-content">سلام به همه! 👋</div>
|
| 755 |
+
</div>
|
| 756 |
+
|
| 757 |
+
<div class="message own">
|
| 758 |
+
<div class="message-header">
|
| 759 |
+
<span class="message-sender">شما</span>
|
| 760 |
+
<span class="message-time">۱۴:۳۲</span>
|
| 761 |
+
</div>
|
| 762 |
+
<div class="message-content">سلام علی! خوبی؟</div>
|
| 763 |
+
</div>
|
| 764 |
+
|
| 765 |
+
<div class="message">
|
| 766 |
+
<div class="message-header">
|
| 767 |
+
<span class="message-sender">مریم رضایی</span>
|
| 768 |
+
<span class="message-time">۱۴:۳۵</span>
|
| 769 |
+
</div>
|
| 770 |
+
<div class="message-content">سلام دوستان! 😊</div>
|
| 771 |
+
</div>
|
| 772 |
+
</div>
|
| 773 |
+
|
| 774 |
+
<footer class="chat-footer">
|
| 775 |
+
<form id="message-form">
|
| 776 |
+
<div class="message-input">
|
| 777 |
+
<input type="text" id="message-input" placeholder="پیام خود را بنویسید..." autocomplete="off">
|
| 778 |
+
<button type="submit" class="btn btn-primary">
|
| 779 |
+
<i class="fas fa-paper-plane"></i> <span>ارسال</span>
|
| 780 |
+
</button>
|
| 781 |
+
</div>
|
| 782 |
+
<div class="message-actions">
|
| 783 |
+
<button type="button" class="btn-icon" onclick="insertEmoji('😊')">😊</button>
|
| 784 |
+
<button type="button" class="btn-icon" onclick="insertEmoji('😂')">😂</button>
|
| 785 |
+
<button type="button" class="btn-icon" onclick="insertEmoji('❤️')">❤️</button>
|
| 786 |
+
<button type="button" class="btn-icon" onclick="insertEmoji('👍')">👍</button>
|
| 787 |
+
</div>
|
| 788 |
+
</form>
|
| 789 |
+
</footer>
|
| 790 |
+
</main>
|
| 791 |
+
</div>
|
| 792 |
+
|
| 793 |
+
<script>
|
| 794 |
+
// نمونه توابع برای نمایش عملکرد
|
| 795 |
+
function insertEmoji(emoji) {
|
| 796 |
+
const input = document.getElementById('message-input');
|
| 797 |
+
input.value += emoji;
|
| 798 |
+
input.focus();
|
| 799 |
+
}
|
| 800 |
+
|
| 801 |
+
function clearChat() {
|
| 802 |
+
if (confirm('آیا مطمئن هستید؟')) {
|
| 803 |
+
document.getElementById('chat-messages').innerHTML = `
|
| 804 |
+
<div class="empty-state">
|
| 805 |
+
<i class="fas fa-trash"></i>
|
| 806 |
+
<p>تمامی پیامها پاک شدند</p>
|
| 807 |
+
</div>
|
| 808 |
+
`;
|
| 809 |
+
}
|
| 810 |
+
}
|
| 811 |
+
|
| 812 |
+
function leaveRoom() {
|
| 813 |
+
if (confirm('آیا میخواهید این اتاق را ترک کنید؟')) {
|
| 814 |
+
alert('در حال بازگشت به داشبورد...');
|
| 815 |
+
}
|
| 816 |
+
}
|
| 817 |
+
|
| 818 |
+
document.getElementById('message-form').addEventListener('submit', function(e) {
|
| 819 |
+
e.preventDefault();
|
| 820 |
+
const input = document.getElementById('message-input');
|
| 821 |
+
const message = input.value.trim();
|
| 822 |
+
|
| 823 |
+
if (message) {
|
| 824 |
+
const messagesContainer = document.getElementById('chat-messages');
|
| 825 |
+
const emptyState = messagesContainer.querySelector('.empty-state');
|
| 826 |
+
if (emptyState) emptyState.remove();
|
| 827 |
+
|
| 828 |
+
const messageDiv = document.createElement('div');
|
| 829 |
+
messageDiv.className = 'message own';
|
| 830 |
+
const time = new Date().toLocaleTimeString('fa-IR', { hour: '2-digit', minute: '2-digit' });
|
| 831 |
+
messageDiv.innerHTML = `
|
| 832 |
+
<div class="message-header">
|
| 833 |
+
<span class="message-sender">شما</span>
|
| 834 |
+
<span class="message-time">${time}</span>
|
| 835 |
+
</div>
|
| 836 |
+
<div class="message-content">${message}</div>
|
| 837 |
+
`;
|
| 838 |
+
messagesContainer.appendChild(messageDiv);
|
| 839 |
+
messagesContainer.scrollTop = messagesContainer.scrollHeight;
|
| 840 |
+
input.value = '';
|
| 841 |
+
}
|
| 842 |
+
});
|
| 843 |
+
</script>
|
| 844 |
+
</body>
|
| 845 |
+
</html>
|