samirerty commited on
Commit
cb16f34
·
verified ·
1 Parent(s): 747c061

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +682 -19
index.html CHANGED
@@ -1,19 +1,682 @@
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>Dark Glass Chat - Login</title>
7
+ <!-- Import Vazirmatn font for Persian typography -->
8
+ <link href="https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css" rel="stylesheet" type="text/css" />
9
+ <!-- Import FontAwesome for Icons -->
10
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
11
+
12
+ <style>
13
+ :root {
14
+ --primary-bg: #0f172a;
15
+ --glass-bg: rgba(255, 255, 255, 0.05);
16
+ --glass-border: rgba(255, 255, 255, 0.1);
17
+ --glass-highlight: rgba(255, 255, 255, 0.15);
18
+ --text-main: #f8fafc;
19
+ --text-muted: #94a3b8;
20
+ --accent-color: #818cf8; /* Soft Indigo/Pastel */
21
+ --accent-hover: #6366f1;
22
+ --gradient-1: #4f46e5;
23
+ --gradient-2: #ec4899;
24
+ --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
25
+ --transition-speed: 0.6s;
26
+ }
27
+
28
+ * {
29
+ box-sizing: border-box;
30
+ margin: 0;
31
+ padding: 0;
32
+ }
33
+
34
+ body {
35
+ font-family: 'Vazirmatn', sans-serif;
36
+ background: var(--primary-bg);
37
+ display: flex;
38
+ flex-direction: column;
39
+ align-items: center;
40
+ justify-content: center;
41
+ min-height: 100vh;
42
+ overflow: hidden; /* Prevent scroll bars during animation */
43
+ position: relative;
44
+ }
45
+
46
+ /* Background blobs for atmosphere */
47
+ .bg-blob {
48
+ position: absolute;
49
+ border-radius: 50%;
50
+ filter: blur(80px);
51
+ z-index: -1;
52
+ opacity: 0.4;
53
+ animation: float 10s infinite ease-in-out;
54
+ }
55
+
56
+ .blob-1 {
57
+ width: 300px;
58
+ height: 300px;
59
+ background: var(--gradient-1);
60
+ top: -50px;
61
+ left: -50px;
62
+ }
63
+
64
+ .blob-2 {
65
+ width: 250px;
66
+ height: 250px;
67
+ background: var(--gradient-2);
68
+ bottom: -50px;
69
+ right: -50px;
70
+ animation-delay: -5s;
71
+ }
72
+
73
+ @keyframes float {
74
+ 0%, 100% { transform: translate(0, 0); }
75
+ 50% { transform: translate(20px, 30px); }
76
+ }
77
+
78
+ /* --- Header Section --- */
79
+ .app-header {
80
+ position: absolute;
81
+ top: 20px;
82
+ width: 100%;
83
+ display: flex;
84
+ justify-content: space-between;
85
+ align-items: center;
86
+ padding: 0 40px;
87
+ z-index: 10;
88
+ }
89
+
90
+ .brand {
91
+ font-size: 1.2rem;
92
+ font-weight: 700;
93
+ color: var(--text-main);
94
+ display: flex;
95
+ align-items: center;
96
+ gap: 10px;
97
+ text-shadow: 0 0 10px rgba(255,255,255,0.3);
98
+ }
99
+
100
+ .brand i {
101
+ color: var(--accent-color);
102
+ }
103
+
104
+ .anycoder-link {
105
+ font-size: 0.85rem;
106
+ color: var(--text-muted);
107
+ text-decoration: none;
108
+ transition: color 0.3s;
109
+ background: rgba(255,255,255,0.03);
110
+ padding: 5px 12px;
111
+ border-radius: 20px;
112
+ border: 1px solid var(--glass-border);
113
+ }
114
+
115
+ .anycoder-link:hover {
116
+ color: var(--accent-color);
117
+ border-color: var(--accent-color);
118
+ }
119
+
120
+ /* --- Main Container (Glass Card) --- */
121
+ .container {
122
+ background: var(--glass-bg);
123
+ border-radius: 20px;
124
+ box-shadow: var(--shadow);
125
+ position: relative;
126
+ overflow: hidden;
127
+ width: 850px;
128
+ max-width: 100%;
129
+ min-height: 550px;
130
+ backdrop-filter: blur(20px);
131
+ -webkit-backdrop-filter: blur(20px);
132
+ border: 1px solid var(--glass-border);
133
+ }
134
+
135
+ /* Form Layout Logic */
136
+ .form-container {
137
+ position: absolute;
138
+ top: 0;
139
+ height: 100%;
140
+ transition: all var(--transition-speed) ease-in-out;
141
+ display: flex;
142
+ flex-direction: column;
143
+ align-items: center;
144
+ justify-content: center;
145
+ padding: 0 50px;
146
+ text-align: center;
147
+ }
148
+
149
+ /* Login Panel (Default) */
150
+ .sign-in-container {
151
+ left: 0;
152
+ width: 50%;
153
+ z-index: 2;
154
+ }
155
+
156
+ /* Register Panel (Hidden initially) */
157
+ .sign-up-container {
158
+ left: 0;
159
+ width: 50%;
160
+ opacity: 0;
161
+ z-index: 1;
162
+ }
163
+
164
+ /* Animation State: Active (Panel Switch) */
165
+ .container.right-panel-active .sign-in-container {
166
+ transform: translateX(100%);
167
+ opacity: 0;
168
+ z-index: 1;
169
+ }
170
+
171
+ .container.right-panel-active .sign-up-container {
172
+ transform: translateX(100%);
173
+ opacity: 1;
174
+ z-index: 5;
175
+ animation: show var(--transition-speed);
176
+ }
177
+
178
+ @keyframes show {
179
+ 0%, 49.99% { opacity: 0; z-index: 1; }
180
+ 50%, 100% { opacity: 1; z-index: 5; }
181
+ }
182
+
183
+ /* --- Overlay & Animation --- */
184
+ .overlay-container {
185
+ position: absolute;
186
+ top: 0;
187
+ left: 50%;
188
+ width: 50%;
189
+ height: 100%;
190
+ overflow: hidden;
191
+ transition: transform var(--transition-speed) ease-in-out;
192
+ z-index: 100;
193
+ }
194
+
195
+ .container.right-panel-active .overlay-container {
196
+ transform: translateX(-100%);
197
+ }
198
+
199
+ .overlay {
200
+ background: linear-gradient(to right, var(--gradient-2), var(--gradient-1));
201
+ background-repeat: no-repeat;
202
+ background-size: cover;
203
+ background-position: 0 0;
204
+ color: #ffffff;
205
+ position: relative;
206
+ left: -100%;
207
+ height: 100%;
208
+ width: 200%;
209
+ transform: translateX(0);
210
+ transition: transform var(--transition-speed) ease-in-out;
211
+ }
212
+
213
+ .container.right-panel-active .overlay {
214
+ transform: translateX(50%);
215
+ }
216
+
217
+ .overlay-panel {
218
+ position: absolute;
219
+ display: flex;
220
+ align-items: center;
221
+ justify-content: center;
222
+ flex-direction: column;
223
+ padding: 0 40px;
224
+ text-align: center;
225
+ top: 0;
226
+ height: 100%;
227
+ width: 50%;
228
+ transform: translateX(0);
229
+ transition: transform var(--transition-speed) ease-in-out;
230
+ }
231
+
232
+ .overlay-left {
233
+ transform: translateX(-20%);
234
+ }
235
+
236
+ .container.right-panel-active .overlay-left {
237
+ transform: translateX(0);
238
+ }
239
+
240
+ .overlay-right {
241
+ right: 0;
242
+ transform: translateX(0);
243
+ }
244
+
245
+ .container.right-panel-active .overlay-right {
246
+ transform: translateX(20%);
247
+ }
248
+
249
+ /* --- Typography & Elements --- */
250
+ h1 {
251
+ font-weight: 800;
252
+ margin-bottom: 10px;
253
+ color: var(--text-main);
254
+ }
255
+
256
+ p {
257
+ font-size: 0.9rem;
258
+ font-weight: 400;
259
+ line-height: 1.5;
260
+ letter-spacing: 0.5px;
261
+ margin: 20px 0 30px;
262
+ color: var(--text-muted);
263
+ }
264
+
265
+ .overlay p {
266
+ color: rgba(255, 255, 255, 0.9);
267
+ font-size: 1rem;
268
+ }
269
+
270
+ span {
271
+ font-size: 0.8rem;
272
+ color: var(--text-muted);
273
+ margin-bottom: 15px;
274
+ }
275
+
276
+ /* Social Icons (Optional decorative) */
277
+ .social-container {
278
+ margin: 15px 0;
279
+ }
280
+
281
+ .social-container a {
282
+ border: 1px solid var(--glass-border);
283
+ border-radius: 50%;
284
+ display: inline-flex;
285
+ justify-content: center;
286
+ align-items: center;
287
+ margin: 0 5px;
288
+ height: 40px;
289
+ width: 40px;
290
+ color: var(--text-main);
291
+ text-decoration: none;
292
+ transition: all 0.3s ease;
293
+ background: var(--glass-highlight);
294
+ }
295
+
296
+ .social-container a:hover {
297
+ background: var(--accent-color);
298
+ border-color: var(--accent-color);
299
+ transform: translateY(-3px);
300
+ }
301
+
302
+ /* Inputs */
303
+ .input-group {
304
+ position: relative;
305
+ width: 100%;
306
+ margin: 8px 0;
307
+ }
308
+
309
+ input {
310
+ background-color: rgba(255, 255, 255, 0.05);
311
+ border: 1px solid var(--glass-border);
312
+ padding: 12px 15px;
313
+ padding-right: 40px; /* Space for icon */
314
+ width: 100%;
315
+ border-radius: 8px;
316
+ outline: none;
317
+ color: var(--text-main);
318
+ font-family: 'Vazirmatn', sans-serif;
319
+ transition: all 0.3s;
320
+ }
321
+
322
+ input:focus {
323
+ background-color: rgba(255, 255, 255, 0.1);
324
+ border-color: var(--accent-color);
325
+ box-shadow: 0 0 10px rgba(129, 140, 248, 0.2);
326
+ }
327
+
328
+ .input-icon {
329
+ position: absolute;
330
+ right: 12px;
331
+ top: 50%;
332
+ transform: translateY(-50%);
333
+ color: var(--text-muted);
334
+ font-size: 0.9rem;
335
+ transition: color 0.3s;
336
+ }
337
+
338
+ input:focus + .input-icon {
339
+ color: var(--accent-color);
340
+ }
341
+
342
+ /* Buttons */
343
+ button.action-btn {
344
+ border-radius: 8px;
345
+ border: 1px solid transparent;
346
+ background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
347
+ color: #ffffff;
348
+ font-size: 0.9rem;
349
+ font-weight: 700;
350
+ padding: 12px 45px;
351
+ letter-spacing: 0.5px;
352
+ text-transform: uppercase;
353
+ transition: transform 80ms ease-in, box-shadow 0.3s;
354
+ cursor: pointer;
355
+ margin-top: 15px;
356
+ font-family: 'Vazirmatn', sans-serif;
357
+ }
358
+
359
+ button.action-btn:hover {
360
+ box-shadow: 0 0 15px rgba(236, 72, 153, 0.4);
361
+ transform: translateY(-2px);
362
+ }
363
+
364
+ button.action-btn:active {
365
+ transform: scale(0.95);
366
+ }
367
+
368
+ button.ghost {
369
+ background: transparent;
370
+ border-color: #ffffff;
371
+ border-radius: 8px;
372
+ color: #ffffff;
373
+ font-size: 0.9rem;
374
+ font-weight: 700;
375
+ padding: 12px 45px;
376
+ letter-spacing: 0.5px;
377
+ text-transform: uppercase;
378
+ cursor: pointer;
379
+ transition: all 0.3s;
380
+ font-family: 'Vazirmatn', sans-serif;
381
+ }
382
+
383
+ button.ghost:hover {
384
+ background: rgba(255, 255, 255, 0.2);
385
+ }
386
+
387
+ a.forgot-pass {
388
+ color: var(--text-muted);
389
+ font-size: 0.8rem;
390
+ text-decoration: none;
391
+ margin: 15px 0;
392
+ border-bottom: 1px dashed transparent;
393
+ }
394
+
395
+ a.forgot-pass:hover {
396
+ color: var(--accent-color);
397
+ border-bottom-color: var(--accent-color);
398
+ }
399
+
400
+ /* --- Toast Notification --- */
401
+ .toast-container {
402
+ position: fixed;
403
+ top: 80px;
404
+ left: 50%;
405
+ transform: translateX(-50%);
406
+ z-index: 1000;
407
+ pointer-events: none;
408
+ }
409
+
410
+ .toast {
411
+ background: rgba(15, 23, 42, 0.9);
412
+ backdrop-filter: blur(10px);
413
+ color: var(--text-main);
414
+ padding: 12px 24px;
415
+ border-radius: 8px;
416
+ margin-bottom: 10px;
417
+ box-shadow: 0 4px 12px rgba(0,0,0,0.3);
418
+ border: 1px solid var(--glass-border);
419
+ display: flex;
420
+ align-items: center;
421
+ gap: 10px;
422
+ opacity: 0;
423
+ transform: translateY(-20px);
424
+ transition: all 0.3s ease;
425
+ }
426
+
427
+ .toast.show {
428
+ opacity: 1;
429
+ transform: translateY(0);
430
+ }
431
+
432
+ .toast i {
433
+ color: var(--accent-color);
434
+ }
435
+
436
+ /* --- Responsive Design --- */
437
+ @media (max-width: 768px) {
438
+ .container {
439
+ width: 100%;
440
+ min-height: 600px;
441
+ border-radius: 0;
442
+ border: none;
443
+ }
444
+
445
+ .form-container {
446
+ width: 100%;
447
+ padding: 0 20px;
448
+ }
449
+
450
+ /* On mobile, we hide the overlay and just use simple visibility toggles or transitions */
451
+ .overlay-container {
452
+ display: none;
453
+ }
454
+
455
+ .sign-in-container, .sign-up-container {
456
+ position: relative;
457
+ width: 100%;
458
+ height: auto;
459
+ padding: 40px 20px;
460
+ opacity: 1;
461
+ z-index: 1;
462
+ transform: none !important;
463
+ }
464
+
465
+ .sign-up-container {
466
+ display: none;
467
+ }
468
+
469
+ .mobile-toggle {
470
+ display: block;
471
+ margin-top: 20px;
472
+ color: var(--accent-color);
473
+ cursor: pointer;
474
+ font-size: 0.9rem;
475
+ text-decoration: underline;
476
+ }
477
+
478
+ /* Logic for mobile visibility handled by JS classes */
479
+ .container.mobile-register-mode .sign-in-container {
480
+ display: none;
481
+ }
482
+ .container.mobile-register-mode .sign-up-container {
483
+ display: flex;
484
+ }
485
+
486
+ .app-header {
487
+ padding: 0 20px;
488
+ }
489
+ }
490
+
491
+ @media (min-width: 769px) {
492
+ .mobile-toggle {
493
+ display: none;
494
+ }
495
+ }
496
+ </style>
497
+ </head>
498
+ <body>
499
+
500
+ <!-- Background Decoration -->
501
+ <div class="bg-blob blob-1"></div>
502
+ <div class="bg-blob blob-2"></div>
503
+
504
+ <!-- Header -->
505
+ <header class="app-header">
506
+ <div class="brand">
507
+ <i class="fa-solid fa-paper-plane"></i>
508
+ <span>ChatGlass</span>
509
+ </div>
510
+ <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="anycoder-link">
511
+ Built with anycoder
512
+ </a>
513
+ </header>
514
+
515
+ <!-- Main Container -->
516
+ <main class="container" id="container">
517
+
518
+ <!-- Register Form Panel -->
519
+ <div class="form-container sign-up-container">
520
+ <form id="registerForm">
521
+ <h1>ثبت‌نام</h1>
522
+ <div class="social-container">
523
+ <a href="#" class="social"><i class="fab fa-google"></i></a>
524
+ <a href="#" class="social"><i class="fab fa-github"></i></a>
525
+ </div>
526
+ <span>یا از ایمیل خود برای ثبت نام استفاده کنید</span>
527
+
528
+ <div class="input-group">
529
+ <input type="text" placeholder="نام کامل" required />
530
+ <i class="fa-solid fa-user input-icon"></i>
531
+ </div>
532
+
533
+ <div class="input-group">
534
+ <input type="email" placeholder="ایمیل" required />
535
+ <i class="fa-solid fa-envelope input-icon"></i>
536
+ </div>
537
+
538
+ <div class="input-group">
539
+ <input type="password" placeholder="رمز عبور" required />
540
+ <i class="fa-solid fa-lock input-icon"></i>
541
+ </div>
542
+
543
+ <button type="submit" class="action-btn">ثبت‌نام</button>
544
+ <div class="mobile-toggle" id="toLoginMobile">قبلاً ثبت‌نام کرده‌اید؟ ورود</div>
545
+ </form>
546
+ </div>
547
+
548
+ <!-- Login Form Panel -->
549
+ <div class="form-container sign-in-container">
550
+ <form id="loginForm">
551
+ <h1>ورود</h1>
552
+ <div class="social-container">
553
+ <a href="#" class="social"><i class="fab fa-google"></i></a>
554
+ <a href="#" class="social"><i class="fab fa-github"></i></a>
555
+ </div>
556
+ <span>یا از حساب کاربری خود استفاده کنید</span>
557
+
558
+ <div class="input-group">
559
+ <input type="email" placeholder="ایمیل" required />
560
+ <i class="fa-solid fa-envelope input-icon"></i>
561
+ </div>
562
+
563
+ <div class="input-group">
564
+ <input type="password" placeholder="رمز عبور" required />
565
+ <i class="fa-solid fa-lock input-icon"></i>
566
+ </div>
567
+
568
+ <a href="#" class="forgot-pass">رمز عبور خود را فراموش کرده‌اید؟</a>
569
+ <button type="submit" class="action-btn">ورود</button>
570
+ <div class="mobile-toggle" id="toRegisterMobile">حساب ندارید؟ ثبت‌نام</div>
571
+ </form>
572
+ </div>
573
+
574
+ <!-- Overlay Container (Sliding Panel) -->
575
+ <div class="overlay-container">
576
+ <div class="overlay">
577
+ <!-- Left Panel (Visible when in Register mode) -->
578
+ <div class="overlay-panel overlay-left">
579
+ <h1>خوش آمدید!</h1>
580
+ <p>اگر قبلاً حساب کاربری ساخته‌اید، لطفاً وارد شوید تا با دوستان خود گفتگو کنید.</p>
581
+ <button class="ghost" id="signIn">ورود</button>
582
+ </div>
583
+ <!-- Right Panel (Visible when in Login mode) -->
584
+ <div class="overlay-panel overlay-right">
585
+ <h1>سلام دوست من!</h1>
586
+ <p>اطلاعات شخصی خود را وارد کنید و سفر خود را در دنیای چت شروع کنید.</p>
587
+ <button class="ghost" id="signUp">ثبت‌نام</button>
588
+ </div>
589
+ </div>
590
+ </div>
591
+ </main>
592
+
593
+ <!-- Toast Notification Container -->
594
+ <div class="toast-container" id="toastContainer"></div>
595
+
596
+ <script>
597
+ // DOM Elements
598
+ const container = document.getElementById('container');
599
+ const signUpBtn = document.getElementById('signUp');
600
+ const signInBtn = document.getElementById('signIn');
601
+ const toLoginMobile = document.getElementById('toLoginMobile');
602
+ const toRegisterMobile = document.getElementById('toRegisterMobile');
603
+
604
+ const loginForm = document.getElementById('loginForm');
605
+ const registerForm = document.getElementById('registerForm');
606
+
607
+ // Desktop Switch Logic
608
+ signUpBtn.addEventListener('click', () => {
609
+ container.classList.add("right-panel-active");
610
+ });
611
+
612
+ signInBtn.addEventListener('click', () => {
613
+ container.classList.remove("right-panel-active");
614
+ });
615
+
616
+ // Mobile Switch Logic
617
+ toRegisterMobile.addEventListener('click', () => {
618
+ container.classList.add("mobile-register-mode");
619
+ });
620
+
621
+ toLoginMobile.addEventListener('click', () => {
622
+ container.classList.remove("mobile-register-mode");
623
+ });
624
+
625
+ // Form Handling with Toast Notification
626
+ function showToast(message, type = 'success') {
627
+ const toastContainer = document.getElementById('toastContainer');
628
+ const toast = document.createElement('div');
629
+ toast.className = 'toast';
630
+
631
+ const icon = type === 'success' ? '<i class="fa-solid fa-check-circle"></i>' : '<i class="fa-solid fa-exclamation-circle"></i>';
632
+
633
+ toast.innerHTML = `${icon} <span>${message}</span>`;
634
+
635
+ toastContainer.appendChild(toast);
636
+
637
+ // Trigger animation
638
+ setTimeout(() => toast.classList.add('show'), 100);
639
+
640
+ // Remove after 3 seconds
641
+ setTimeout(() => {
642
+ toast.classList.remove('show');
643
+ setTimeout(() => toast.remove(), 300);
644
+ }, 3000);
645
+ }
646
+
647
+ loginForm.addEventListener('submit', (e) => {
648
+ e.preventDefault();
649
+ // Simulate login process
650
+ const email = loginForm.querySelector('input[type="email"]').value;
651
+ showToast(`خوش آمدید! شما با ایمیل ${email} وارد شدید.`);
652
+ });
653
+
654
+ registerForm.addEventListener('submit', (e) => {
655
+ e.preventDefault();
656
+ // Simulate registration process
657
+ showToast('ثبت‌نام با موفقیت انجام شد. خوش آمدید!');
658
+
659
+ // Switch to login after a short delay for better UX
660
+ setTimeout(() => {
661
+ if (window.innerWidth > 768) {
662
+ container.classList.remove("right-panel-active");
663
+ } else {
664
+ container.classList.remove("mobile-register-mode");
665
+ }
666
+ }, 1500);
667
+ });
668
+
669
+ // Add subtle input animation focus effect via JS (optional enhancement)
670
+ const inputs = document.querySelectorAll('input');
671
+ inputs.forEach(input => {
672
+ input.addEventListener('focus', () => {
673
+ input.parentElement.style.transform = 'scale(1.02)';
674
+ input.parentElement.style.transition = 'transform 0.3s ease';
675
+ });
676
+ input.addEventListener('blur', () => {
677
+ input.parentElement.style.transform = 'scale(1)';
678
+ });
679
+ });
680
+ </script>
681
+ </body>
682
+ </html>