samirerty commited on
Commit
938736f
·
verified ·
1 Parent(s): 1be55ad

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +607 -601
index.html CHANGED
@@ -1,602 +1,614 @@
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>داشبورد چت | Dark Glass</title>
7
-
8
- <!-- Import Font: Vazirmatn for Persian Typography -->
9
- <link href="https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css" rel="stylesheet" type="text/css" />
10
-
11
- <!-- Import Icons: FontAwesome -->
12
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
13
-
14
- <style>
15
- :root {
16
- /* Color Palette */
17
- --bg-dark: #0f1014;
18
- --glass-bg: rgba(255, 255, 255, 0.03);
19
- --glass-border: rgba(255, 255, 255, 0.08);
20
- --glass-highlight: rgba(255, 255, 255, 0.1);
21
- --text-primary: #ffffff;
22
- --text-secondary: #a0a0a0;
23
- --accent-color: #6c5ce7;
24
- --accent-hover: #5649c0;
25
- --danger-color: #ff7675;
26
- --success-color: #00b894;
27
-
28
- /* Spacing & Radius */
29
- --radius-lg: 24px;
30
- --radius-md: 16px;
31
- --radius-sm: 8px;
32
- --spacing-md: 20px;
33
- }
34
-
35
- * {
36
- box-sizing: border-box;
37
- margin: 0;
38
- padding: 0;
39
- outline: none;
40
- }
41
-
42
- body {
43
- font-family: 'Vazirmatn', sans-serif;
44
- background-color: var(--bg-dark);
45
- color: var(--text-primary);
46
- min-height: 100vh;
47
- overflow-x: hidden;
48
- display: flex;
49
- flex-direction: column;
50
- position: relative;
51
- }
52
-
53
- /* Background Ambience (Static Blob) */
54
- .ambient-bg {
55
- position: fixed;
56
- top: -10%;
57
- right: -10%;
58
- width: 50vw;
59
- height: 50vw;
60
- background: radial-gradient(circle, rgba(108, 92, 231, 0.15) 0%, rgba(0,0,0,0) 70%);
61
- border-radius: 50%;
62
- filter: blur(80px);
63
- z-index: -1;
64
- pointer-events: none;
65
- }
66
-
67
- /* Glassmorphism Utility Classes */
68
- .glass-panel {
69
- background: var(--glass-bg);
70
- backdrop-filter: blur(16px);
71
- -webkit-backdrop-filter: blur(16px);
72
- border: 1px solid var(--glass-border);
73
- border-radius: var(--radius-lg);
74
- box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
75
- transition: transform 0.3s ease, border-color 0.3s ease;
76
- }
77
-
78
- .glass-panel:hover {
79
- border-color: var(--glass-highlight);
80
- }
81
-
82
- /* Header */
83
- header {
84
- padding: 20px 40px;
85
- display: flex;
86
- justify-content: space-between;
87
- align-items: center;
88
- z-index: 10;
89
- }
90
-
91
- .brand {
92
- font-size: 1.5rem;
93
- font-weight: 700;
94
- letter-spacing: -0.5px;
95
- display: flex;
96
- align-items: center;
97
- gap: 10px;
98
- }
99
-
100
- .brand i {
101
- color: var(--accent-color);
102
- }
103
-
104
- .user-profile {
105
- display: flex;
106
- align-items: center;
107
- gap: 12px;
108
- }
109
-
110
- .avatar {
111
- width: 40px;
112
- height: 40px;
113
- border-radius: 50%;
114
- border: 2px solid var(--glass-border);
115
- object-fit: cover;
116
- }
117
-
118
- /* Main Layout */
119
- main {
120
- flex: 1;
121
- padding: 20px 40px 40px 40px;
122
- display: grid;
123
- grid-template-columns: 1fr 1fr 1fr; /* 3 Columns */
124
- grid-template-rows: auto 1fr;
125
- gap: 24px;
126
- max-width: 1600px;
127
- margin: 0 auto;
128
- width: 100%;
129
- }
130
-
131
- /* Section Headers */
132
- .section-header {
133
- display: flex;
134
- justify-content: space-between;
135
- align-items: center;
136
- margin-bottom: 16px;
137
- padding: 0 4px;
138
- }
139
-
140
- .section-title {
141
- font-size: 1.1rem;
142
- font-weight: 500;
143
- color: var(--text-secondary);
144
- }
145
-
146
- /* 1. Public Chat Section */
147
- .section-public {
148
- grid-column: span 1;
149
- display: flex;
150
- flex-direction: column;
151
- height: 600px; /* Fixed height for scroll */
152
- }
153
-
154
- .message-list {
155
- flex: 1;
156
- overflow-y: auto;
157
- display: flex;
158
- flex-direction: column;
159
- gap: 12px;
160
- padding: 4px;
161
- }
162
-
163
- /* Custom Scrollbar */
164
- .message-list::-webkit-scrollbar {
165
- width: 6px;
166
- }
167
- .message-list::-webkit-scrollbar-thumb {
168
- background: rgba(255,255,255,0.1);
169
- border-radius: 10px;
170
- }
171
-
172
- .message-card {
173
- padding: 12px 16px;
174
- background: rgba(255, 255, 255, 0.02);
175
- border-radius: var(--radius-md);
176
- border: 1px solid transparent;
177
- transition: all 0.2s ease;
178
- }
179
-
180
- .message-card:hover {
181
- background: rgba(255, 255, 255, 0.05);
182
- border-color: var(--glass-border);
183
- }
184
-
185
- .msg-meta {
186
- display: flex;
187
- align-items: center;
188
- gap: 8px;
189
- margin-bottom: 6px;
190
- }
191
-
192
- .msg-name {
193
- font-size: 0.9rem;
194
- font-weight: 700;
195
- color: var(--accent-color);
196
- }
197
-
198
- .msg-role {
199
- font-size: 0.7rem;
200
- padding: 2px 6px;
201
- border-radius: 4px;
202
- background: rgba(108, 92, 231, 0.2);
203
- color: #a29bfe;
204
- }
205
-
206
- .msg-preview {
207
- font-size: 0.85rem;
208
- color: var(--text-secondary);
209
- line-height: 1.5;
210
- white-space: nowrap;
211
- overflow: hidden;
212
- text-overflow: ellipsis;
213
- }
214
-
215
- /* 2. Announcement Section */
216
- .section-announcement {
217
- grid-column: span 1;
218
- height: 600px;
219
- position: relative;
220
- overflow: hidden;
221
- display: flex;
222
- flex-direction: column;
223
- justify-content: center;
224
- align-items: center;
225
- text-align: center;
226
- padding: 30px;
227
- }
228
-
229
- .announcement-icon {
230
- font-size: 3rem;
231
- color: var(--accent-color);
232
- margin-bottom: 20px;
233
- opacity: 0.8;
234
- }
235
-
236
- .announcement-content h3 {
237
- font-size: 1.4rem;
238
- margin-bottom: 12px;
239
- color: var(--text-primary);
240
- }
241
-
242
- .announcement-content p {
243
- font-size: 0.95rem;
244
- color: var(--text-secondary);
245
- line-height: 1.6;
246
- }
247
-
248
- .announcement-date {
249
- margin-top: 20px;
250
- font-size: 0.8rem;
251
- color: rgba(255,255,255,0.3);
252
- }
253
-
254
- /* 3. Private Rooms Section */
255
- .section-rooms {
256
- grid-column: span 1;
257
- display: flex;
258
- flex-direction: column;
259
- height: 600px;
260
- }
261
-
262
- .btn-create {
263
- background: var(--accent-color);
264
- color: white;
265
- border: none;
266
- padding: 8px 16px;
267
- border-radius: var(--radius-sm);
268
- font-family: inherit;
269
- font-size: 0.85rem;
270
- cursor: pointer;
271
- transition: background 0.2s;
272
- display: flex;
273
- align-items: center;
274
- gap: 6px;
275
- }
276
-
277
- .btn-create:hover {
278
- background: var(--accent-hover);
279
- }
280
-
281
- .rooms-list {
282
- flex: 1;
283
- overflow-y: auto;
284
- display: flex;
285
- flex-direction: column;
286
- gap: 10px;
287
- margin-top: 10px;
288
- padding: 4px;
289
- }
290
 
