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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="fa" dir="rtl">
|
| 3 |
+
|
| 4 |
+
<head>
|
| 5 |
+
<meta charset="UTF-8">
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
+
<title>داشبورد چت | Frosted Glass UI</title>
|
| 8 |
+
|
| 9 |
+
<!-- Font: Vazirmatn -->
|
| 10 |
+
<link href="https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css" rel="stylesheet"
|
| 11 |
+
type="text/css" />
|
| 12 |
+
|
| 13 |
+
<!-- Icons: FontAwesome -->
|
| 14 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 15 |
+
|
| 16 |
+
<style>
|
| 17 |
+
:root {
|
| 18 |
+
/* Refined Color Palette - Calm & Premium */
|
| 19 |
+
--bg-deep: #050508;
|
| 20 |
+
--glass-surface: rgba(255, 255, 255, 0.03);
|
| 21 |
+
--glass-border: rgba(255, 255, 255, 0.08);
|
| 22 |
+
--glass-hover: rgba(255, 255, 255, 0.06);
|
| 23 |
+
|
| 24 |
+
/* Text */
|
| 25 |
+
--text-main: #ffffff;
|
| 26 |
+
--text-muted: #94a3b8;
|
| 27 |
+
|
| 28 |
+
/* Accents */
|
| 29 |
+
--accent-primary: #8b5cf6; /* Violet */
|
| 30 |
+
--accent-secondary: #3b82f6; /* Blue */
|
| 31 |
+
--accent-tertiary: #ec4899; /* Pink */
|
| 32 |
+
|
| 33 |
+
/* Glow Colors for Background Orbs */
|
| 34 |
+
--glow-1: rgba(139, 92, 246, 0.4);
|
| 35 |
+
--glow-2: rgba(59, 130, 246, 0.4);
|
| 36 |
+
--glow-3: rgba(236, 72, 153, 0.3);
|
| 37 |
+
|
| 38 |
+
/* Radius & Spacing */
|
| 39 |
+
--radius-card: 24px;
|
| 40 |
+
--radius-btn: 12px;
|
| 41 |
+
--pad-container: 24px;
|
| 42 |
+
--gap-grid: 28px;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
* {
|
| 46 |
+
box-sizing: border-box;
|
| 47 |
+
margin: 0;
|
| 48 |
+
padding: 0;
|
| 49 |
+
outline: none;
|
| 50 |
+
-webkit-tap-highlight-color: transparent;
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
body {
|
| 54 |
+
font-family: 'Vazirmatn', sans-serif;
|
| 55 |
+
background-color: var(--bg-deep);
|
| 56 |
+
color: var(--text-main);
|
| 57 |
+
min-height: 100vh;
|
| 58 |
+
overflow-x: hidden;
|
| 59 |
+
display: flex;
|
| 60 |
+
flex-direction: column;
|
| 61 |
+
position: relative;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
/* --- Ambient Background Orbs (The Frosted Rounded Gradients) --- */
|
| 65 |
+
.ambient-container {
|
| 66 |
+
position: fixed;
|
| 67 |
+
top: 0;
|
| 68 |
+
left: 0;
|
| 69 |
+
width: 100%;
|
| 70 |
+
height: 100%;
|
| 71 |
+
z-index: -1;
|
| 72 |
+
overflow: hidden;
|
| 73 |
+
pointer-events: none;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
.ambient-orb {
|
| 77 |
+
position: absolute;
|
| 78 |
+
border-radius: 50%;
|
| 79 |
+
filter: blur(90px); /* The heavy blur creates the frosted effect */
|
| 80 |
+
opacity: 0.6;
|
| 81 |
+
animation: floatOrb 10s infinite ease-in-out alternate;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
/* Orb 1: Top Left - Violet */
|
| 85 |
+
.orb-1 {
|
| 86 |
+
width: 50vw;
|
| 87 |
+
height: 50vw;
|
| 88 |
+
background: radial-gradient(circle, var(--glow-1) 0%, rgba(0,0,0,0) 70%);
|
| 89 |
+
top: -10%;
|
| 90 |
+
right: -10%; /* RTL positioning */
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
/* Orb 2: Center Top - Blue */
|
| 94 |
+
.orb-2 {
|
| 95 |
+
width: 40vw;
|
| 96 |
+
height: 40vw;
|
| 97 |
+
background: radial-gradient(circle, var(--glow-2) 0%, rgba(0,0,0,0) 70%);
|
| 98 |
+
top: 10%;
|
| 99 |
+
left: 30%;
|
| 100 |
+
animation-delay: -2s;
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
/* Orb 3: Bottom Right - Pink */
|
| 104 |
+
.orb-3 {
|
| 105 |
+
width: 45vw;
|
| 106 |
+
height: 45vw;
|
| 107 |
+
background: radial-gradient(circle, var(--glow-3) 0%, rgba(0,0,0,0) 70%);
|
| 108 |
+
bottom: -5%;
|
| 109 |
+
left: -5%;
|
| 110 |
+
animation-delay: -5s;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
@keyframes floatOrb {
|
| 114 |
+
0% { transform: translate(0, 0) scale(1); }
|
| 115 |
+
100% { transform: translate(20px, -20px) scale(1.05); }
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
/* --- Modern Glassmorphism Class --- */
|
| 119 |
+
.glass-panel {
|
| 120 |
+
background: var(--glass-surface);
|
| 121 |
+
backdrop-filter: blur(20px);
|
| 122 |
+
-webkit-backdrop-filter: blur(20px);
|
| 123 |
+
border: 1px solid var(--glass-border);
|
| 124 |
+
border-radius: var(--radius-card);
|
| 125 |
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
|
| 126 |
+
transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
|
| 127 |
+
position: relative;
|
| 128 |
+
z-index: 1; /* Sit above orbs */
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
.glass-panel:hover {
|
| 132 |
+
border-color: rgba(255, 255, 255, 0.15);
|
| 133 |
+
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
/* --- Header --- */
|
| 137 |
+
header {
|
| 138 |
+
padding: 20px 40px;
|
| 139 |
+
display: flex;
|
| 140 |
+
justify-content: space-between;
|
| 141 |
+
align-items: center;
|
| 142 |
+
z-index: 10;
|
| 143 |
+
background: rgba(5, 5, 8, 0.6);
|
| 144 |
+
backdrop-filter: blur(12px);
|
| 145 |
+
border-bottom: 1px solid var(--glass-border);
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
.brand {
|
| 149 |
+
font-size: 1.3rem;
|
| 150 |
+
font-weight: 700;
|
| 151 |
+
color: var(--text-main);
|
| 152 |
+
display: flex;
|
| 153 |
+
align-items: center;
|
| 154 |
+
gap: 12px;
|
| 155 |
+
letter-spacing: -0.5px;
|
| 156 |
+
text-shadow: 0 0 20px rgba(255,255,255,0.1);
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
.brand i {
|
| 160 |
+
color: var(--accent-primary);
|
| 161 |
+
font-size: 1.2rem;
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
.user-profile {
|
| 165 |
+
display: flex;
|
| 166 |
+
align-items: center;
|
| 167 |
+
gap: 12px;
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
.avatar {
|
| 171 |
+
width: 40px;
|
| 172 |
+
height: 40px;
|
| 173 |
+
border-radius: 50%;
|
| 174 |
+
border: 2px solid rgba(255, 255, 255, 0.1);
|
| 175 |
+
object-fit: cover;
|
| 176 |
+
box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
/* --- Layout --- */
|
| 180 |
+
main {
|
| 181 |
+
flex: 1;
|
| 182 |
+
padding: 40px;
|
| 183 |
+
display: grid;
|
| 184 |
+
grid-template-columns: 1.1fr 0.9fr 1fr;
|
| 185 |
+
grid-template-rows: 1fr;
|
| 186 |
+
gap: var(--gap-grid);
|
| 187 |
+
max-width: 1600px;
|
| 188 |
+
margin: 0 auto;
|
| 189 |
+
width: 100%;
|
| 190 |
+
align-items: start;
|
| 191 |
+
position: relative;
|
| 192 |
+
z-index: 1;
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
.section-header {
|
| 196 |
+
display: flex;
|
| 197 |
+
justify-content: space-between;
|
| 198 |
+
align-items: center;
|
| 199 |
+
margin-bottom: 24px;
|
| 200 |
+
padding: 0 8px;
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
.section-title {
|
| 204 |
+
font-size: 1rem;
|
| 205 |
+
font-weight: 600;
|
| 206 |
+
color: var(--text-muted);
|
| 207 |
+
display: flex;
|
| 208 |
+
align-items: center;
|
| 209 |
+
gap: 10px;
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
.section-title i {
|
| 213 |
+
font-size: 0.9rem;
|
| 214 |
+
opacity: 0.8;
|
| 215 |
+
color: var(--accent-primary);
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
+
/* --- 1. Public Chat --- */
|
| 219 |
+
.section-public {
|
| 220 |
+
grid-column: span 1;
|
| 221 |
+
height: 600px;
|
| 222 |
+
display: flex;
|
| 223 |
+
flex-direction: column;
|
| 224 |
+
}
|
| 225 |
+
|
| 226 |
+
.message-list {
|
| 227 |
+
flex: 1;
|
| 228 |
+
overflow-y: auto;
|
| 229 |
+
display: flex;
|
| 230 |
+
flex-direction: column;
|
| 231 |
+
gap: 12px;
|
| 232 |
+
padding: 8px;
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
/* Minimal Scrollbar */
|
| 236 |
+
.message-list::-webkit-scrollbar {
|
| 237 |
+
width: 4px;
|
| 238 |
+
}
|
| 239 |
+
|
| 240 |
+
.message-list::-webkit-scrollbar-thumb {
|
| 241 |
+
background: rgba(255, 255, 255, 0.1);
|
| 242 |
+
border-radius: 4px;
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
.message-card {
|
| 246 |
+
padding: 16px;
|
| 247 |
+
background: rgba(255, 255, 255, 0.02);
|
| 248 |
+
border-radius: var(--radius-btn);
|
| 249 |
+
border: 1px solid transparent;
|
| 250 |
+
transition: all 0.2s ease;
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
.message-card:hover {
|
| 254 |
+
background: rgba(255, 255, 255, 0.05);
|
| 255 |
+
border-color: rgba(255, 255, 255, 0.1);
|
| 256 |
+
transform: translateX(-4px); /* Subtle RTL movement */
|
| 257 |
+
}
|
| 258 |
+
|
| 259 |
+
.msg-meta {
|
| 260 |
+
display: flex;
|
| 261 |
+
align-items: center;
|
| 262 |
+
gap: 10px;
|
| 263 |
+
margin-bottom: 8px;
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
.msg-name {
|
| 267 |
+
font-size: 0.95rem;
|
| 268 |
+
font-weight: 600;
|
| 269 |
+
color: var(--text-main);
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
.msg-role {
|
| 273 |
+
font-size: 0.7rem;
|
| 274 |
+
padding: 2px 8px;
|
| 275 |
+
border-radius: 6px;
|
| 276 |
+
background: rgba(139, 92, 246, 0.15);
|
| 277 |
+
color: #c4b5fd;
|
| 278 |
+
font-weight: 500;
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
.msg-preview {
|
| 282 |
+
font-size: 0.9rem;
|
| 283 |
+
color: var(--text-muted);
|
| 284 |
+
line-height: 1.6;
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
/* --- 2. Announcement --- */
|
| 288 |
+
.section-announcement {
|
| 289 |
+
grid-column: span 1;
|
| 290 |
+
height: 600px;
|
| 291 |
+
display: flex;
|
| 292 |
+
flex-direction: column;
|
| 293 |
+
justify-content: center;
|
| 294 |
+
align-items: center;
|
| 295 |
+
text-align: center;
|
| 296 |
+
padding: 40px 24px;
|
| 297 |
+
background: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.00) 100%);
|
| 298 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
| 299 |
+
}
|
| 300 |
+
|
| 301 |
+
.announcement-icon {
|
| 302 |
+
font-size: 3rem;
|
| 303 |
+
margin-bottom: 24px;
|
| 304 |
+
background: linear-gradient(to bottom right, var(--accent-secondary), var(--accent-primary));
|
| 305 |
+
-webkit-background-clip: text;
|
| 306 |
+
-webkit-text-fill-color: transparent;
|
| 307 |
+
filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.3));
|
| 308 |
+
}
|
| 309 |
+
|
| 310 |
+
.announcement-content h3 {
|
| 311 |
+
font-size: 1.4rem;
|
| 312 |
+
margin-bottom: 16px;
|
| 313 |
+
font-weight: 700;
|
| 314 |
+
color: var(--text-main);
|
| 315 |
+
}
|
| 316 |
+
|
| 317 |
+
.announcement-content p {
|
| 318 |
+
font-size: 0.95rem;
|
| 319 |
+
color: var(--text-muted);
|
| 320 |
+
line-height: 1.8;
|
| 321 |
+
max-width: 90%;
|
| 322 |
+
margin: 0 auto;
|
| 323 |
+
}
|
| 324 |
+
|
| 325 |
+
.announcement-date {
|
| 326 |
+
margin-top: 40px;
|
| 327 |
+
font-size: 0.8rem;
|
| 328 |
+
color: rgba(255, 255, 255, 0.3);
|
| 329 |
+
letter-spacing: 1px;
|
| 330 |
+
text-transform: uppercase;
|
| 331 |
+
}
|
| 332 |
+
|
| 333 |
+
/* --- 3. Private Rooms --- */
|
| 334 |
+
.section-rooms {
|
| 335 |
+
grid-column: span 1;
|
| 336 |
+
height: 600px;
|
| 337 |
+
display: flex;
|
| 338 |
+
flex-direction: column;
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
.btn-create {
|
| 342 |
+
background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
|
| 343 |
+
color: white;
|
| 344 |
+
border: none;
|
| 345 |
+
padding: 8px 16px;
|
| 346 |
+
border-radius: var(--radius-btn);
|
| 347 |
+
font-family: inherit;
|
| 348 |
+
font-size: 0.85rem;
|
| 349 |
+
font-weight: 600;
|
| 350 |
+
cursor: pointer;
|
| 351 |
+
transition: all 0.3s;
|
| 352 |
+
display: flex;
|
| 353 |
+
align-items: center;
|
| 354 |
+
gap: 8px;
|
| 355 |
+
box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
|
| 356 |
+
}
|
| 357 |
+
|
| 358 |
+
.btn-create:hover {
|
| 359 |
+
transform: translateY(-2px);
|
| 360 |
+
box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
+
.rooms-list {
|
| 364 |
+
flex: 1;
|
| 365 |
+
overflow-y: auto;
|
| 366 |
+
display: flex;
|
| 367 |
+
flex-direction: column;
|
| 368 |
+
gap: 10px;
|
| 369 |
+
margin-top: 10px;
|
| 370 |
+
}
|
| 371 |
+
|
| 372 |
+
.room-card {
|
| 373 |
+
display: flex;
|
| 374 |
+
justify-content: space-between;
|
| 375 |
+
align-items: center;
|
| 376 |
+
padding: 14px 18px;
|
| 377 |
+
border-radius: var(--radius-btn);
|
| 378 |
+
cursor: pointer;
|
| 379 |
+
transition: all 0.2s ease;
|
| 380 |
+
border: 1px solid transparent;
|
| 381 |
+
}
|
| 382 |
+
|
| 383 |
+
.room-card:hover {
|
| 384 |
+
background: rgba(255, 255, 255, 0.04);
|
| 385 |
+
border-color: rgba(255, 255, 255, 0.05);
|
| 386 |
+
}
|
| 387 |
+
|
| 388 |
+
.room-info {
|
| 389 |
+
display: flex;
|
| 390 |
+
align-items: center;
|
| 391 |
+
gap: 12px;
|
| 392 |
+
}
|
| 393 |
+
|
| 394 |
+
.room-icon {
|
| 395 |
+
color: var(--text-muted);
|
| 396 |
+
font-size: 1rem;
|
| 397 |
+
opacity: 0.5;
|
| 398 |
+
}
|
| 399 |
+
|
| 400 |
+
.room-name {
|
| 401 |
+
font-size: 0.95rem;
|
| 402 |
+
font-weight: 500;
|
| 403 |
+
color: var(--text-main);
|
| 404 |
+
}
|
| 405 |
+
|
| 406 |
+
.btn-copy {
|
| 407 |
+
background: rgba(255, 255, 255, 0.05);
|
| 408 |
+
border: none;
|
| 409 |
+
color: var(--text-muted);
|
| 410 |
+
cursor: pointer;
|
| 411 |
+
padding: 8px;
|
| 412 |
+
border-radius: 8px;
|
| 413 |
+
opacity: 0;
|
| 414 |
+
transition: all 0.2s;
|
| 415 |
+
transform: translateX(10px);
|
| 416 |
+
}
|
| 417 |
+
|
| 418 |
+
.room-card:hover .btn-copy {
|
| 419 |
+
opacity: 1;
|
| 420 |
+
transform: translateX(0);
|
| 421 |
+
}
|
| 422 |
+
|
| 423 |
+
.btn-copy:hover {
|
| 424 |
+
background: rgba(255, 255, 255, 0.15);
|
| 425 |
+
color: var(--text-main);
|
| 426 |
+
}
|
| 427 |
+
|
| 428 |
+
/* --- Footer & Branding --- */
|
| 429 |
+
footer {
|
| 430 |
+
text-align: center;
|
| 431 |
+
padding: 30px;
|
| 432 |
+
font-size: 0.8rem;
|
| 433 |
+
color: rgba(255, 255, 255, 0.2);
|
| 434 |
+
margin-top: auto;
|
| 435 |
+
background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
|
| 436 |
+
}
|
| 437 |
+
|
| 438 |
+
footer a {
|
| 439 |
+
color: var(--text-muted);
|
| 440 |
+
text-decoration: none;
|
| 441 |
+
transition: color 0.2s;
|
| 442 |
+
font-weight: 500;
|
| 443 |
+
}
|
| 444 |
+
|
| 445 |
+
footer a:hover {
|
| 446 |
+
color: var(--accent-primary);
|
| 447 |
+
text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
+
/* --- Toast Notification --- */
|
| 451 |
+
.toast {
|
| 452 |
+
position: fixed;
|
| 453 |
+
bottom: 40px;
|
| 454 |
+
left: 50%;
|
| 455 |
+
transform: translateX(-50%) translateY(30px);
|
| 456 |
+
background: rgba(20, 20, 25, 0.9);
|
| 457 |
+
backdrop-filter: blur(16px);
|
| 458 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
| 459 |
+
color: var(--text-main);
|
| 460 |
+
padding: 12px 24px;
|
| 461 |
+
border-radius: 50px;
|
| 462 |
+
font-size: 0.9rem;
|
| 463 |
+
display: flex;
|
| 464 |
+
align-items: center;
|
| 465 |
+
gap: 12px;
|
| 466 |
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
|
| 467 |
+
opacity: 0;
|
| 468 |
+
pointer-events: none;
|
| 469 |
+
transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
| 470 |
+
z-index: 100;
|
| 471 |
+
}
|
| 472 |
+
|
| 473 |
+
.toast.show {
|
| 474 |
+
transform: translateX(-50%) translateY(0);
|
| 475 |
+
opacity: 1;
|
| 476 |
+
}
|
| 477 |
+
|
| 478 |
+
.toast i {
|
| 479 |
+
font-size: 1.1rem;
|
| 480 |
+
}
|
| 481 |
+
|
| 482 |
+
/* --- Modal --- */
|
| 483 |
+
.modal-overlay {
|
| 484 |
+
position: fixed;
|
| 485 |
+
top: 0;
|
| 486 |
+
left: 0;
|
| 487 |
+
width: 100%;
|
| 488 |
+
height: 100%;
|
| 489 |
+
background: rgba(0, 0, 0, 0.7);
|
| 490 |
+
backdrop-filter: blur(8px);
|
| 491 |
+
display: flex;
|
| 492 |
+
justify-content: center;
|
| 493 |
+
align-items: center;
|
| 494 |
+
z-index: 50;
|
| 495 |
+
opacity: 0;
|
| 496 |
+
pointer-events: none;
|
| 497 |
+
transition: opacity 0.3s ease;
|
| 498 |
+
}
|
| 499 |
+
|
| 500 |
+
.modal-overlay.active {
|
| 501 |
+
opacity: 1;
|
| 502 |
+
pointer-events: auto;
|
| 503 |
+
}
|
| 504 |
+
|
| 505 |
+
.modal {
|
| 506 |
+
background: rgba(20, 20, 25, 0.95);
|
| 507 |
+
border: 1px solid var(--glass-border);
|
| 508 |
+
padding: 40px;
|
| 509 |
+
border-radius: var(--radius-card);
|
| 510 |
+
width: 90%;
|
| 511 |
+
max-width: 400px;
|
| 512 |
+
transform: scale(0.9) translateY(20px);
|
| 513 |
+
transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
|
| 514 |
+
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
|
| 515 |
+
}
|
| 516 |
+
|
| 517 |
+
.modal-overlay.active .modal {
|
| 518 |
+
transform: scale(1) translateY(0);
|
| 519 |
+
}
|
| 520 |
+
|
| 521 |
+
.modal h3 {
|
| 522 |
+
margin-bottom: 24px;
|
| 523 |
+
color: var(--text-main);
|
| 524 |
+
font-weight: 600;
|
| 525 |
+
}
|
| 526 |
+
|
| 527 |
+
.modal input {
|
| 528 |
+
width: 100%;
|
| 529 |
+
background: rgba(255, 255, 255, 0.05);
|
| 530 |
+
border: 1px solid var(--glass-border);
|
| 531 |
+
padding: 14px 18px;
|
| 532 |
+
border-radius: var(--radius-btn);
|
| 533 |
+
color: white;
|
| 534 |
+
font-family: inherit;
|
| 535 |
+
margin-bottom: 24px;
|
| 536 |
+
transition: all 0.2s;
|
| 537 |
+
font-size: 0.95rem;
|
| 538 |
+
}
|
| 539 |
+
|
| 540 |
+
.modal input:focus {
|
| 541 |
+
border-color: var(--accent-primary);
|
| 542 |
+
background: rgba(255, 255, 255, 0.08);
|
| 543 |
+
box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
|
| 544 |
+
}
|
| 545 |
+
|
| 546 |
+
.modal-actions {
|
| 547 |
+
display: flex;
|
| 548 |
+
justify-content: flex-end;
|
| 549 |
+
gap: 12px;
|
| 550 |
+
}
|
| 551 |
+
|
| 552 |
+
.btn-modal {
|
| 553 |
+
padding: 10px 20px;
|
| 554 |
+
border-radius: var(--radius-btn);
|
| 555 |
+
border: none;
|
| 556 |
+
font-family: inherit;
|
| 557 |
+
cursor: pointer;
|
| 558 |
+
font-size: 0.9rem;
|
| 559 |
+
font-weight: 500;
|
| 560 |
+
}
|
| 561 |
+
|
| 562 |
+
.btn-cancel {
|
| 563 |
+
background: transparent;
|
| 564 |
+
color: var(--text-muted);
|
| 565 |
+
}
|
| 566 |
+
|
| 567 |
+
.btn-cancel:hover {
|
| 568 |
+
color: var(--text-main);
|
| 569 |
+
background: rgba(255,255,255,0.05);
|
| 570 |
+
}
|
| 571 |
+
|
| 572 |
+
.btn-confirm {
|
| 573 |
+
background: var(--accent-primary);
|
| 574 |
+
color: white;
|
| 575 |
+
}
|
| 576 |
+
|
| 577 |
+
.btn-confirm:hover {
|
| 578 |
+
background: #7c3aed;
|
| 579 |
+
box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
|
| 580 |
+
}
|
| 581 |
+
|
| 582 |
+
/* --- Responsive --- */
|
| 583 |
+
@media (max-width: 1200px) {
|
| 584 |
+
main {
|
| 585 |
+
grid-template-columns: 1fr 1fr;
|
| 586 |
+
}
|
| 587 |
+
|
| 588 |
+
.section-announcement {
|
| 589 |
+
grid-column: span 2;
|
| 590 |
+
height: auto;
|
| 591 |
+
min-height: 220px;
|
| 592 |
+
order: -1;
|
| 593 |
+
}
|
| 594 |
+
}
|
| 595 |
+
|
| 596 |
+
@media (max-width: 768px) {
|
| 597 |
+
header {
|
| 598 |
+
padding: 16px 24px;
|
| 599 |
+
}
|
| 600 |
+
|
| 601 |
+
main {
|
| 602 |
+
grid-template-columns: 1fr;
|
| 603 |
+
padding: 24px;
|
| 604 |
+
gap: 24px;
|
| 605 |
+
}
|
| 606 |
+
|
| 607 |
+
.section-public,
|
| 608 |
+
.section-announcement,
|
| 609 |
+
.section-rooms {
|
| 610 |
+
grid-column: span 1;
|
| 611 |
+
height: auto;
|
| 612 |
+
min-height: 450px;
|
| 613 |
+
}
|
| 614 |
+
|
| 615 |
+
.section-announcement {
|
| 616 |
+
min-height: 280px;
|
| 617 |
+
}
|
| 618 |
+
|
| 619 |
+
.btn-copy {
|
| 620 |
+
opacity: 1;
|
| 621 |
+
transform: none;
|
| 622 |
+
}
|
| 623 |
+
|
| 624 |
+
/* Adjust orbs for mobile to prevent excessive brightness */
|
| 625 |
+
.orb-1 { width: 80vw; height: 80vw; top: -20%; right: -20%; }
|
| 626 |
+
.orb-3 { width: 80vw; height: 80vw; bottom: -20%; left: -20%; }
|
| 627 |
+
}
|
| 628 |
+
</style>
|
| 629 |
+
</head>
|
| 630 |
+
|
| 631 |
+
<body>
|
| 632 |
+
|
| 633 |
+
<!-- Ambient Background Container (Frosted Rounded Gradients) -->
|
| 634 |
+
<div class="ambient-container">
|
| 635 |
+
<div class="ambient-orb orb-1"></div>
|
| 636 |
+
<div class="ambient-orb orb-2"></div>
|
| 637 |
+
<div class="ambient-orb orb-3"></div>
|
| 638 |
+
</div>
|
| 639 |
+
|
| 640 |
+
<!-- Header -->
|
| 641 |
+
<header>
|
| 642 |
+
<div class="brand">
|
| 643 |
+
<i class="fa-solid fa-layer-group"></i>
|
| 644 |
+
<span>چتروم</span>
|
| 645 |
+
</div>
|
| 646 |
+
<div class="user-profile">
|
| 647 |
+
<img src="https://picsum.photos/seed/user123/100/100.jpg" alt="Avatar" class="avatar">
|
| 648 |
+
</div>
|
| 649 |
+
</header>
|
| 650 |
+
|
| 651 |
+
<!-- Main Grid -->
|
| 652 |
+
<main>
|
| 653 |
+
|
| 654 |
+
<!-- 1. Public Chat -->
|
| 655 |
+
<section class="glass-panel section-public">
|
| 656 |
+
<div class="section-header">
|
| 657 |
+
<span class="section-title"><i class="fa-solid fa-earth-asia"></i> گفتگوی عمومی</span>
|
| 658 |
+
</div>
|
| 659 |
+
<div class="message-list" id="publicList">
|
| 660 |
+
<!-- JS Content -->
|
| 661 |
+
</div>
|
| 662 |
+
</section>
|
| 663 |
+
|
| 664 |
+
<!-- 2. Announcement -->
|
| 665 |
+
<section class="glass-panel section-announcement">
|
| 666 |
+
<div class="announcement-content">
|
| 667 |
+
<i class="fa-solid fa-sparkles announcement-icon"></i>
|
| 668 |
+
<h3>بهروزرسانی سیستم</h3>
|
| 669 |
+
<p>
|
| 670 |
+
سیستم امنیتی چتروم به نسخه ۲.۰ ارتقا یافت.
|
| 671 |
+
لطفاً در صورت مشاهده هرگونه مشکل فنی، موضوع را از بخش پشتیبانی به ما اطلاع دهید.
|
| 672 |
+
</p>
|
| 673 |
+
<div class="announcement-date">۲۰ مهر ۱۴۰۳</div>
|
| 674 |
+
</div>
|
| 675 |
+
</section>
|
| 676 |
+
|
| 677 |
+
<!-- 3. Private Rooms -->
|
| 678 |
+
<section class="glass-panel section-rooms">
|
| 679 |
+
<div class="section-header">
|
| 680 |
+
<span class="section-title"><i class="fa-solid fa-lock"></i> اتاقهای خصوصی</span>
|
| 681 |
+
<button class="btn-create" onclick="openModal()">
|
| 682 |
+
<i class="fa-solid fa-plus"></i> جدید
|
| 683 |
+
</button>
|
| 684 |
+
</div>
|
| 685 |
+
<div class="rooms-list" id="roomsList">
|
| 686 |
+
<!-- JS Content -->
|
| 687 |
+
</div>
|
| 688 |
+
</section>
|
| 689 |
+
|
| 690 |
+
</main>
|
| 691 |
+
|
| 692 |
+
<!-- Footer -->
|
| 693 |
+
<footer>
|
| 694 |
+
<p>© ۲۰۲۳ تمامی حقوق محفوظ است.</p>
|
| 695 |
+
<p style="margin-top:10px;">
|
| 696 |
+
<a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">
|
| 697 |
+
Built with anycoder
|
| 698 |
+
<i class="fa-solid fa-arrow-up-right-from-square" style="font-size: 0.7em; vertical-align: middle; margin-right: 4px;"></i>
|
| 699 |
+
</a>
|
| 700 |
+
</p>
|
| 701 |
+
</footer>
|
| 702 |
+
|
| 703 |
+
<!-- Create Room Modal -->
|
| 704 |
+
<div class="modal-overlay" id="roomModal">
|
| 705 |
+
<div class="modal">
|
| 706 |
+
<h3>ایجاد اتاق جدید</h3>
|
| 707 |
+
<input type="text" id="newRoomName" placeholder="نام اتاق را وارد کنید..." autocomplete="off">
|
| 708 |
+
<div class="modal-actions">
|
| 709 |
+
<button class="btn-modal btn-cancel" onclick="closeModal()">لغو</button>
|
| 710 |
+
<button class="btn-modal btn-confirm" onclick="confirmCreateRoom()">ایجاد</button>
|
| 711 |
+
</div>
|
| 712 |
+
</div>
|
| 713 |
+
</div>
|
| 714 |
+
|
| 715 |
+
<!-- Toast Notification -->
|
| 716 |
+
<div class="toast" id="toast">
|
| 717 |
+
<i class="fa-solid fa-check-circle"></i>
|
| 718 |
+
<span id="toastMessage">عملیات موفقیتآمیز بود</span>
|
| 719 |
+
</div>
|
| 720 |
+
|
| 721 |
+
<script>
|
| 722 |
+
// Mock Data
|
| 723 |
+
const publicMessages = [
|
| 724 |
+
{ id: 1, name: 'مدیر سیستم', role: 'Admin', text: 'خوش آمدید به لابی اصلی. لطفاً قوانین را رعایت کنید.' },
|
| 725 |
+
{ id: 2, name: 'پشتیبان فنی', role: 'Support', text: 'سرورها در ساعت ۳ بامداد بهروزرسانی میشوند.' },
|
| 726 |
+
{ id: 3, name: 'مدیر سیستم', role: 'Admin', text: 'کاربران جدید لطفاً پروفایل خود را تکمیل کنند.' },
|
| 727 |
+
{ id: 4, name: 'پشتیبان فنی', role: 'Support', text: 'گزارش باگها را از طریق تیکت ارسال کنید.' },
|
| 728 |
+
{ id: 5, name: 'مدیر سیستم', role: 'Admin', text: 'چت عمومی فقط برای گفتگوی عمومی است.' },
|
| 729 |
+
];
|
| 730 |
+
|
| 731 |
+
const initialRooms = [
|
| 732 |
+
{ id: 101, name: 'گروه برنامهنویسی', link: 'https://chat.app/room/dev' },
|
| 733 |
+
{ id: 102, name: 'گروه طراحی UI/UX', link: 'https://chat.app/room/design' },
|
| 734 |
+
{ id: 103, name: 'اتاق گفتگوی آزاد', link: 'https://chat.app/room/general' },
|
| 735 |
+
];
|
| 736 |
+
|
| 737 |
+
// DOM Elements
|
| 738 |
+
const publicListEl = document.getElementById('publicList');
|
| 739 |
+
const roomsListEl = document.getElementById('roomsList');
|
| 740 |
+
const modalEl = document.getElementById('roomModal');
|
| 741 |
+
const newRoomInput = document.getElementById('newRoomName');
|
| 742 |
+
const toastEl = document.getElementById('toast');
|
| 743 |
+
const toastMsgEl = document.getElementById('toastMessage');
|
| 744 |
+
|
| 745 |
+
// Initialize App
|
| 746 |
+
function init() {
|
| 747 |
+
renderPublicMessages();
|
| 748 |
+
renderRooms();
|
| 749 |
+
}
|
| 750 |
+
|
| 751 |
+
// Render Public Chat
|
| 752 |
+
function renderPublicMessages() {
|
| 753 |
+
publicListEl.innerHTML = '';
|
| 754 |
+
publicMessages.forEach(msg => {
|
| 755 |
+
const item = document.createElement('div');
|
| 756 |
+
item.className = 'message-card';
|
| 757 |
+
item.innerHTML = `
|
| 758 |
+
<div class="msg-meta">
|
| 759 |
+
<span class="msg-name">${msg.name}</span>
|
| 760 |
+
<span class="msg-role">${msg.role}</span>
|
| 761 |
+
</div>
|
| 762 |
+
<div class="msg-preview">${msg.text}</div>
|
| 763 |
+
`;
|
| 764 |
+
publicListEl.appendChild(item);
|
| 765 |
+
});
|
| 766 |
+
}
|
| 767 |
+
|
| 768 |
+
// Render Private Rooms
|
| 769 |
+
function renderRooms() {
|
| 770 |
+
roomsListEl.innerHTML = '';
|
| 771 |
+
initialRooms.forEach(room => {
|
| 772 |
+
const item = document.createElement('div');
|
| 773 |
+
item.className = 'room-card';
|
| 774 |
+
item.onclick = (e) => {
|
| 775 |
+
if(!e.target.closest('.btn-copy')) {
|
| 776 |
+
navigateToRoom(room.name);
|
| 777 |
+
}
|
| 778 |
+
};
|
| 779 |
+
item.innerHTML = `
|
| 780 |
+
<div class="room-info">
|
| 781 |
+
<i class="fa-solid fa-hashtag room-icon"></i>
|
| 782 |
+
<span class="room-name">${room.name}</span>
|
| 783 |
+
</div>
|
| 784 |
+
<button class="btn-copy" onclick="copyLink('${room.link}')" title="کپی لینک">
|
| 785 |
+
<i class="fa-regular fa-copy"></i>
|
| 786 |
+
</button>
|
| 787 |
+
`;
|
| 788 |
+
roomsListEl.appendChild(item);
|
| 789 |
+
});
|
| 790 |
+
}
|
| 791 |
+
|
| 792 |
+
// Interaction: Copy Link
|
| 793 |
+
function copyLink(link) {
|
| 794 |
+
navigator.clipboard.writeText(link).then(() => {
|
| 795 |
+
showToast('لینک دعوت کپی شد');
|
| 796 |
+
}).catch(() => {
|
| 797 |
+
showToast('خطا در کپی لینک', true);
|
| 798 |
+
});
|
| 799 |
+
}
|
| 800 |
+
|
| 801 |
+
// Interaction: Navigate (Simulated)
|
| 802 |
+
function navigateToRoom(roomName) {
|
| 803 |
+
showToast(`در حال ورود به ${roomName}...`);
|
| 804 |
+
}
|
| 805 |
+
|
| 806 |
+
// Interaction: Modal Logic
|
| 807 |
+
function openModal() {
|
| 808 |
+
modalEl.classList.add('active');
|
| 809 |
+
newRoomInput.focus();
|
| 810 |
+
}
|
| 811 |
+
|
| 812 |
+
function closeModal() {
|
| 813 |
+
modalEl.classList.remove('active');
|
| 814 |
+
newRoomInput.value = '';
|
| 815 |
+
}
|
| 816 |
+
|
| 817 |
+
modalEl.addEventListener('click', (e) => {
|
| 818 |
+
if (e.target === modalEl) closeModal();
|
| 819 |
+
});
|
| 820 |
+
|
| 821 |
+
// Interaction: Create Room
|
| 822 |
+
function confirmCreateRoom() {
|
| 823 |
+
const name = newRoomInput.value.trim();
|
| 824 |
+
if (name) {
|
| 825 |
+
const newRoom = {
|
| 826 |
+
id: Date.now(),
|
| 827 |
+
name: name,
|
| 828 |
+
link: `https://chat.app/room/${Math.random().toString(36).substr(2, 6)}`
|
| 829 |
+
};
|
| 830 |
+
initialRooms.unshift(newRoom);
|
| 831 |
+
renderRooms();
|
| 832 |
+
closeModal();
|
| 833 |
+
showToast('اتاق جدید ایجاد شد');
|
| 834 |
+
} else {
|
| 835 |
+
// Simple shake animation for error could go here
|
| 836 |
+
newRoomInput.focus();
|
| 837 |
+
}
|
| 838 |
+
}
|
| 839 |
+
|
| 840 |
+
// Utility: Show Toast
|
| 841 |
+
function showToast(message, isError = false) {
|
| 842 |
+
toastMsgEl.textContent = message;
|
| 843 |
+
const icon = toastEl.querySelector('i');
|
| 844 |
+
|
| 845 |
+
if (isError) {
|
| 846 |
+
icon.className = 'fa-solid fa-circle-exclamation';
|
| 847 |
+
icon.style.color = '#ef4444';
|
| 848 |
+
} else {
|
| 849 |
+
icon.className = 'fa-solid fa-check-circle';
|
| 850 |
+
icon.style.color = 'var(--accent-primary)';
|
| 851 |
+
}
|
| 852 |
+
|
| 853 |
+
toastEl.classList.add('show');
|
| 854 |
+
|
| 855 |
+
// Clear previous timeout if exists (optional enhancement)
|
| 856 |
+
if (window.toastTimeout) clearTimeout(window.toastTimeout);
|
| 857 |
+
|
| 858 |
+
window.toastTimeout = setTimeout(() => {
|
| 859 |
+
toastEl.classList.remove('show');
|
| 860 |
+
}, 3000);
|
| 861 |
+
}
|
| 862 |
+
|
| 863 |
+
// Run
|
| 864 |
+
init();
|
| 865 |
+
|
| 866 |
+
</script>
|
| 867 |
+
</body>
|
| 868 |
+
|
| 869 |
+
</html>
|