samirerty commited on
Commit
69a9ff0
·
verified ·
1 Parent(s): 33b9c5e

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +709 -19
index.html CHANGED
@@ -1,19 +1,709 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>تنظیمات حساب کاربری</title>
7
+
8
+ <!-- ایمپورت فونت وزیرمتن (Vazirmatn) -->
9
+ <link href="https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css" rel="stylesheet" type="text/css" />
10
+
11
+ <!-- ایمپورت آیکون‌ها (RemixIcon) -->
12
+ <link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
13
+
14
+ <style>
15
+ :root {
16
+ /* پالت رنگی */
17
+ --bg-color: #0f172a;
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.15);
21
+ --primary-color: #a78bfa; /* بنفش یاسی ملایم */
22
+ --primary-glow: rgba(167, 139, 250, 0.4);
23
+ --text-main: #f1f5f9;
24
+ --text-muted: #94a3b8;
25
+ --danger-bg: rgba(239, 68, 68, 0.1);
26
+ --danger-text: #fca5a5;
27
+ --danger-border: rgba(239, 68, 68, 0.3);
28
+ --success-color: #34d399;
29
+
30
+ /* تنظیمات فاصله و انیمیشن */
31
+ --radius-lg: 24px;
32
+ --radius-md: 16px;
33
+ --radius-sm: 12px;
34
+ --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
35
+ }
36
+
37
+ * {
38
+ margin: 0;
39
+ padding: 0;
40
+ box-sizing: border-box;
41
+ outline: none;
42
+ }
43
+
44
+ body {
45
+ font-family: 'Vazirmatn', sans-serif;
46
+ background-color: var(--bg-color);
47
+ color: var(--text-main);
48
+ min-height: 100vh;
49
+ display: flex;
50
+ justify-content: center;
51
+ align-items: center;
52
+ overflow-x: hidden;
53
+ position: relative;
54
+ }
55
+
56
+ /* --- پس‌زمینه متحرک و گرادینت‌ها --- */
57
+ .background-blobs {
58
+ position: fixed;
59
+ top: 0;
60
+ left: 0;
61
+ width: 100%;
62
+ height: 100%;
63
+ z-index: -1;
64
+ overflow: hidden;
65
+ pointer-events: none;
66
+ }
67
+
68
+ .blob {
69
+ position: absolute;
70
+ border-radius: 50%;
71
+ filter: blur(80px);
72
+ opacity: 0.6;
73
+ animation: float 10s infinite ease-in-out alternate;
74
+ }
75
+
76
+ .blob-1 {
77
+ top: -10%;
78
+ right: -10%;
79
+ width: 400px;
80
+ height: 400px;
81
+ background: #7c3aed;
82
+ animation-delay: 0s;
83
+ }
84
+
85
+ .blob-2 {
86
+ bottom: -10%;
87
+ left: -10%;
88
+ width: 350px;
89
+ height: 350px;
90
+ background: #4f46e5;
91
+ animation-delay: -5s;
92
+ }
93
+
94
+ .blob-3 {
95
+ top: 40%;
96
+ left: 30%;
97
+ width: 300px;
98
+ height: 300px;
99
+ background: #ec4899;
100
+ opacity: 0.4;
101
+ animation-delay: -2s;
102
+ }
103
+
104
+ @keyframes float {
105
+ 0% { transform: translate(0, 0) scale(1); }
106
+ 100% { transform: translate(30px, 50px) scale(1.1); }
107
+ }
108
+
109
+ /* --- کانتینر اصلی --- */
110
+ .container {
111
+ width: 100%;
112
+ max-width: 700px;
113
+ padding: 20px;
114
+ z-index: 1;
115
+ animation: fadeIn 0.8s ease-out;
116
+ }
117
+
118
+ @keyframes fadeIn {
119
+ from { opacity: 0; transform: translateY(20px); }
120
+ to { opacity: 1; transform: translateY(0); }
121
+ }
122
+
123
+ /* --- استایل‌های شیشه‌ای (Glassmorphism) --- */
124
+ .glass-card {
125
+ background: var(--glass-bg);
126
+ backdrop-filter: blur(20px);
127
+ -webkit-backdrop-filter: blur(20px);
128
+ border: 1px solid var(--glass-border);
129
+ border-radius: var(--radius-lg);
130
+ padding: 30px;
131
+ margin-bottom: 24px;
132
+ box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
133
+ transition: var(--transition);
134
+ }
135
+
136
+ .glass-card:hover {
137
+ border-color: rgba(255, 255, 255, 0.15);
138
+ box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.3);
139
+ transform: translateY(-2px);
140
+ }
141
+
142
+ /* --- هدر --- */
143
+ header {
144
+ text-align: center;
145
+ margin-bottom: 30px;
146
+ position: relative;
147
+ }
148
+
149
+ h1 {
150
+ font-size: 2rem;
151
+ font-weight: 800;
152
+ margin-bottom: 10px;
153
+ background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
154
+ -webkit-background-clip: text;
155
+ -webkit-text-fill-color: transparent;
156
+ display: inline-flex;
157
+ align-items: center;
158
+ gap: 10px;
159
+ }
160
+
161
+ .subtitle {
162
+ color: var(--text-muted);
163
+ font-size: 0.95rem;
164
+ font-weight: 300;
165
+ }
166
+
167
+ .anycoder-link {
168
+ position: absolute;
169
+ top: -20px;
170
+ left: 0;
171
+ font-size: 0.75rem;
172
+ color: var(--text-muted);
173
+ text-decoration: none;
174
+ opacity: 0.6;
175
+ transition: opacity 0.3s;
176
+ }
177
+ .anycoder-link:hover { opacity: 1; color: var(--primary-color); }
178
+
179
+ /* --- بخش پروفایل --- */
180
+ .profile-section {
181
+ display: flex;
182
+ flex-direction: column;
183
+ align-items: center;
184
+ text-align: center;
185
+ }
186
+
187
+ .avatar-container {
188
+ position: relative;
189
+ margin-bottom: 20px;
190
+ cursor: pointer;
191
+ group: hover;
192
+ }
193
+
194
+ .avatar {
195
+ width: 120px;
196
+ height: 120px;
197
+ border-radius: 50%;
198
+ object-fit: cover;
199
+ border: 3px solid var(--glass-border);
200
+ box-shadow: 0 0 20px var(--primary-glow);
201
+ transition: var(--transition);
202
+ }
203
+
204
+ .avatar-overlay {
205
+ position: absolute;
206
+ top: 0;
207
+ left: 0;
208
+ width: 100%;
209
+ height: 100%;
210
+ border-radius: 50%;
211
+ background: rgba(0, 0, 0, 0.5);
212
+ display: flex;
213
+ align-items: center;
214
+ justify-content: center;
215
+ opacity: 0;
216
+ transition: var(--transition);
217
+ color: white;
218
+ font-size: 1.5rem;
219
+ }
220
+
221
+ .avatar-container:hover .avatar {
222
+ transform: scale(1.05);
223
+ border-color: var(--primary-color);
224
+ }
225
+
226
+ .avatar-container:hover .avatar-overlay {
227
+ opacity: 1;
228
+ }
229
+
230
+ .btn-upload {
231
+ background: transparent;
232
+ border: 1px solid var(--primary-color);
233
+ color: var(--primary-color);
234
+ padding: 8px 16px;
235
+ border-radius: var(--radius-sm);
236
+ cursor: pointer;
237
+ font-family: inherit;
238
+ font-size: 0.9rem;
239
+ transition: var(--transition);
240
+ display: inline-flex;
241
+ align-items: center;
242
+ gap: 6px;
243
+ }
244
+
245
+ .btn-upload:hover {
246
+ background: var(--primary-color);
247
+ color: white;
248
+ box-shadow: 0 0 15px var(--primary-glow);
249
+ }
250
+
251
+ /* --- فرم اطلاعات --- */
252
+ .form-group {
253
+ margin-bottom: 20px;
254
+ }
255
+
256
+ .form-label {
257
+ display: block;
258
+ margin-bottom: 8px;
259
+ color: var(--text-muted);
260
+ font-size: 0.9rem;
261
+ }
262
+
263
+ .input-wrapper {
264
+ position: relative;
265
+ }
266
+
267
+ .form-input {
268
+ width: 100%;
269
+ background: rgba(0, 0, 0, 0.2);
270
+ border: 1px solid var(--glass-border);
271
+ border-radius: var(--radius-md);
272
+ padding: 14px 16px;
273
+ color: var(--text-main);
274
+ font-family: 'Vazirmatn', sans-serif;
275
+ font-size: 1rem;
276
+ transition: var(--transition);
277
+ }
278
+
279
+ .form-input:focus {
280
+ border-color: var(--primary-color);
281
+ box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
282
+ background: rgba(0, 0, 0, 0.3);
283
+ }
284
+
285
+ .form-input[readonly] {
286
+ cursor: default;
287
+ opacity: 0.7;
288
+ border-color: transparent;
289
+ }
290
+
291
+ .input-icon {
292
+ position: absolute;
293
+ right: 14px;
294
+ top: 50%;
295
+ transform: translateY(-50%);
296
+ color: var(--text-muted);
297
+ pointer-events: none;
298
+ }
299
+
300
+ .btn-save {
301
+ width: 100%;
302
+ padding: 14px;
303
+ background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
304
+ border: none;
305
+ border-radius: var(--radius-md);
306
+ color: white;
307
+ font-family: inherit;
308
+ font-size: 1rem;
309
+ font-weight: 700;
310
+ cursor: pointer;
311
+ transition: var(--transition);
312
+ margin-top: 10px;
313
+ display: flex;
314
+ justify-content: center;
315
+ align-items: center;
316
+ gap: 8px;
317
+ }
318
+
319
+ .btn-save:hover {
320
+ transform: translateY(-2px);
321
+ box-shadow: 0 8px 20px var(--primary-glow);
322
+ }
323
+
324
+ .btn-save:active {
325
+ transform: scale(0.98);
326
+ }
327
+
328
+ /* --- بخش امنیت --- */
329
+ .security-actions {
330
+ display: flex;
331
+ justify-content: space-between;
332
+ align-items: center;
333
+ }
334
+
335
+ .security-info h3 {
336
+ font-size: 1.1rem;
337
+ margin-bottom: 4px;
338
+ }
339
+
340
+ .security-info p {
341
+ font-size: 0.85rem;
342
+ color: var(--text-muted);
343
+ }
344
+
345
+ .btn-logout {
346
+ background: var(--danger-bg);
347
+ border: 1px solid var(--danger-border);
348
+ color: var(--danger-text);
349
+ padding: 10px 20px;
350
+ border-radius: var(--radius-md);
351
+ font-family: inherit;
352
+ cursor: pointer;
353
+ transition: var(--transition);
354
+ display: flex;
355
+ align-items: center;
356
+ gap: 8px;
357
+ }
358
+
359
+ .btn-logout:hover {
360
+ background: rgba(239, 68, 68, 0.2);
361
+ box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
362
+ }
363
+
364
+ /* --- Modal (شیشه‌ای) --- */
365
+ .modal-overlay {
366
+ position: fixed;
367
+ top: 0;
368
+ left: 0;
369
+ width: 100%;
370
+ height: 100%;
371
+ background: rgba(0, 0, 0, 0.6);
372
+ backdrop-filter: blur(8px);
373
+ z-index: 1000;
374
+ display: flex;
375
+ justify-content: center;
376
+ align-items: center;
377
+ opacity: 0;
378
+ visibility: hidden;
379
+ transition: var(--transition);
380
+ }
381
+
382
+ .modal-overlay.active {
383
+ opacity: 1;
384
+ visibility: visible;
385
+ }
386
+
387
+ .modal {
388
+ background: #1e1b4b; /* رنگ کمی تیره‌تر برای کنتراست */
389
+ border: 1px solid var(--glass-border);
390
+ border-radius: var(--radius-lg);
391
+ padding: 30px;
392
+ width: 90%;
393
+ max-width: 400px;
394
+ text-align: center;
395
+ transform: scale(0.9);
396
+ transition: var(--transition);
397
+ box-shadow: 0 20px 50px rgba(0,0,0,0.5);
398
+ }
399
+
400
+ .modal-overlay.active .modal {
401
+ transform: scale(1);
402
+ }
403
+
404
+ .modal-icon {
405
+ font-size: 3rem;
406
+ color: var(--danger-text);
407
+ margin-bottom: 15px;
408
+ }
409
+
410
+ .modal h3 {
411
+ margin-bottom: 10px;
412
+ font-size: 1.3rem;
413
+ }
414
+
415
+ .modal p {
416
+ color: var(--text-muted);
417
+ margin-bottom: 25px;
418
+ line-height: 1.6;
419
+ }
420
+
421
+ .modal-actions {
422
+ display: flex;
423
+ gap: 12px;
424
+ justify-content: center;
425
+ }
426
+
427
+ .btn-modal {
428
+ padding: 10px 24px;
429
+ border-radius: var(--radius-md);
430
+ font-family: inherit;
431
+ font-weight: 600;
432
+ cursor: pointer;
433
+ transition: var(--transition);
434
+ border: none;
435
+ flex: 1;
436
+ }
437
+
438
+ .btn-cancel {
439
+ background: rgba(255,255,255,0.05);
440
+ color: var(--text-main);
441
+ border: 1px solid var(--glass-border);
442
+ }
443
+
444
+ .btn-cancel:hover {
445
+ background: rgba(255,255,255,0.1);
446
+ }
447
+
448
+ .btn-confirm {
449
+ background: var(--danger-text);
450
+ color: #450a0a;
451
+ }
452
+
453
+ .btn-confirm:hover {
454
+ background: #f87171;
455
+ box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
456
+ }
457
+
458
+ /* --- Toast Notification --- */
459
+ .toast-container {
460
+ position: fixed;
461
+ bottom: 30px;
462
+ left: 50%;
463
+ transform: translateX(-50%);
464
+ z-index: 2000;
465
+ display: flex;
466
+ flex-direction: column;
467
+ gap: 10px;
468
+ }
469
+
470
+ .toast {
471
+ background: rgba(15, 23, 42, 0.9);
472
+ backdrop-filter: blur(12px);
473
+ border: 1px solid var(--glass-border);
474
+ color: white;
475
+ padding: 12px 24px;
476
+ border-radius: var(--radius-md);
477
+ display: flex;
478
+ align-items: center;
479
+ gap: 10px;
480
+ box-shadow: 0 10px 30px rgba(0,0,0,0.3);
481
+ animation: slideUp 0.3s ease-out forwards;
482
+ min-width: 300px;
483
+ }
484
+
485
+ .toast.success { border-right: 4px solid var(--success-color); }
486
+ .toast.error { border-right: 4px solid var(--danger-text); }
487
+
488
+ @keyframes slideUp {
489
+ from { opacity: 0; transform: translateY(20px); }
490
+ to { opacity: 1; transform: translateY(0); }
491
+ }
492
+
493
+ @keyframes fadeOut {
494
+ to { opacity: 0; transform: translateY(-10px); }
495
+ }
496
+
497
+ /* --- ریسپانسیو --- */
498
+ @media (max-width: 480px) {
499
+ .container {
500
+ padding: 15px;
501
+ }
502
+ h1 { font-size: 1.6rem; }
503
+ .glass-card { padding: 20px; }
504
+ .modal { padding: 20px; }
505
+ }
506
+ </style>
507
+ </head>
508
+ <body>
509
+
510
+ <!-- پس‌زمینه گرادینت متحرک -->
511
+ <div class="background-blobs">
512
+ <div class="blob blob-1"></div>
513
+ <div class="blob blob-2"></div>
514
+ <div class="blob blob-3"></div>
515
+ </div>
516
+
517
+ <div class="container">
518
+ <!-- هدر -->
519
+ <header>
520
+ <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="anycoder-link">
521
+ Built with anycoder
522
+ </a>
523
+ <h1>
524
+ <i class="ri-settings-4-line"></i>
525
+ تنظیمات حساب
526
+ </h1>
527
+ <p class="subtitle">مدیریت اطلاعات شخصی و امنیت حساب</p>
528
+ </header>
529
+
530
+ <main>
531
+ <!-- کارت پروفایل -->
532
+ <section class="glass-card profile-section">
533
+ <div class="avatar-container" onclick="document.getElementById('fileInput').click()">
534
+ <img src="https://picsum.photos/seed/user123/200/200" alt="Profile Avatar" class="avatar" id="avatarImg">
535
+ <div class="avatar-overlay">
536
+ <i class="ri-camera-lens-line"></i>
537
+ </div>
538
+ </div>
539
+ <input type="file" id="fileInput" accept="image/*" hidden>
540
+
541
+ <h2 style="margin-bottom: 5px;">کاربر مهمان</h2>
542
+ <p style="color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px;">توسعه‌دهنده وب</p>
543
+
544
+ <button class="btn-upload" onclick="document.getElementById('fileInput').click()">
545
+ <i class="ri-upload-cloud-2-line"></i>
546
+ تغییر تصویر پروفایل
547
+ </button>
548
+ </section>
549
+
550
+ <!-- کارت اطلاعات شخصی -->
551
+ <section class="glass-card">
552
+ <div class="form-group">
553
+ <label class="form-label" for="displayName">نام نمایشی</label>
554
+ <div class="input-wrapper">
555
+ <input type="text" id="displayName" class="form-input" value="کاربر مهمان" placeholder="نام خود را وارد کنید">
556
+ <i class="ri-user-line input-icon"></i>
557
+ </div>
558
+ </div>
559
+
560
+ <div class="form-group">
561
+ <label class="form-label" for="username">نام کاربری</label>
562
+ <div class="input-wrapper">
563
+ <input type="text" id="username" class="form-input" value="@guest_user" readonly>
564
+ <i class="ri-at-line input-icon"></i>
565
+ </div>
566
+ <p style="font-size: 0.75rem; color: var(--text-muted); margin-top: 5px;">
567
+ نام کاربری قابل تغییر نیست.
568
+ </p>
569
+ </div>
570
+
571
+ <button class="btn-save" id="saveBtn">
572
+ <i class="ri-save-3-line"></i>
573
+ ذخیره تغییرات
574
+ </button>
575
+ </section>
576
+
577
+ <!-- کارت امنیت -->
578
+ <section class="glass-card security-actions">
579
+ <div class="security-info">
580
+ <h3>خروج از حساب</h3>
581
+ <p>دسترسی به حساب را در این دستگاه مسدود کنید.</p>
582
+ </div>
583
+ <button class="btn-logout" id="logoutBtn">
584
+ <i class="ri-logout-box-r-line"></i>
585
+ خروج
586
+ </button>
587
+ </section>
588
+ </main>
589
+ </div>
590
+
591
+ <!-- مودال تایید خروج -->
592
+ <div class="modal-overlay" id="logoutModal">
593
+ <div class="modal">
594
+ <div class="modal-icon">
595
+ <i class="ri-error-warning-line"></i>
596
+ </div>
597
+ <h3>آیا مطمئن هستید؟</h3>
598
+ <p>با خروج از حساب، باید مجدداً برای دسترسی وارد شوید. این عملیات امنیت حساب شما را تضمین می‌کند.</p>
599
+ <div class="modal-actions">
600
+ <button class="btn-modal btn-cancel" id="cancelLogout">انصراف</button>
601
+ <button class="btn-modal btn-confirm" id="confirmLogout">خروج از حساب</button>
602
+ </div>
603
+ </div>
604
+ </div>
605
+
606
+ <!-- کانتینر Toast -->
607
+ <div class="toast-container" id="toastContainer"></div>
608
+
609
+ <script>
610
+ // --- انتخاب عناصر ---
611
+ const fileInput = document.getElementById('fileInput');
612
+ const avatarImg = document.getElementById('avatarImg');
613
+ const saveBtn = document.getElementById('saveBtn');
614
+ const displayNameInput = document.getElementById('displayName');
615
+ const logoutBtn = document.getElementById('logoutBtn');
616
+ const logoutModal = document.getElementById('logoutModal');
617
+ const cancelLogout = document.getElementById('cancelLogout');
618
+ const confirmLogout = document.getElementById('confirmLogout');
619
+ const toastContainer = document.getElementById('toastContainer');
620
+
621
+ // --- مدیریت آپلود تصویر ---
622
+ fileInput.addEventListener('change', function(e) {
623
+ const file = e.target.files[0];
624
+ if (file) {
625
+ const reader = new FileReader();
626
+ reader.onload = function(e) {
627
+ avatarImg.src = e.target.result;
628
+ showToast('تصویر پروفایل با موفقیت تغییر کرد', 'success');
629
+ }
630
+ reader.readAsDataURL(file);
631
+ }
632
+ });
633
+
634
+ // --- مدیریت ذخیره اطلاعات ---
635
+ saveBtn.addEventListener('click', function() {
636
+ const newName = displayNameInput.value.trim();
637
+
638
+ // شبیه‌سازی لودینگ
639
+ const originalText = saveBtn.innerHTML;
640
+ saveBtn.innerHTML = '<i class="ri-loader-4-line ri-spin"></i> در حال ذخیره...';
641
+ saveBtn.style.opacity = '0.7';
642
+ saveBtn.disabled = true;
643
+
644
+ setTimeout(() => {
645
+ saveBtn.innerHTML = originalText;
646
+ saveBtn.style.opacity = '1';
647
+ saveBtn.disabled = false;
648
+
649
+ if (newName.length < 3) {
650
+ showToast('نام نمایشی باید حداقل ۳ کاراکتر باشد', 'error');
651
+ } else {
652
+ showToast('تغییرات با موفقیت ذخیره شد', 'success');
653
+ }
654
+ }, 1200);
655
+ });
656
+
657
+ // --- مدیریت مودال خروج ---
658
+ logoutBtn.addEventListener('click', () => {
659
+ logoutModal.classList.add('active');
660
+ });
661
+
662
+ cancelLogout.addEventListener('click', () => {
663
+ logoutModal.classList.remove('active');
664
+ });
665
+
666
+ // بستن مودال با کلیک بیرون
667
+ logoutModal.addEventListener('click', (e) => {
668
+ if (e.target === logoutModal) {
669
+ logoutModal.classList.remove('active');
670
+ }
671
+ });
672
+
673
+ confirmLogout.addEventListener('click', () => {
674
+ showToast('در حال خروج از حساب...', 'success');
675
+ setTimeout(() => {
676
+ // اینجا می‌توان ریدایرکت کرد
677
+ logoutModal.classList.remove('active');
678
+ document.body.style.opacity = '0';
679
+ setTimeout(() => {
680
+ location.reload(); // شبیه‌سازی خروج کامل
681
+ }, 1000);
682
+ }, 1500);
683
+ });
684
+
685
+ // --- سیستم Toast Notification ---
686
+ function showToast(message, type = 'success') {
687
+ const toast = document.createElement('div');
688
+ toast.className = `toast ${type}`;
689
+
690
+ const icon = type === 'success' ? '<i class="ri-checkbox-circle-line"></i>' : '<i class="ri-close-circle-line"></i>';
691
+
692
+ toast.innerHTML = `
693
+ ${icon}
694
+ <span>${message}</span>
695
+ `;
696
+
697
+ toastContainer.appendChild(toast);
698
+
699
+ // حذف خودکار بعد از ۳ ثانیه
700
+ setTimeout(() => {
701
+ toast.style.animation = 'fadeOut 0.3s forwards';
702
+ toast.addEventListener('animationend', () => {
703
+ toast.remove();
704
+ });
705
+ }, 3000);
706
+ }
707
+ </script>
708
+ </body>
709
+ </html>