291
- .room-card {
292
- display: flex;
293
- justify-content: space-between;
294
- align-items: center;
295
- padding: 14px 16px;
296
- background: rgba(255, 255, 255, 0.02);
297
- border-radius: var(--radius-md);
298
- cursor: pointer;
299
- transition: all 0.2s ease;
300
- border: 1px solid transparent;
301
- }
302
-
303
- .room-card:hover {
304
- background: rgba(255, 255, 255, 0.06);
305
- transform: translateX(-4px); /* RTL subtle slide */
306
- border-color: rgba(255,255,255,0.1);
307
- }
308
-
309
- .room-info {
310
- display: flex;
311
- align-items: center;
312
- gap: 12px;
313
- }
314
-
315
- .room-icon {
316
- width: 36px;
317
- height: 36px;
318
- background: rgba(255,255,255,0.05);
319
- border-radius: 8px;
320
- display: flex;
321
- align-items: center;
322
- justify-content: center;
323
- color: var(--text-secondary);
324
- }
325
-
326
- .room-name {
327
- font-size: 0.95rem;
328
- font-weight: 500;
329
- }
330
-
331
- .btn-copy {
332
- background: transparent;
333
- border: none;
334
- color: var(--text-secondary);
335
- cursor: pointer;
336
- padding: 8px;
337
- border-radius: 50%;
338
- transition: all 0.2s;
339
- }
340
-
341
- .btn-copy:hover {
342
- background: rgba(255,255,255,0.1);
343
- color: var(--text-primary);
344
- }
345
-
346
- /* Footer */
347
- footer {
348
- text-align: center;
349
- padding: 20px;
350
- font-size: 0.8rem;
351
- color: rgba(255,255,255,0.2);
352
- margin-top: auto;
353
- }
354
-
355
- footer a {
356
- color: var(--text-secondary);
357
- text-decoration: none;
358
- transition: color 0.2s;
359
- }
360
-
361
- footer a:hover {
362
- color: var(--accent-color);
363
- }
364
-
365
- /* Toast Notification */
366
- .toast {
367
- position: fixed;
368
- bottom: 30px;
369
- left: 50%;
370
- transform: translateX(-50%) translateY(100px);
371
- background: rgba(20, 20, 25, 0.9);
372
- backdrop-filter: blur(10px);
373
- border: 1px solid var(--glass-border);
374
- color: var(--text-primary);
375
- padding: 12px 24px;
376
- border-radius: 50px;
377
- font-size: 0.9rem;
378
- display: flex;
379
- align-items: center;
380
- gap: 10px;
381
- box-shadow: 0 10px 30px rgba(0,0,0,0.5);
382
- opacity: 0;
383
- transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
384
- z-index: 100;
385
- }
386
-
387
- .toast.show {
388
- transform: translateX(-50%) translateY(0);
389
- opacity: 1;
390
- }
391
-
392
- .toast i {
393
- color: var(--success-color);
394
- }
395
-
396
- /* Modal for Creating Room */
397
- .modal-overlay {
398
- position: fixed;
399
- top: 0;
400
- left: 0;
401
- width: 100%;
402
- height: 100%;
403
- background: rgba(0,0,0,0.6);
404
- backdrop-filter: blur(5px);
405
- display: flex;
406
- justify-content: center;
407
- align-items: center;
408
- z-index: 50;
409
- opacity: 0;
410
- pointer-events: none;
411
- transition: opacity 0.3s;
412
- }
413
-
414
- .modal-overlay.active {
415
- opacity: 1;
416
- pointer-events: auto;
417
- }
418
-
419
- .modal {
420
- background: #1a1b21;
421
- border: 1px solid var(--glass-border);
422
- padding: 30px;
423
- border-radius: var(--radius-lg);
424
- width: 90%;
425
- max-width: 400px;
426
- transform: scale(0.9);
427
- transition: transform 0.3s;
428
- box-shadow: 0 20px 50px rgba(0,0,0,0.5);
429
- }
430
-
431
- .modal-overlay.active .modal {
432
- transform: scale(1);
433
- }
434
-
435
- .modal h3 {
436
- margin-bottom: 20px;
437
- color: var(--text-primary);
438
- }
439
-
440
- .modal input {
441
- width: 100%;
442
- background: rgba(255,255,255,0.05);
443
- border: 1px solid var(--glass-border);
444
- padding: 12px;
445
- border-radius: var(--radius-sm);
446
- color: white;
447
- font-family: inherit;
448
- margin-bottom: 20px;
449
- }
450
-
451
- .modal input:focus {
452
- border-color: var(--accent-color);
453
- }
454
-
455
- .modal-actions {
456
- display: flex;
457
- justify-content: flex-end;
458
- gap: 10px;
459
- }
460
-
461
- .btn-modal {
462
- padding: 8px 16px;
463
- border-radius: var(--radius-sm);
464
- border: none;
465
- font-family: inherit;
466
- cursor: pointer;
467
- }
468
-
469
- .btn-cancel {
470
- background: transparent;
471
- color: var(--text-secondary);
472
- }
473
-
474
- .btn-confirm {
475
- background: var(--accent-color);
476
- color: white;
477
- }
478
-
479
- /* Responsive Breakpoints */
480
- @media (max-width: 1200px) {
481
- main {
482
- grid-template-columns: 1fr 1fr; /* 2 columns */
483
- }
484
- .section-announcement {
485
- grid-column: span 2;
486
- height: auto;
487
- min-height: 250px;
488
- }
489
- }
490
-
491
- @media (max-width: 768px) {
492
- header {
493
- padding: 15px 20px;
494
- }
495
- main {
496
- grid-template-columns: 1fr; /* 1 column */
497
- padding: 20px;
498
- }
499
- .section-public, .section-announcement, .section-rooms {
500
- grid-column: span 1;
501
- height: 500px; /* Stack vertically */
502
- }
503
- .section-announcement {
504
- order: -1; /* Show announcements first on mobile */
505
- height: auto;
506
- }
507
- }
508
- </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
509
  </head>
 
510
  <body>
511
 
512
- <!-- Ambient Background Shape -->
513
- <div class="ambient-bg"></div>
514
-
515
- <!-- Header -->
516
- <header>
517
- <div class="brand">
518
- <i class="fa-solid fa-layer-group"></i>
519
- <span>چت‌روم</span>
520
- </div>
521
- <div class="user-profile">
522
- <!-- Placeholder Avatar -->
523
- <img src="https://picsum.photos/seed/user123/100/100.jpg" alt="Avatar" class="avatar">
524
- </div>
525
- </header>
526
-
527
- <!-- Main Grid Layout -->
528
- <main>
529
-
530
- <!-- 1. Public Chat Section -->
531
- <section class="glass-panel section-public">
532
- <div class="section-header">
533
- <span class="section-title"><i class="fa-solid fa-earth-asia"></i> گفتگوی عمومی</span>
534
- </div>
535
- <div class="message-list" id="publicList">
536
- <!-- Admin Messages injected by JS -->
537
- </div>
538
- </section>
539
-
540
- <!-- 2. Announcement Section -->
541
- <section class="glass-panel section-announcement">
542
- <div class="announcement-content">
543
- <i class="fa-solid fa-bullhorn announcement-icon"></i>
544
- <h3>به‌روزرسانی سیستم</h3>
545
- <p>
546
- سیستم امنیتی چت‌روم به نسخه ۲.۰ ارتقا یافت.
547
- لطفاً در صورت مشاهده هرگونه مشکل فنی، موضوع را از بخش پشتیبانی به ما اطلاع دهید.
548
- <br><br>
549
- از همراهی شما سپاسگزاریم.
550
- </p>
551
- <div class="announcement-date">۲۰ مهر ۱۴۰۳</div>
552
- </div>
553
- </section>
554
-
555
- <!-- 3. Private Rooms Section -->
556
- <section class="glass-panel section-rooms">
557
- <div class="section-header">
558
- <span class="section-title"><i class="fa-solid fa-lock"></i> اتاق‌های خصوصی</span>
559
- <button class="btn-create" onclick="openModal()">
560
- <i class="fa-solid fa-plus"></i> اتاق جدید
561
- </button>
562
- </div>
563
- <div class="rooms-list" id="roomsList">
564
- <!-- Rooms injected by JS -->
565
- </div>
566
- </section>
567
-
568
- </main>
569
-
570
- <!-- Footer -->
571
- <footer>
572
- <p>&copy; ۲۰۲۳ تمامی حقوق محفوظ است.</p>
573
- <p style="margin-top:5px;">
574
- <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">
575
- Built with anycoder <i class="fa-solid fa-arrow-up-right-from-square" style="font-size: 0.7em;"></i>
576
- </a>
577
  </p>
578
- </footer>
579
-
580
- <!-- Create Room Modal -->
581
- <div class="modal-overlay" id="roomModal">
582
- <div class="modal">
583
- <h3>ایجاد اتاق جدید</h3>
584
- <input type="text" id="newRoomName" placeholder="نام اتاق را وارد کنید..." autocomplete="off">
585
- <div class="modal-actions">
586
- <button class="btn-modal btn-cancel" onclick="closeModal()">لغو</button>
587
- <button class="btn-modal btn-confirm" onclick="confirmCreateRoom()">ایجاد</button>
588
- </div>
589
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
590
  </div>
 
591
 
592
- <!-- Toast Notification -->
593
- <div class="toast" id="toast">
594
- <i class="fa-solid fa-check-circle"></i>
595
- <span id="toastMessage">عملیات موفقیت‌آمیز بود</span>
596
- </div>
597
 
598
- <script>
599
- // Mock Data
600
  const publicMessages = [
601
  { id: 1, name: 'مدیر سیستم', role: 'Admin', text: 'خوش آمدید به لابی اصلی. لطفاً قوانین را رعایت کنید.' },
602
  { id: 2, name: 'پشتیبان فنی', role: 'Support', text: 'سرورها در ساعت ۳ بامداد به‌روزرسانی می‌شوند.' },
@@ -649,16 +661,13 @@
649
  const item = document.createElement('div');
650
  item.className = 'room-card';
651
  item.onclick = (e) => {
652
- // Prevent navigation if clicking the copy button
653
  if(!e.target.closest('.btn-copy')) {
654
  navigateToRoom(room.name);
655
  }
656
  };
657
  item.innerHTML = `
658
  <div class="room-info">
659
- <div class="room-icon">
660
- <i class="fa-solid fa-hashtag"></i>
661
- </div>
662
  <span class="room-name">${room.name}</span>
663
  </div>
664
  <button class="btn-copy" onclick="copyLink('${room.link}')" title="کپی لینک">
@@ -681,7 +690,6 @@
681
  // Interaction: Navigate (Simulated)
682
  function navigateToRoom(roomName) {
683
  showToast(`در حال ورود به ${roomName}...`);
684
- // In a real app: window.location.href = ...
685
  }
686
 
687
  // Interaction: Modal Logic
@@ -695,7 +703,6 @@
695
  newRoomInput.value = '';
696
  }
697
 
698
- // Close modal on outside click
699
  modalEl.addEventListener('click', (e) => {
700
  if (e.target === modalEl) closeModal();
701
  });
@@ -709,13 +716,12 @@
709
  name: name,
710
  link: `https://chat.app/room/${Math.random().toString(36).substr(2, 6)}`
711
  };
712
- initialRooms.unshift(newRoom); // Add to top
713
  renderRooms();
714
  closeModal();
715
  showToast('اتاق جدید ایجاد شد');
716
  } else {
717
  newRoomInput.focus();
718
- // Simple shake effect or border color could be added here
719
  }
720
  }
721
 
@@ -726,15 +732,14 @@
726
 
727
  if (isError) {
728
  icon.className = 'fa-solid fa-circle-exclamation';
729
- icon.style.color = 'var(--danger-color)';
730
  } else {
731
  icon.className = 'fa-solid fa-check-circle';
732
- icon.style.color = 'var(--success-color)';
733
  }
734
 
735
  toastEl.classList.add('show');
736
 
737
- // Reset after 3 seconds
738
  setTimeout(() => {
739
  toastEl.classList.remove('show');
740
  }, 3000);
@@ -743,6 +748,7 @@
743
  // Run
744
  init();
745
 
746
- </script>
747
  </body>
 
748
  </html>
 
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>داشبورد چت | Minimal Glass</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: #0a0b10;
20
+ --glass-surface: rgba(255, 255, 255, 0.02);
21
+ --glass-border: rgba(255, 255, 255, 0.04);
22
+ --glass-hover: rgba(255, 255, 255, 0.05);
23
+
24
+ /* Text */
25
+ --text-main: #ffffff;
26
+ --text-muted: #8b9bb4;
27
+
28
+ /* Accents */
29
+ --accent-primary: #7c6fff; /* Soft Lavender/Purple */
30
+ --accent-glow: rgba(124, 111, 255, 0.15);
31
+
32
+ /* Radius & Spacing */
33
+ --radius-card: 20px;
34
+ --radius-btn: 12px;
35
+ --pad-container: 24px;
36
+ --gap-grid: 24px;
37
+ }
38
+
39
+ * {
40
+ box-sizing: border-box;
41
+ margin: 0;
42
+ padding: 0;
43
+ outline: none;
44
+ -webkit-tap-highlight-color: transparent;
45
+ }
46
+
47
+ body {
48
+ font-family: 'Vazirmatn', sans-serif;
49
+ background-color: var(--bg-deep);
50
+ color: var(--text-main);
51
+ min-height: 100vh;
52
+ overflow-x: hidden;
53
+ display: flex;
54
+ flex-direction: column;
55
+ position: relative;
56
+ }
57
+
58
+ /* Subtle Background Ambient */
59
+ .ambient-bg {
60
+ position: fixed;
61
+ top: 50%;
62
+ left: 50%;
63
+ transform: translate(-50%, -50%);
64
+ width: 60vw;
65
+ height: 60vw;
66
+ background: radial-gradient(circle, var(--accent-glow) 0%, rgba(0, 0, 0, 0) 60%);
67
+ border-radius: 50%;
68
+ filter: blur(100px);
69
+ z-index: -1;
70
+ pointer-events: none;
71
+ opacity: 0.6;
72
+ }
73
+
74
+ /* Modern Glassmorphism Class */
75
+ .glass-panel {
76
+ background: var(--glass-surface);
77
+ backdrop-filter: blur(24px);
78
+ -webkit-backdrop-filter: blur(24px);
79
+ border: 1px solid var(--glass-border);
80
+ border-radius: var(--radius-card);
81
+ box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
82
+ transition: transform 0.2s ease, border-color 0.2s ease;
83
+ }
84
+
85
+ /* --- Header --- */
86
+ header {
87
+ padding: 16px 40px;
88
+ display: flex;
89
+ justify-content: space-between;
90
+ align-items: center;
91
+ z-index: 10;
92
+ /* Lighter blur for header */
93
+ background: rgba(10, 11, 16, 0.7);
94
+ backdrop-filter: blur(10px);
95
+ border-bottom: 1px solid var(--glass-border);
96
+ }
97
+
98
+ .brand {
99
+ font-size: 1.2rem;
100
+ font-weight: 600;
101
+ color: var(--text-main);
102
+ display: flex;
103
+ align-items: center;
104
+ gap: 10px;
105
+ letter-spacing: -0.3px;
106
+ }
107
+
108
+ .brand i {
109
+ color: var(--accent-primary);
110
+ font-size: 1rem;
111
+ }
112
+
113
+ .user-profile {
114
+ display: flex;
115
+ align-items: center;
116
+ gap: 12px;
117
+ }
118
+
119
+ .avatar {
120
+ width: 36px;
121
+ height: 36px;
122
+ border-radius: 50%;
123
+ border: 1px solid var(--glass-border);
124
+ object-fit: cover;
125
+ }
126
+
127
+ /* --- Layout --- */
128
+ main {
129
+ flex: 1;
130
+ padding: 30px 40px;
131
+ display: grid;
132
+ grid-template-columns: 1.1fr 0.9fr 1fr; /* Slight adjustment for visual balance */
133
+ grid-template-rows: 1fr;
134
+ gap: var(--gap-grid);
135
+ max-width: 1600px;
136
+ margin: 0 auto;
137
+ width: 100%;
138
+ align-items: start;
139
+ }
140
+
141
+ .section-header {
142
+ display: flex;
143
+ justify-content: space-between;
144
+ align-items: center;
145
+ margin-bottom: 20px;
146
+ padding: 0 4px;
147
+ }
148
+
149
+ .section-title {
150
+ font-size: 0.95rem;
151
+ font-weight: 500;
152
+ color: var(--text-muted);
153
+ display: flex;
154
+ align-items: center;
155
+ gap: 8px;
156
+ }
157
+
158
+ .section-title i {
159
+ font-size: 0.85rem;
160
+ opacity: 0.7;
161
+ }
162
+
163
+ /* --- 1. Public Chat (Cleaner Messages) --- */
164
+ .section-public {
165
+ grid-column: span 1;
166
+ height: 600px;
167
+ display: flex;
168
+ flex-direction: column;
169
+ }
170
+
171
+ .message-list {
172
+ flex: 1;
173
+ overflow-y: auto;
174
+ display: flex;
175
+ flex-direction: column;
176
+ gap: 12px;
177
+ padding: 4px;
178
+ }
179
+
180
+ /* Minimal Scrollbar */
181
+ .message-list::-webkit-scrollbar { width: 4px; }
182
+ .message-list::-webkit-scrollbar-thumb {
183
+ background: rgba(255, 255, 255, 0.05);
184
+ border-radius: 4px;
185
+ }
186
+
187
+ .message-card {
188
+ padding: 14px;
189
+ background: rgba(255, 255, 255, 0.01);
190
+ border-radius: var(--radius-btn);
191
+ border: 1px solid transparent;
192
+ transition: all 0.2s ease;
193
+ position: relative;
194
+ }
195
+
196
+ .message-card:hover {
197
+ background: rgba(255, 255, 255, 0.03);
198
+ border-color: var(--glass-border);
199
+ }
200
+
201
+ .msg-meta {
202
+ display: flex;
203
+ align-items: center;
204
+ gap: 10px;
205
+ margin-bottom: 6px;
206
+ }
207
+
208
+ .msg-name {
209
+ font-size: 0.9rem;
210
+ font-weight: 600;
211
+ color: var(--text-main);
212
+ }
213
+
214
+ .msg-role {
215
+ font-size: 0.7rem;
216
+ padding: 1px 6px;
217
+ border-radius: 4px;
218
+ background: rgba(124, 111, 255, 0.1);
219
+ color: #aeb0ff;
220
+ font-weight: 400;
221
+ }
222
+
223
+ .msg-preview {
224
+ font-size: 0.85rem;
225
+ color: var(--text-muted);
226
+ line-height: 1.6;
227
+ }
228
+
229
+ /* --- 2. Announcement (Elegant Widget) --- */
230
+ .section-announcement {
231
+ grid-column: span 1;
232
+ height: 600px;
233
+ display: flex;
234
+ flex-direction: column;
235
+ justify-content: center;
236
+ align-items: center;
237
+ text-align: center;
238
+ padding: 40px 24px;
239
+ background: linear-gradient(145deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.00) 100%);
240
+ }
241
+
242
+ .announcement-icon {
243
+ font-size: 2.5rem;
244
+ color: var(--accent-primary);
245
+ margin-bottom: 24px;
246
+ opacity: 0.9;
247
+ filter: drop-shadow(0 0 10px var(--accent-glow));
248
+ }
249
+
250
+ .announcement-content h3 {
251
+ font-size: 1.25rem;
252
+ margin-bottom: 12px;
253
+ font-weight: 600;
254
+ color: var(--text-main);
255
+ }
256
+
257
+ .announcement-content p {
258
+ font-size: 0.9rem;
259
+ color: var(--text-muted);
260
+ line-height: 1.7;
261
+ max-width: 90%;
262
+ margin: 0 auto;
263
+ }
264
+
265
+ .announcement-date {
266
+ margin-top: 30px;
267
+ font-size: 0.75rem;
268
+ color: rgba(255, 255, 255, 0.2);
269
+ letter-spacing: 0.5px;
270
+ }
271
+
272
+ /* --- 3. Private Rooms (Minimal List) --- */
273
+ .section-rooms {
274
+ grid-column: span 1;
275
+ height: 600px;
276
+ display: flex;
277
+ flex-direction: column;
278
+ }
279
+
280
+ .btn-create {
281
+ background: var(--accent-primary);
282
+ color: white;
283
+ border: none;
284
+ padding: 6px 14px;
285
+ border-radius: var(--radius-btn);
286
+ font-family: inherit;
287
+ font-size: 0.8rem;
288
+ font-weight: 500;
289
+ cursor: pointer;
290
+ transition: all 0.2s;
291
+ display: flex;
292
+ align-items: center;
293
+ gap: 6px;
294
+ }
295
+
296
+ .btn-create:hover {
297
+ transform: translateY(-1px);
298
+ box-shadow: 0 4px 12px var(--accent-glow);
299
+ }
300
+
301
+ .rooms-list {
302
+ flex: 1;
303
+ overflow-y: auto;
304
+ display: flex;
305
+ flex-direction: column;
306
+ gap: 8px;
307
+ margin-top: 8px;
308
+ }
309
+
310
+ .room-card {
311
+ display: flex;
312
+ justify-content: space-between;
313
+ align-items: center;
314
+ padding: 12px 16px;
315
+ border-radius: var(--radius-btn);
316
+ cursor: pointer;
317
+ transition: all 0.2s ease;
318
+ border: 1px solid transparent;
319
+ }
320
+
321
+ .room-card:hover {
322
+ background: var(--glass-hover);
323
+ }
324
+
325
+ .room-info {
326
+ display: flex;
327
+ align-items: center;
328
+ gap: 12px;
329
+ }
330
+
331
+ .room-icon {
332
+ color: var(--text-muted);
333
+ font-size: 0.9rem;
334
+ opacity: 0.6;
335
+ }
336
+
337
+ .room-name {
338
+ font-size: 0.9rem;
339
+ font-weight: 400;
340
+ color: var(--text-main);
341
+ }
342
+
343
+ .btn-copy {
344
+ background: transparent;
345
+ border: none;
346
+ color: var(--text-muted);
347
+ cursor: pointer;
348
+ padding: 6px;
349
+ border-radius: 6px;
350
+ opacity: 0; /* Hidden by default for cleaner look */
351
+ transition: all 0.2s;
352
+ transform: translateX(5px);
353
+ }
354
+
355
+ .room-card:hover .btn-copy {
356
+ opacity: 1;
357
+ transform: translateX(0);
358
+ }
359
+
360
+ .btn-copy:hover {
361
+ background: rgba(255, 255, 255, 0.1);
362
+ color: var(--text-main);
363
+ }
364
+
365
+ /* --- Footer & Branding --- */
366
+ footer {
367
+ text-align: center;
368
+ padding: 24px;
369
+ font-size: 0.75rem;
370
+ color: rgba(255, 255, 255, 0.15);
371
+ margin-top: auto;
372
+ }
373
+
374
+ footer a {
375
+ color: var(--text-muted);
376
+ text-decoration: none;
377
+ transition: color 0.2s;
378
+ }
379
+
380
+ footer a:hover {
381
+ color: var(--accent-primary);
382
+ }
383
+
384
+ /* --- Toast Notification --- */
385
+ .toast {
386
+ position: fixed;
387
+ bottom: 30px;
388
+ left: 50%;
389
+ transform: translateX(-50%) translateY(20px);
390
+ background: rgba(20, 20, 25, 0.85);
391
+ backdrop-filter: blur(12px);
392
+ border: 1px solid var(--glass-border);
393
+ color: var(--text-main);
394
+ padding: 10px 20px;
395
+ border-radius: 50px;
396
+ font-size: 0.85rem;
397
+ display: flex;
398
+ align-items: center;
399
+ gap: 10px;
400
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
401
+ opacity: 0;
402
+ pointer-events: none;
403
+ transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
404
+ z-index: 100;
405
+ }
406
+
407
+ .toast.show {
408
+ transform: translateX(-50%) translateY(0);
409
+ opacity: 1;
410
+ }
411
+
412
+ .toast i { color: var(--accent-primary); }
413
+
414
+ /* --- Modal --- */
415
+ .modal-overlay {
416
+ position: fixed;
417
+ top: 0; left: 0; width: 100%; height: 100%;
418
+ background: rgba(0, 0, 0, 0.6);
419
+ backdrop-filter: blur(4px);
420
+ display: flex;
421
+ justify-content: center;
422
+ align-items: center;
423
+ z-index: 50;
424
+ opacity: 0;
425
+ pointer-events: none;
426
+ transition: opacity 0.3s ease;
427
+ }
428
+
429
+ .modal-overlay.active { opacity: 1; pointer-events: auto; }
430
+
431
+ .modal {
432
+ background: #14151a;
433
+ border: 1px solid var(--glass-border);
434
+ padding: 32px;
435
+ border-radius: var(--radius-card);
436
+ width: 90%;
437
+ max-width: 380px;
438
+ transform: scale(0.95);
439
+ transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
440
+ box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
441
+ }
442
+
443
+ .modal-overlay.active .modal { transform: scale(1); }
444
+
445
+ .modal h3 {
446
+ margin-bottom: 20px;
447
+ color: var(--text-main);
448
+ font-weight: 500;
449
+ }
450
+
451
+ .modal input {
452
+ width: 100%;
453
+ background: rgba(255, 255, 255, 0.03);
454
+ border: 1px solid var(--glass-border);
455
+ padding: 12px 16px;
456
+ border-radius: var(--radius-btn);
457
+ color: white;
458
+ font-family: inherit;
459
+ margin-bottom: 24px;
460
+ transition: border-color 0.2s;
461
+ }
462
+
463
+ .modal input:focus { border-color: var(--accent-primary); }
464
+
465
+ .modal-actions {
466
+ display: flex;
467
+ justify-content: flex-end;
468
+ gap: 12px;
469
+ }
470
+
471
+ .btn-modal {
472
+ padding: 8px 18px;
473
+ border-radius: var(--radius-btn);
474
+ border: none;
475
+ font-family: inherit;
476
+ cursor: pointer;
477
+ font-size: 0.85rem;
478
+ }
479
+
480
+ .btn-cancel {
481
+ background: transparent;
482
+ color: var(--text-muted);
483
+ }
484
+ .btn-cancel:hover { color: var(--text-main); }
485
+
486
+ .btn-confirm {
487
+ background: var(--accent-primary);
488
+ color: white;
489
+ }
490
+ .btn-confirm:hover { background: #6c5ce7; }
491
+
492
+ /* --- Responsive --- */
493
+ @media (max-width: 1200px) {
494
+ main {
495
+ grid-template-columns: 1fr 1fr;
496
+ }
497
+ .section-announcement {
498
+ grid-column: span 2;
499
+ height: auto;
500
+ min-height: 200px;
501
+ order: -1; /* Show announcement first on tablets */
502
+ }
503
+ }
504
+
505
+ @media (max-width: 768px) {
506
+ header { padding: 12px 24px; }
507
+ main {
508
+ grid-template-columns: 1fr;
509
+ padding: 20px;
510
+ gap: 20px;
511
+ }
512
+ .section-public, .section-announcement, .section-rooms {
513
+ grid-column: span 1;
514
+ height: auto;
515
+ min-height: 400px;
516
+ }
517
+ .section-announcement { min-height: 250px; }
518
+
519
+ /* Show copy button by default on touch devices */
520
+ .btn-copy { opacity: 1; transform: none; }
521
+ }
522
+ </style>
523
  </head>
524
+
525
  <body>
526
 
527
+ <!-- Ambient Background -->
528
+ <div class="ambient-bg"></div>
529
+
530
+ <!-- Header -->
531
+ <header>
532
+ <div class="brand">
533
+ <i class="fa-solid fa-layer-group"></i>
534
+ <span>چت‌روم</span>
535
+ </div>
536
+ <div class="user-profile">
537
+ <img src="https://picsum.photos/seed/user123/100/100.jpg" alt="Avatar" class="avatar">
538
+ </div>
539
+ </header>
540
+
541
+ <!-- Main Grid -->
542
+ <main>
543
+
544
+ <!-- 1. Public Chat -->
545
+ <section class="glass-panel section-public">
546
+ <div class="section-header">
547
+ <span class="section-title"><i class="fa-solid fa-earth-asia"></i> گفتگوی عمومی</span>
548
+ </div>
549
+ <div class="message-list" id="publicList">
550
+ <!-- JS Content -->
551
+ </div>
552
+ </section>
553
+
554
+ <!-- 2. Announcement -->
555
+ <section class="glass-panel section-announcement">
556
+ <div class="announcement-content">
557
+ <i class="fa-solid fa-sparkles announcement-icon"></i>
558
+ <h3>به‌روزرسانی سیستم</h3>
559
+ <p>
560
+ سیستم امنیتی چت‌روم به نسخه ۲.۰ ارتقا یافت.
561
+ لطفاً در صورت مشاهده هرگو��ه مشکل فنی، موضوع را از بخش پشتیبانی به ما اطلاع دهید.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
562
  </p>
563
+ <div class="announcement-date">۲۰ مهر ۱۴۰۳</div>
564
+ </div>
565
+ </section>
566
+
567
+ <!-- 3. Private Rooms -->
568
+ <section class="glass-panel section-rooms">
569
+ <div class="section-header">
570
+ <span class="section-title"><i class="fa-solid fa-lock"></i> اتاق‌های خصوصی</span>
571
+ <button class="btn-create" onclick="openModal()">
572
+ <i class="fa-solid fa-plus"></i> جدید
573
+ </button>
574
+ </div>
575
+ <div class="rooms-list" id="roomsList">
576
+ <!-- JS Content -->
577
+ </div>
578
+ </section>
579
+
580
+ </main>
581
+
582
+ <!-- Footer -->
583
+ <footer>
584
+ <p>&copy; ۲۰۲۳ تمامی حقوق محفوظ است.</p>
585
+ <p style="margin-top:8px;">
586
+ <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">
587
+ Built with anycoder <i class="fa-solid fa-arrow-up-right-from-square" style="font-size: 0.7em; vertical-align: middle;"></i>
588
+ </a>
589
+ </p>
590
+ </footer>
591
+
592
+ <!-- Create Room Modal -->
593
+ <div class="modal-overlay" id="roomModal">
594
+ <div class="modal">
595
+ <h3>ایجاد اتاق جدید</h3>
596
+ <input type="text" id="newRoomName" placeholder="نام اتاق را وارد کنید..." autocomplete="off">
597
+ <div class="modal-actions">
598
+ <button class="btn-modal btn-cancel" onclick="closeModal()">لغو</button>
599
+ <button class="btn-modal btn-confirm" onclick="confirmCreateRoom()">ایجاد</button>
600
+ </div>
601
  </div>
602
+ </div>
603
 
604
+ <!-- Toast Notification -->
605
+ <div class="toast" id="toast">
606
+ <i class="fa-solid fa-check-circle"></i>
607
+ <span id="toastMessage">عملیات موفقیت‌آمیز بود</span>
608
+ </div>
609
 
610
+ <script>
611
+ // Mock Data
612
  const publicMessages = [
613
  { id: 1, name: 'مدیر سیستم', role: 'Admin', text: 'خوش آمدید به لابی اصلی. لطفاً قوانین را رعایت کنید.' },
614
  { id: 2, name: 'پشتیبان فنی', role: 'Support', text: 'سرورها در ساعت ۳ بامداد به‌روزرسانی می‌شوند.' },
 
661
  const item = document.createElement('div');
662
  item.className = 'room-card';
663
  item.onclick = (e) => {
 
664
  if(!e.target.closest('.btn-copy')) {
665
  navigateToRoom(room.name);
666
  }
667
  };
668
  item.innerHTML = `
669
  <div class="room-info">
670
+ <i class="fa-solid fa-hashtag room-icon"></i>
 
 
671
  <span class="room-name">${room.name}</span>
672
  </div>
673
  <button class="btn-copy" onclick="copyLink('${room.link}')" title="کپی لینک">
 
690
  // Interaction: Navigate (Simulated)
691
  function navigateToRoom(roomName) {
692
  showToast(`در حال ورود به ${roomName}...`);
 
693
  }
694
 
695
  // Interaction: Modal Logic
 
703
  newRoomInput.value = '';
704
  }
705
 
 
706
  modalEl.addEventListener('click', (e) => {
707
  if (e.target === modalEl) closeModal();
708
  });
 
716
  name: name,
717
  link: `https://chat.app/room/${Math.random().toString(36).substr(2, 6)}`
718
  };
719
+ initialRooms.unshift(newRoom);
720
  renderRooms();
721
  closeModal();
722
  showToast('اتاق جدید ایجاد شد');
723
  } else {
724
  newRoomInput.focus();
 
725
  }
726
  }
727
 
 
732
 
733
  if (isError) {
734
  icon.className = 'fa-solid fa-circle-exclamation';
735
+ icon.style.color = '#ff7675';
736
  } else {
737
  icon.className = 'fa-solid fa-check-circle';
738
+ icon.style.color = 'var(--accent-primary)';
739
  }
740
 
741
  toastEl.classList.add('show');
742
 
 
743
  setTimeout(() => {
744
  toastEl.classList.remove('show');
745
  }, 3000);
 
748
  // Run
749
  init();
750
 
751
+ </script>
752
  </body>
753
+
754
  </html>