12wqhh commited on
Commit
5a8a569
·
verified ·
1 Parent(s): a229c17

Add 1 files

Browse files
Files changed (1) hide show
  1. index.html +513 -661
index.html CHANGED
@@ -3,7 +3,7 @@
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>نظام التسجيل | توتير</title>
7
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
8
  <style>
9
  * {
@@ -18,216 +18,144 @@
18
  color: #262626;
19
  }
20
 
21
- /* Authentication Pages Styles */
22
- .auth-container {
23
- display: flex;
24
- justify-content: center;
25
- align-items: center;
26
- min-height: 100vh;
27
- }
28
-
29
- .auth-box-container {
30
  display: flex;
31
- flex-direction: column;
32
  align-items: center;
33
- width: 100%;
34
- max-width: 350px;
35
- margin: 0 auto;
36
- }
37
-
38
- .auth-box {
39
  background-color: white;
40
- border: 1px solid #dbdbdb;
41
- border-radius: 8px;
42
- padding: 20px;
43
- width: 100%;
44
- margin-bottom: 10px;
45
- text-align: center;
46
  }
47
 
48
- .logo {
49
- font-size: 28px;
50
  font-weight: 300;
51
- margin: 20px 0;
52
  }
53
 
54
- .auth-form {
55
  display: flex;
56
- flex-direction: column;
57
- gap: 6px;
58
- margin-bottom: 15px;
59
- }
60
-
61
- .input-group {
62
- position: relative;
63
- }
64
-
65
- .input-group input {
66
- width: 100%;
67
- padding: 10px;
68
- background-color: #fafafa;
69
- border: 1px solid #dbdbdb;
70
- border-radius: 4px;
71
- font-size: 14px;
72
- direction: ltr;
73
  }
74
 
75
- .input-group input:focus {
76
- border-color: #a8a8a8;
77
- outline: none;
78
  }
79
 
80
- .input-group label {
81
- position: absolute;
82
- right: 10px;
83
- top: 50%;
84
- transform: translateY(-50%);
85
- color: #8e8e8e;
86
- font-size: 12px;
87
- transition: all 0.2s;
88
- cursor: text;
89
  }
90
 
91
- .input-group input:focus + label,
92
- .input-group input:not(:placeholder-shown) + label {
93
- top: 5px;
94
- transform: none;
95
- font-size: 10px;
96
  }
97
 
98
- .btn {
99
- width: 100%;
100
- padding: 8px;
101
- border: none;
102
- border-radius: 4px;
103
- font-weight: bold;
 
104
  cursor: pointer;
105
- margin-top: 10px;
106
  }
107
 
108
- .btn-primary {
 
 
 
109
  background-color: #0095f6;
110
  color: white;
111
- }
112
-
113
- .btn-primary:disabled {
114
- background-color: rgba(0, 149, 246, 0.3);
115
- cursor: default;
116
- }
117
-
118
- .divider {
119
  display: flex;
120
  align-items: center;
121
- margin: 15px 0;
122
- color: #8e8e8e;
123
- font-size: 13px;
124
- font-weight: bold;
125
  }
126
 
127
- .divider::before,
128
- .divider::after {
129
- content: "";
130
- flex: 1;
131
- height: 1px;
132
- background-color: #dbdbdb;
133
- margin: 0 10px;
134
  }
135
 
136
- .btn-google {
137
  display: flex;
 
138
  align-items: center;
139
- justify-content: center;
140
- gap: 8px;
141
- background-color: white;
142
- border: 1px solid #dbdbdb;
143
- color: #262626;
144
  }
145
 
146
- .btn-google img {
147
- width: 16px;
148
- height: 16px;
149
  }
150
 
151
- .auth-footer {
152
- text-align: center;
153
  font-size: 14px;
154
- margin-top: 20px;
155
  }
156
 
157
- .auth-footer a {
158
- color: #0095f6;
159
- font-weight: bold;
160
- text-decoration: none;
161
  }
162
 
163
- .error-message {
164
- color: #ed4956;
165
- font-size: 12px;
166
- margin-top: 5px;
167
- display: none;
168
  }
169
 
170
- .password-toggle {
171
- position: absolute;
172
- left: 10px;
173
- top: 50%;
174
- transform: translateY(-50%);
175
- cursor: pointer;
176
  color: #8e8e8e;
177
- font-size: 12px;
178
  }
179
 
180
- .terms {
181
- font-size: 12px;
182
- color: #8e8e8e;
183
- margin: 15px 0;
184
  line-height: 1.4;
185
  }
186
 
187
- .terms a {
188
- color: #262626;
189
- font-weight: bold;
190
  text-decoration: none;
 
191
  }
192
 
193
- /* Feed Page Styles (Hidden by default) */
194
- .feed-container {
195
- display: none;
196
- max-width: 600px;
197
- margin: 0 auto;
198
- padding: 20px;
199
- }
200
-
201
- .header {
202
- display: flex;
203
- justify-content: space-between;
204
- align-items: center;
205
- padding: 10px 0;
206
- border-bottom: 1px solid #dbdbdb;
207
- margin-bottom: 20px;
208
- }
209
-
210
- .header-logo {
211
- font-size: 24px;
212
- font-weight: 300;
213
- }
214
-
215
- .header-icons {
216
- display: flex;
217
- gap: 20px;
218
- }
219
-
220
- .header-icons i {
221
- font-size: 24px;
222
  cursor: pointer;
 
223
  }
224
 
 
225
  .stories {
226
  display: flex;
227
- gap: 10px;
228
- padding: 10px 0;
229
  margin-bottom: 20px;
230
  overflow-x: auto;
 
 
231
  }
232
 
233
  .story {
@@ -254,125 +182,106 @@
254
  object-fit: cover;
255
  }
256
 
 
 
 
 
 
 
 
 
 
 
 
 
257
  .story-username {
258
  font-size: 12px;
 
 
 
 
259
  }
260
 
261
- .posts {
 
262
  display: flex;
263
- flex-direction: column;
264
- gap: 20px;
 
 
265
  }
266
 
267
- .post {
268
- border: 1px solid #dbdbdb;
269
- border-radius: 8px;
270
- background-color: white;
 
 
271
  }
272
 
273
- .post-header {
274
- display: flex;
275
- justify-content: space-between;
276
- align-items: center;
277
- padding: 10px;
278
  }
279
 
280
- .post-user {
281
- display: flex;
282
- align-items: center;
283
- gap: 10px;
 
 
 
 
284
  }
285
 
286
- .post-user-avatar {
287
- width: 32px;
288
- height: 32px;
289
- border-radius: 50%;
290
- object-fit: cover;
291
  }
292
 
293
- .post-username {
294
- font-weight: bold;
295
- font-size: 14px;
 
 
 
296
  }
297
 
298
- .post-more {
 
 
299
  cursor: pointer;
300
  }
301
 
302
- .post-image {
303
  width: 100%;
304
- max-height: 600px;
305
  object-fit: cover;
306
  }
307
 
308
- .post-actions {
309
- display: flex;
310
- justify-content: space-between;
311
- padding: 10px;
 
 
 
 
 
 
 
 
312
  }
313
 
314
- .post-actions-left {
315
  display: flex;
316
- gap: 15px;
317
- }
318
-
319
- .post-actions i {
320
- font-size: 24px;
321
- cursor: pointer;
322
- }
323
-
324
- .post-likes {
325
- padding: 0 10px;
326
- font-weight: bold;
327
- font-size: 14px;
328
  }
329
 
330
- .post-caption {
331
- padding: 0 10px 10px;
332
- font-size: 14px;
333
- }
334
-
335
- .post-caption-username {
336
- font-weight: bold;
337
- margin-left: 5px;
338
- }
339
-
340
- .post-comments {
341
- padding: 0 10px;
342
- color: #8e8e8e;
343
- font-size: 14px;
344
- cursor: pointer;
345
- }
346
-
347
- .post-time {
348
- padding: 0 10px 10px;
349
- color: #8e8e8e;
350
- font-size: 10px;
351
- text-transform: uppercase;
352
- }
353
-
354
- .post-add-comment {
355
  display: flex;
356
- justify-content: space-between;
357
- padding: 10px;
358
- border-top: 1px solid #dbdbdb;
359
- }
360
-
361
- .post-comment-input {
362
- border: none;
363
- outline: none;
364
- width: 90%;
365
- font-size: 14px;
366
- }
367
-
368
- .post-comment-button {
369
- color: #0095f6;
370
- font-weight: bold;
371
- font-size: 14px;
372
- cursor: pointer;
373
- opacity: 0.5;
374
  }
375
 
 
376
  .bottom-nav {
377
  position: fixed;
378
  bottom: 0;
@@ -390,7 +299,7 @@
390
  cursor: pointer;
391
  }
392
 
393
- /* Create Post Modal */
394
  .modal {
395
  display: none;
396
  position: fixed;
@@ -408,8 +317,9 @@
408
  background-color: white;
409
  border-radius: 12px;
410
  width: 90%;
411
- max-width: 500px;
412
- overflow: hidden;
 
413
  }
414
 
415
  .modal-header {
@@ -418,45 +328,107 @@
418
  display: flex;
419
  justify-content: space-between;
420
  align-items: center;
 
421
  }
422
 
423
  .modal-title {
424
  font-weight: bold;
 
 
 
 
425
  }
426
 
427
- .modal-close, .modal-next {
428
  cursor: pointer;
 
429
  }
430
 
431
  .modal-close {
432
  color: #262626;
433
  }
434
 
435
- .modal-next {
436
  color: #0095f6;
437
  }
438
 
439
  .modal-body {
440
  padding: 20px;
441
- text-align: center;
442
  }
443
 
444
- .upload-icon {
445
- font-size: 50px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
446
  margin-bottom: 20px;
 
 
 
 
 
 
 
 
 
 
 
447
  color: #0095f6;
 
 
448
  }
449
 
450
- .upload-text {
451
- font-size: 22px;
452
- margin-bottom: 20px;
 
 
 
 
 
 
 
 
 
 
 
453
  }
454
 
455
- .upload-button {
 
 
 
 
 
 
456
  background-color: #0095f6;
457
  color: white;
458
  border: none;
459
- padding: 8px 12px;
460
  border-radius: 4px;
461
  font-weight: bold;
462
  cursor: pointer;
@@ -464,484 +436,364 @@
464
 
465
  /* Responsive */
466
  @media (max-width: 450px) {
467
- .auth-box {
468
- background-color: transparent;
469
- border: none;
 
 
 
 
 
470
  }
471
 
472
- .feed-container {
473
- padding: 0;
474
  }
475
  }
476
  </style>
477
  </head>
478
  <body>
479
- <!-- Authentication Container -->
480
- <div class="auth-container" id="authContainer">
481
- <div class="auth-box-container">
482
- <!-- Login Box -->
483
- <div class="auth-box" id="loginBox">
484
- <div class="logo">توتير</div>
485
- <form class="auth-form" id="loginForm">
486
- <div class="input-group">
487
- <input type="text" id="loginUsername" placeholder=" " required>
488
- <label for="loginUsername">اسم المستخدم أو البريد الإلكتروني</label>
489
- <div class="error-message" id="loginUsernameError"></div>
490
- </div>
491
- <div class="input-group">
492
- <input type="password" id="loginPassword" placeholder=" " required>
493
- <label for="loginPassword">كلمة المرور</label>
494
- <span class="password-toggle" onclick="togglePassword('loginPassword', this)">
495
- <i class="far fa-eye"></i>
496
- </span>
497
- <div class="error-message" id="loginPasswordError"></div>
498
- </div>
499
- <button type="submit" class="btn btn-primary" id="loginBtn">تسجيل الدخول</button>
500
- </form>
501
-
502
- <div class="divider">أو</div>
503
-
504
- <button class="btn btn-google" onclick="signInWithGoogle()">
505
- <img src="https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg" alt="Google">
506
- تسجيل الدخول باستخدام جوجل
507
- </button>
508
-
509
- <div class="auth-footer">
510
- <a href="#" id="forgotPasswordLink">نسيت كلمة المرور؟</a>
511
  </div>
512
  </div>
513
 
514
- <!-- Signup Box -->
515
- <div class="auth-box" id="signupBox" style="display: none;">
516
- <div class="logo">توتير</div>
517
- <form class="auth-form" id="signupForm">
518
- <div class="input-group">
519
- <input type="email" id="signupEmail" placeholder=" " required>
520
- <label for="signupEmail">البريد الإلكتروني</label>
521
- <div class="error-message" id="signupEmailError"></div>
522
- </div>
523
- <div class="input-group">
524
- <input type="text" id="signupUsername" placeholder=" " required>
525
- <label for="signupUsername">اسم المستخدم</label>
526
- <div class="error-message" id="signupUsernameError"></div>
527
- </div>
528
- <div class="input-group">
529
- <input type="password" id="signupPassword" placeholder=" " required>
530
- <label for="signupPassword">كلمة المرور</label>
531
- <span class="password-toggle" onclick="togglePassword('signupPassword', this)">
532
- <i class="far fa-eye"></i>
533
- </span>
534
- <div class="error-message" id="signupPasswordError"></div>
535
- </div>
536
- <div class="input-group">
537
- <input type="password" id="signupConfirmPassword" placeholder=" " required>
538
- <label for="signupConfirmPassword">تأكيد كلمة المرور</label>
539
- <span class="password-toggle" onclick="togglePassword('signupConfirmPassword', this)">
540
- <i class="far fa-eye"></i>
541
- </span>
542
- <div class="error-message" id="signupConfirmPasswordError"></div>
543
- </div>
544
-
545
- <div class="terms">
546
- عند التسجيل، فإنك توافق على <a href="#">الشروط</a> و<a href="#">سياسة الخصوصية</a> الخاصة بنا
547
- </div>
548
-
549
- <button type="submit" class="btn btn-primary" id="signupBtn">إنشاء حساب</button>
550
- </form>
551
-
552
- <div class="divider">أو</div>
553
-
554
- <button class="btn btn-google" onclick="signInWithGoogle()">
555
- <img src="https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg" alt="Google">
556
- التسجيل باستخدام جوجل
557
- </button>
558
- </div>
559
-
560
- <!-- Toggle between login and signup -->
561
- <div class="auth-box">
562
- <div class="auth-footer">
563
- <span id="toggleAuthText">ليس لديك حساب؟</span>
564
- <a href="#" id="toggleAuthLink">إنشاء حساب</a>
565
  </div>
566
  </div>
567
  </div>
568
- </div>
569
-
570
- <!-- Feed Container (Hidden by default) -->
571
- <div class="feed-container" id="feedContainer">
572
- <div class="header">
573
- <div class="header-logo">توتير</div>
574
- <div class="header-icons">
575
- <i class="far fa-heart"></i>
576
- <i class="far fa-paper-plane"></i>
577
- <i class="far fa-plus-square" onclick="showCreatePostModal()"></i>
578
  </div>
 
 
 
 
 
 
579
  </div>
580
 
581
- <div class="stories">
582
- <div class="story">
583
- <div class="story-avatar">
584
- <img src="https://randomuser.me/api/portraits/women/1.jpg" alt="User">
585
- </div>
586
- <div class="story-username">user1</div>
 
 
587
  </div>
588
- <div class="story">
589
- <div class="story-avatar">
590
- <img src="https://randomuser.me/api/portraits/men/1.jpg" alt="User">
591
- </div>
592
- <div class="story-username">user2</div>
593
  </div>
594
- <div class="story">
595
- <div class="story-avatar">
596
- <img src="https://randomuser.me/api/portraits/women/2.jpg" alt="User">
597
- </div>
598
- <div class="story-username">user3</div>
599
  </div>
600
- <div class="story">
601
- <div class="story-avatar">
602
- <img src="https://randomuser.me/api/portraits/men/2.jpg" alt="User">
603
- </div>
604
- <div class="story-username">user4</div>
605
  </div>
606
- <div class="story">
607
- <div class="story-avatar">
608
- <img src="https://randomuser.me/api/portraits/women/3.jpg" alt="User">
609
- </div>
610
- <div class="story-username">user5</div>
611
  </div>
 
612
  </div>
613
-
614
- <div class="posts">
615
- <div class="post">
616
- <div class="post-header">
617
- <div class="post-user">
618
- <img src="https://randomuser.me/api/portraits/women/1.jpg" alt="User" class="post-user-avatar">
619
- <div class="post-username">user1</div>
620
- </div>
621
- <div class="post-more">
622
- <i class="fas fa-ellipsis-h"></i>
623
- </div>
624
- </div>
625
- <img src="https://source.unsplash.com/random/600x600" alt="Post" class="post-image">
626
- <div class="post-actions">
627
- <div class="post-actions-left">
628
- <i class="far fa-heart"></i>
629
- <i class="far fa-comment"></i>
630
- <i class="far fa-paper-plane"></i>
631
- </div>
632
- <i class="far fa-bookmark"></i>
633
- </div>
634
- <div class="post-likes">1,234 إعجاب</div>
635
- <div class="post-caption">
636
- <span class="post-caption-username">user1</span>
637
- هذه صورة رائعة من رحلتي الأخيرة! #سفر #مغامرة
638
- </div>
639
- <div class="post-comments">عرض جميع التعليقات (42)</div>
640
- <div class="post-time">منذ ساعتين</div>
641
- <div class="post-add-comment">
642
- <input type="text" placeholder="أضف تعليقًا..." class="post-comment-input">
643
- <div class="post-comment-button">نشر</div>
 
644
  </div>
 
 
645
  </div>
646
-
647
- <div class="post">
648
- <div class="post-header">
649
- <div class="post-user">
650
- <img src="https://randomuser.me/api/portraits/men/1.jpg" alt="User" class="post-user-avatar">
651
- <div class="post-username">user2</div>
652
- </div>
653
- <div class="post-more">
654
- <i class="fas fa-ellipsis-h"></i>
655
- </div>
656
  </div>
657
- <img src="https://source.unsplash.com/random/600x600?nature" alt="Post" class="post-image">
658
- <div class="post-actions">
659
- <div class="post-actions-left">
660
- <i class="far fa-heart"></i>
661
- <i class="far fa-comment"></i>
662
- <i class="far fa-paper-plane"></i>
663
- </div>
664
- <i class="far fa-bookmark"></i>
 
665
  </div>
666
- <div class="post-likes">987 إعجاب</div>
667
- <div class="post-caption">
668
- <span class="post-caption-username">user2</span>
669
- جمال الطبيعة لا يوصف 🌿 #طبيعة #منظر
 
670
  </div>
671
- <div class="post-comments">عرض جميع التعليقات (23)</div>
672
- <div class="post-time">منذ 5 ساعات</div>
673
- <div class="post-add-comment">
674
- <input type="text" placeholder="أضف تعليقًا..." class="post-comment-input">
675
- <div class="post-comment-button">نشر</div>
676
  </div>
677
  </div>
678
  </div>
679
-
680
- <div class="bottom-nav">
681
- <i class="fas fa-home"></i>
682
- <i class="fas fa-search"></i>
683
- <i class="far fa-plus-square" onclick="showCreatePostModal()"></i>
684
- <i class="far fa-heart"></i>
685
- <i class="far fa-user"></i>
686
- </div>
687
  </div>
688
 
689
- <!-- Create Post Modal -->
690
- <div class="modal" id="createPostModal">
691
- <div class="modal-content">
692
  <div class="modal-header">
693
- <div class="modal-close" onclick="hideCreatePostModal()">
694
  <i class="fas fa-times"></i>
695
  </div>
696
- <div class="modal-title">إنشاء منشور جديد</div>
697
- <div class="modal-next" onclick="nextStep()">التالي</div>
698
  </div>
699
- <div class="modal-body">
700
- <div class="upload-icon">
701
- <i class="fas fa-cloud-upload-alt"></i>
702
- </div>
703
- <div class="upload-text">اسحب الصور والفيديوهات إلى هنا</div>
704
- <button class="upload-button" onclick="document.getElementById('fileInput').click()">اختر من الجهاز</button>
705
- <input type="file" id="fileInput" style="display: none;" accept="image/*,video/*">
706
  </div>
 
 
707
  </div>
708
  </div>
709
 
710
  <script>
711
- // متغيرات حالة النظام
712
- let isLogin = true;
713
- let isLoggedIn = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
714
 
715
  // عناصر DOM
716
- const authContainer = document.getElementById('authContainer');
717
- const feedContainer = document.getElementById('feedContainer');
718
- const loginBox = document.getElementById('loginBox');
719
- const signupBox = document.getElementById('signupBox');
720
- const toggleAuthText = document.getElementById('toggleAuthText');
721
- const toggleAuthLink = document.getElementById('toggleAuthLink');
722
- const loginForm = document.getElementById('loginForm');
723
- const signupForm = document.getElementById('signupForm');
724
- const createPostModal = document.getElementById('createPostModal');
725
-
726
- // تبديل بين تسجيل الدخول وإنشاء حساب
727
- function toggleAuth() {
728
- isLogin = !isLogin;
 
 
 
 
729
 
730
- if (isLogin) {
731
- loginBox.style.display = 'block';
732
- signupBox.style.display = 'none';
733
- toggleAuthText.textContent = 'ليس لديك حساب؟';
734
- toggleAuthLink.textContent = 'إنشاء حساب';
735
- } else {
736
- loginBox.style.display = 'none';
737
- signupBox.style.display = 'block';
738
- toggleAuthText.textContent = 'لديك حساب بالفعل؟';
739
- toggleAuthLink.textContent = 'تسجيل الدخول';
740
- }
741
  }
742
 
743
- // إظهار/إخفاء كلمة المرور
744
- function togglePassword(inputId, toggleElement) {
745
- const input = document.getElementById(inputId);
746
- const icon = toggleElement.querySelector('i');
747
 
748
- if (input.type === 'password') {
749
- input.type = 'text';
750
- icon.classList.remove('fa-eye');
751
- icon.classList.add('fa-eye-slash');
752
- } else {
753
- input.type = 'password';
754
- icon.classList.remove('fa-eye-slash');
755
- icon.classList.add('fa-eye');
756
- }
757
- }
758
-
759
- // تسجيل الدخول باستخدام جوجل (وهمي)
760
- function signInWithGoogle() {
761
- // في الواقع، هنا سيتم استخدام Firebase Authentication أو أي خدمة أخرى
762
- alert('جارٍ تحويلك إلى صفحة تسجيل الدخول باستخدام جوجل...');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
763
 
764
- // محاكاة تسجيل الدخول الناجح بعد تأخير
765
- setTimeout(() => {
766
- showFeedPage();
767
- }, 1000);
768
  }
769
 
770
- // التحقق من صحة نموذج تسجيل الدخول
771
- function validateLoginForm() {
772
- let isValid = true;
773
- const username = document.getElementById('loginUsername').value.trim();
774
- const password = document.getElementById('loginPassword').value;
775
-
776
- // إعادة تعيين رسائل الخطأ
777
- document.getElementById('loginUsernameError').style.display = 'none';
778
- document.getElementById('loginPasswordError').style.display = 'none';
779
-
780
- // التحقق من اسم المستخدم
781
- if (username === '') {
782
- document.getElementById('loginUsernameError').textContent = 'يرجى إدخال اسم المستخدم أو البريد الإلكتروني';
783
- document.getElementById('loginUsernameError').style.display = 'block';
784
- isValid = false;
785
- }
786
-
787
- // التحقق من كلمة المرور
788
- if (password === '') {
789
- document.getElementById('loginPasswordError').textContent = 'يرجى إدخال كلمة المرور';
790
- document.getElementById('loginPasswordError').style.display = 'block';
791
- isValid = false;
792
- } else if (password.length < 6) {
793
- document.getElementById('loginPasswordError').textContent = 'يجب أن تحتوي كلمة المرور على 6 أحرف على الأقل';
794
- document.getElementById('loginPasswordError').style.display = 'block';
795
- isValid = false;
796
- }
797
-
798
- return isValid;
799
  }
800
 
801
- // التحقق من صحة نموذج إنشاء حساب
802
- function validateSignupForm() {
803
- let isValid = true;
804
- const email = document.getElementById('signupEmail').value.trim();
805
- const username = document.getElementById('signupUsername').value.trim();
806
- const password = document.getElementById('signupPassword').value;
807
- const confirmPassword = document.getElementById('signupConfirmPassword').value;
808
-
809
- // إعادة تعيين رسائل الخطأ
810
- document.getElementById('signupEmailError').style.display = 'none';
811
- document.getElementById('signupUsernameError').style.display = 'none';
812
- document.getElementById('signupPasswordError').style.display = 'none';
813
- document.getElementById('signupConfirmPasswordError').style.display = 'none';
814
-
815
- // التحقق من البريد الإلكتروني
816
- if (email === '') {
817
- document.getElementById('signupEmailError').textContent = 'يرجى إدخال البريد الإلكتروني';
818
- document.getElementById('signupEmailError').style.display = 'block';
819
- isValid = false;
820
- } else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
821
- document.getElementById('signupEmailError').textContent = 'يرجى إدخال بريد إلكتروني صالح';
822
- document.getElementById('signupEmailError').style.display = 'block';
823
- isValid = false;
824
- }
825
 
826
- // التحقق من اسم المستخدم
827
- if (username === '') {
828
- document.getElementById('signupUsernameError').textContent = 'يرجى إدخال اسم المستخدم';
829
- document.getElementById('signupUsernameError').style.display = 'block';
830
- isValid = false;
831
- } else if (username.length < 3) {
832
- document.getElementById('signupUsernameError').textContent = 'يجب أن يحتوي اسم المستخدم على 3 أحرف على الأقل';
833
- document.getElementById('signupUsernameError').style.display = 'block';
834
- isValid = false;
835
- }
836
-
837
- // التحقق من كلمة المرور
838
- if (password === '') {
839
- document.getElementById('signupPasswordError').textContent = 'يرجى إدخال كلمة المرور';
840
- document.getElementById('signupPasswordError').style.display = 'block';
841
- isValid = false;
842
- } else if (password.length < 6) {
843
- document.getElementById('signupPasswordError').textContent = 'يجب أن تحتوي كلمة المرور على 6 أحرف على الأقل';
844
- document.getElementById('signupPasswordError').style.display = 'block';
845
- isValid = false;
846
- }
847
-
848
- // التحقق من تطابق كلمتي المرور
849
- if (confirmPassword === '') {
850
- document.getElementById('signupConfirmPasswordError').textContent = 'يرجى تأكيد كلمة المرور';
851
- document.getElementById('signupConfirmPasswordError').style.display = 'block';
852
- isValid = false;
853
- } else if (password !== confirmPassword) {
854
- document.getElementById('signupConfirmPasswordError').textContent = 'كلمتا المرور غير متطابقتين';
855
- document.getElementById('signupConfirmPasswordError').style.display = 'block';
856
- isValid = false;
857
- }
858
-
859
- return isValid;
860
- }
861
-
862
- // إرسال نموذج تسجيل الدخول
863
- function submitLoginForm(event) {
864
- event.preventDefault();
865
 
866
- if (validateLoginForm()) {
867
- // عرض رسالة تحميل
868
- const loginBtn = document.getElementById('loginBtn');
869
- const originalText = loginBtn.textContent;
870
- loginBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> جاري تسجيل الدخول...';
871
- loginBtn.disabled = true;
872
-
873
- // محاكاة اتصال بالخادم
874
- setTimeout(() => {
875
- showFeedPage();
876
- loginBtn.textContent = originalText;
877
- loginBtn.disabled = false;
878
- }, 1500);
879
- }
880
  }
881
 
882
- // إرسال نموذج إنشاء حساب
883
- function submitSignupForm(event) {
884
- event.preventDefault();
885
-
886
- if (validateSignupForm()) {
887
- // عرض رسالة تحميل
888
- const signupBtn = document.getElementById('signupBtn');
889
- const originalText = signupBtn.textContent;
890
- signupBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> جاري إنشاء الحساب...';
891
- signupBtn.disabled = true;
892
-
893
- // محاكاة اتصال بالخادم
894
- setTimeout(() => {
895
- showFeedPage();
896
- signupBtn.textContent = originalText;
897
- signupBtn.disabled = false;
898
- }, 2000);
899
- }
900
  }
901
 
902
- // عرض صفحة الفيد
903
- function showFeedPage() {
904
- authContainer.style.display = 'none';
905
- feedContainer.style.display = 'block';
906
- isLoggedIn = true;
907
  }
908
 
909
- // عرض نافذة إنشاء منشور
910
- function showCreatePostModal() {
911
- if (!isLoggedIn) return;
912
- createPostModal.style.display = 'flex';
913
  }
914
 
915
- // إخفاء نافذة إنشاء منشور
916
- function hideCreatePostModal() {
917
- createPostModal.style.display = 'none';
918
  }
919
 
920
- // الخطوة التالية في إنشاء المنشور (وهمي)
921
- function nextStep() {
922
- alert('هذه الخطوة ستفتح نافذة لقص وتعديل الصورة قبل النشر');
 
923
  }
924
 
925
- // إضافة معالجي الأحداث
926
- toggleAuthLink.addEventListener('click', function(e) {
927
- e.preventDefault();
928
- toggleAuth();
929
- });
930
-
931
- document.getElementById('forgotPasswordLink').addEventListener('click', function(e) {
932
- e.preventDefault();
933
- alert('سيتم إرسال رابط إعادة تعيين كلمة المرور إلى بريدك الإلكتروني المسجل.');
 
 
 
 
 
 
 
934
  });
935
 
936
- loginForm.addEventListener('submit', submitLoginForm);
937
- signupForm.addEventListener('submit', submitSignupForm);
938
-
939
- // معالجة اختيار ملف للرفع
940
- document.getElementById('fileInput').addEventListener('change', function(e) {
941
  if (this.files && this.files[0]) {
942
- nextStep();
 
 
 
 
 
 
 
 
 
 
 
 
943
  }
944
  });
 
 
 
945
  </script>
946
  </body>
947
  </html>
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>الملف الشخصي | توتير</title>
7
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
8
  <style>
9
  * {
 
18
  color: #262626;
19
  }
20
 
21
+ /* Header Styles */
22
+ .header {
 
 
 
 
 
 
 
23
  display: flex;
24
+ justify-content: space-between;
25
  align-items: center;
26
+ padding: 10px 15px;
27
+ border-bottom: 1px solid #dbdbdb;
 
 
 
 
28
  background-color: white;
29
+ position: sticky;
30
+ top: 0;
31
+ z-index: 10;
 
 
 
32
  }
33
 
34
+ .header-logo {
35
+ font-size: 24px;
36
  font-weight: 300;
 
37
  }
38
 
39
+ .header-icons {
40
  display: flex;
41
+ gap: 20px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  }
43
 
44
+ .header-icons i {
45
+ font-size: 24px;
46
+ cursor: pointer;
47
  }
48
 
49
+ /* Profile Section */
50
+ .profile-container {
51
+ padding: 20px 15px;
52
+ background-color: white;
53
+ margin-bottom: 20px;
54
+ border-bottom: 1px solid #dbdbdb;
 
 
 
55
  }
56
 
57
+ .profile-header {
58
+ display: flex;
59
+ align-items: center;
60
+ margin-bottom: 20px;
 
61
  }
62
 
63
+ .profile-avatar {
64
+ width: 80px;
65
+ height: 80px;
66
+ border-radius: 50%;
67
+ object-fit: cover;
68
+ margin-left: 20px;
69
+ border: 2px solid #f8f8f8;
70
  cursor: pointer;
71
+ position: relative;
72
  }
73
 
74
+ .profile-avatar-edit {
75
+ position: absolute;
76
+ bottom: 0;
77
+ right: 0;
78
  background-color: #0095f6;
79
  color: white;
80
+ width: 25px;
81
+ height: 25px;
82
+ border-radius: 50%;
 
 
 
 
 
83
  display: flex;
84
  align-items: center;
85
+ justify-content: center;
86
+ font-size: 12px;
87
+ border: 2px solid white;
 
88
  }
89
 
90
+ .profile-stats {
91
+ display: flex;
92
+ flex-grow: 1;
93
+ justify-content: space-around;
 
 
 
94
  }
95
 
96
+ .stat-item {
97
  display: flex;
98
+ flex-direction: column;
99
  align-items: center;
 
 
 
 
 
100
  }
101
 
102
+ .stat-number {
103
+ font-weight: bold;
104
+ font-size: 18px;
105
  }
106
 
107
+ .stat-label {
 
108
  font-size: 14px;
109
+ color: #8e8e8e;
110
  }
111
 
112
+ .profile-info {
113
+ margin-bottom: 15px;
 
 
114
  }
115
 
116
+ .profile-name {
117
+ font-weight: bold;
118
+ margin-bottom: 5px;
119
+ display: flex;
120
+ align-items: center;
121
  }
122
 
123
+ .profile-username {
 
 
 
 
 
124
  color: #8e8e8e;
125
+ margin-bottom: 10px;
126
  }
127
 
128
+ .profile-bio {
129
+ margin-bottom: 10px;
 
 
130
  line-height: 1.4;
131
  }
132
 
133
+ .profile-website {
134
+ color: #00376b;
 
135
  text-decoration: none;
136
+ font-weight: bold;
137
  }
138
 
139
+ .edit-profile-btn {
140
+ width: 100%;
141
+ padding: 8px;
142
+ background-color: white;
143
+ border: 1px solid #dbdbdb;
144
+ border-radius: 4px;
145
+ font-weight: bold;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  cursor: pointer;
147
+ margin-top: 10px;
148
  }
149
 
150
+ /* Stories Section */
151
  .stories {
152
  display: flex;
153
+ gap: 15px;
154
+ padding: 15px 10px;
155
  margin-bottom: 20px;
156
  overflow-x: auto;
157
+ background-color: white;
158
+ border-bottom: 1px solid #dbdbdb;
159
  }
160
 
161
  .story {
 
182
  object-fit: cover;
183
  }
184
 
185
+ .story-add {
186
+ width: 70px;
187
+ height: 70px;
188
+ border-radius: 50%;
189
+ background-color: #f8f8f8;
190
+ display: flex;
191
+ align-items: center;
192
+ justify-content: center;
193
+ color: #0095f6;
194
+ font-size: 24px;
195
+ }
196
+
197
  .story-username {
198
  font-size: 12px;
199
+ max-width: 70px;
200
+ overflow: hidden;
201
+ text-overflow: ellipsis;
202
+ white-space: nowrap;
203
  }
204
 
205
+ /* Tabs Section */
206
+ .profile-tabs {
207
  display: flex;
208
+ justify-content: space-around;
209
+ background-color: white;
210
+ border-top: 1px solid #dbdbdb;
211
+ border-bottom: 1px solid #dbdbdb;
212
  }
213
 
214
+ .tab {
215
+ padding: 15px 0;
216
+ text-align: center;
217
+ flex: 1;
218
+ cursor: pointer;
219
+ position: relative;
220
  }
221
 
222
+ .tab.active {
223
+ font-weight: bold;
 
 
 
224
  }
225
 
226
+ .tab.active::after {
227
+ content: '';
228
+ position: absolute;
229
+ bottom: 0;
230
+ left: 0;
231
+ right: 0;
232
+ height: 1px;
233
+ background-color: #262626;
234
  }
235
 
236
+ .tab i {
237
+ font-size: 20px;
 
 
 
238
  }
239
 
240
+ /* Posts Grid */
241
+ .posts-grid {
242
+ display: grid;
243
+ grid-template-columns: repeat(3, 1fr);
244
+ gap: 2px;
245
+ margin-bottom: 50px;
246
  }
247
 
248
+ .post-thumbnail {
249
+ aspect-ratio: 1/1;
250
+ position: relative;
251
  cursor: pointer;
252
  }
253
 
254
+ .post-thumbnail img {
255
  width: 100%;
256
+ height: 100%;
257
  object-fit: cover;
258
  }
259
 
260
+ .post-thumbnail-overlay {
261
+ position: absolute;
262
+ top: 0;
263
+ left: 0;
264
+ right: 0;
265
+ bottom: 0;
266
+ background-color: rgba(0, 0, 0, 0.3);
267
+ display: none;
268
+ align-items: center;
269
+ justify-content: center;
270
+ color: white;
271
+ gap: 20px;
272
  }
273
 
274
+ .post-thumbnail:hover .post-thumbnail-overlay {
275
  display: flex;
 
 
 
 
 
 
 
 
 
 
 
 
276
  }
277
 
278
+ .post-thumbnail-stat {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
  display: flex;
280
+ align-items: center;
281
+ gap: 5px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282
  }
283
 
284
+ /* Bottom Navigation */
285
  .bottom-nav {
286
  position: fixed;
287
  bottom: 0;
 
299
  cursor: pointer;
300
  }
301
 
302
+ /* Edit Profile Modal */
303
  .modal {
304
  display: none;
305
  position: fixed;
 
317
  background-color: white;
318
  border-radius: 12px;
319
  width: 90%;
320
+ max-width: 400px;
321
+ max-height: 80vh;
322
+ overflow-y: auto;
323
  }
324
 
325
  .modal-header {
 
328
  display: flex;
329
  justify-content: space-between;
330
  align-items: center;
331
+ position: relative;
332
  }
333
 
334
  .modal-title {
335
  font-weight: bold;
336
+ position: absolute;
337
+ left: 0;
338
+ right: 0;
339
+ text-align: center;
340
  }
341
 
342
+ .modal-close, .modal-save {
343
  cursor: pointer;
344
+ z-index: 1;
345
  }
346
 
347
  .modal-close {
348
  color: #262626;
349
  }
350
 
351
+ .modal-save {
352
  color: #0095f6;
353
  }
354
 
355
  .modal-body {
356
  padding: 20px;
 
357
  }
358
 
359
+ .edit-form-group {
360
+ margin-bottom: 15px;
361
+ }
362
+
363
+ .edit-form-group label {
364
+ display: block;
365
+ margin-bottom: 5px;
366
+ font-size: 14px;
367
+ color: #262626;
368
+ font-weight: bold;
369
+ }
370
+
371
+ .edit-form-group input, .edit-form-group textarea {
372
+ width: 100%;
373
+ padding: 8px;
374
+ border: 1px solid #dbdbdb;
375
+ border-radius: 4px;
376
+ font-size: 14px;
377
+ }
378
+
379
+ .edit-form-group textarea {
380
+ resize: vertical;
381
+ min-height: 80px;
382
+ }
383
+
384
+ .avatar-edit-container {
385
+ display: flex;
386
+ flex-direction: column;
387
+ align-items: center;
388
  margin-bottom: 20px;
389
+ }
390
+
391
+ .avatar-preview {
392
+ width: 100px;
393
+ height: 100px;
394
+ border-radius: 50%;
395
+ object-fit: cover;
396
+ margin-bottom: 10px;
397
+ }
398
+
399
+ .change-avatar-btn {
400
  color: #0095f6;
401
+ font-weight: bold;
402
+ cursor: pointer;
403
  }
404
 
405
+ /* Create Story Modal */
406
+ .story-modal-content {
407
+ background-color: white;
408
+ border-radius: 12px;
409
+ width: 90%;
410
+ max-width: 400px;
411
+ overflow: hidden;
412
+ }
413
+
414
+ .story-modal-preview {
415
+ width: 100%;
416
+ max-height: 70vh;
417
+ object-fit: contain;
418
+ background-color: black;
419
  }
420
 
421
+ .story-modal-footer {
422
+ display: flex;
423
+ justify-content: center;
424
+ padding: 15px;
425
+ }
426
+
427
+ .story-post-btn {
428
  background-color: #0095f6;
429
  color: white;
430
  border: none;
431
+ padding: 8px 20px;
432
  border-radius: 4px;
433
  font-weight: bold;
434
  cursor: pointer;
 
436
 
437
  /* Responsive */
438
  @media (max-width: 450px) {
439
+ .profile-avatar {
440
+ width: 70px;
441
+ height: 70px;
442
+ margin-left: 10px;
443
+ }
444
+
445
+ .stat-number {
446
+ font-size: 16px;
447
  }
448
 
449
+ .stat-label {
450
+ font-size: 12px;
451
  }
452
  }
453
  </style>
454
  </head>
455
  <body>
456
+ <!-- Header -->
457
+ <div class="header">
458
+ <div class="header-logo">توتير</div>
459
+ <div class="header-icons">
460
+ <i class="far fa-heart"></i>
461
+ <i class="far fa-paper-plane"></i>
462
+ </div>
463
+ </div>
464
+
465
+ <!-- Profile Section -->
466
+ <div class="profile-container">
467
+ <div class="profile-header">
468
+ <div class="profile-avatar" onclick="showEditAvatarModal()">
469
+ <img src="https://randomuser.me/api/portraits/women/44.jpg" alt="Profile" id="profileAvatarImg">
470
+ <div class="profile-avatar-edit">
471
+ <i class="fas fa-camera"></i>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
472
  </div>
473
  </div>
474
 
475
+ <div class="profile-stats">
476
+ <div class="stat-item">
477
+ <div class="stat-number" id="postsCount">24</div>
478
+ <div class="stat-label">منشورات</div>
479
+ </div>
480
+ <div class="stat-item">
481
+ <div class="stat-number" id="followersCount">1.2K</div>
482
+ <div class="stat-label">متابعون</div>
483
+ </div>
484
+ <div class="stat-item">
485
+ <div class="stat-number" id="followingCount">340</div>
486
+ <div class="stat-label">متابَعون</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
487
  </div>
488
  </div>
489
  </div>
490
+
491
+ <div class="profile-info">
492
+ <div class="profile-name">
493
+ <span id="profileName">سارة أحمد</span>
 
 
 
 
 
 
494
  </div>
495
+ <div class="profile-username" id="profileUsername">@sara_ahmed</div>
496
+ <div class="profile-bio" id="profileBio">
497
+ مصممة جرافيك | محبة للسفر والتصوير | أعيش في دبي
498
+ 🌍✈️📷
499
+ </div>
500
+ <a href="#" class="profile-website" id="profileWebsite">www.sara-portfolio.com</a>
501
  </div>
502
 
503
+ <button class="edit-profile-btn" onclick="showEditProfileModal()">تعديل الملف الشخصي</button>
504
+ </div>
505
+
506
+ <!-- Stories Section -->
507
+ <div class="stories">
508
+ <div class="story" onclick="showCreateStoryModal()">
509
+ <div class="story-add">
510
+ <i class="fas fa-plus"></i>
511
  </div>
512
+ <div class="story-username">قصتك</div>
513
+ </div>
514
+ <div class="story">
515
+ <div class="story-avatar">
516
+ <img src="https://randomuser.me/api/portraits/women/1.jpg" alt="User">
517
  </div>
518
+ <div class="story-username">user1</div>
519
+ </div>
520
+ <div class="story">
521
+ <div class="story-avatar">
522
+ <img src="https://randomuser.me/api/portraits/men/1.jpg" alt="User">
523
  </div>
524
+ <div class="story-username">user2</div>
525
+ </div>
526
+ <div class="story">
527
+ <div class="story-avatar">
528
+ <img src="https://randomuser.me/api/portraits/women/2.jpg" alt="User">
529
  </div>
530
+ <div class="story-username">user3</div>
531
+ </div>
532
+ <div class="story">
533
+ <div class="story-avatar">
534
+ <img src="https://randomuser.me/api/portraits/men/2.jpg" alt="User">
535
  </div>
536
+ <div class="story-username">user4</div>
537
  </div>
538
+ </div>
539
+
540
+ <!-- Tabs Section -->
541
+ <div class="profile-tabs">
542
+ <div class="tab active">
543
+ <i class="fas fa-table-cells-large"></i>
544
+ </div>
545
+ <div class="tab">
546
+ <i class="fas fa-tag"></i>
547
+ </div>
548
+ </div>
549
+
550
+ <!-- Posts Grid -->
551
+ <div class="posts-grid" id="postsGrid">
552
+ <!-- سيتم ملء هذا القسم بالمنشورات ديناميكيًا -->
553
+ </div>
554
+
555
+ <!-- Bottom Navigation -->
556
+ <div class="bottom-nav">
557
+ <i class="fas fa-home"></i>
558
+ <i class="fas fa-search"></i>
559
+ <i class="far fa-plus-square"></i>
560
+ <i class="far fa-heart"></i>
561
+ <i class="fas fa-user"></i>
562
+ </div>
563
+
564
+ <!-- Edit Profile Modal -->
565
+ <div class="modal" id="editProfileModal">
566
+ <div class="modal-content">
567
+ <div class="modal-header">
568
+ <div class="modal-close" onclick="hideEditProfileModal()">
569
+ <i class="fas fa-times"></i>
570
  </div>
571
+ <div class="modal-title">تعديل الملف الشخصي</div>
572
+ <div class="modal-save" onclick="saveProfileChanges()">حفظ</div>
573
  </div>
574
+ <div class="modal-body">
575
+ <div class="avatar-edit-container">
576
+ <img src="https://randomuser.me/api/portraits/women/44.jpg" alt="Profile" class="avatar-preview" id="avatarPreview">
577
+ <div class="change-avatar-btn" onclick="changeProfilePicture()">تغيير الصورة الشخصية</div>
578
+ <input type="file" id="avatarUpload" accept="image/*" style="display: none;">
 
 
 
 
 
579
  </div>
580
+
581
+ <div class="edit-form-group">
582
+ <label for="editName">الاسم</label>
583
+ <input type="text" id="editName" value="سارة أحمد">
584
+ </div>
585
+
586
+ <div class="edit-form-group">
587
+ <label for="editUsername">اسم المستخدم</label>
588
+ <input type="text" id="editUsername" value="@sara_ahmed">
589
  </div>
590
+
591
+ <div class="edit-form-group">
592
+ <label for="editBio">البايو</label>
593
+ <textarea id="editBio">مصممة جرافيك | محبة للسفر والتصوير | أعيش في دبي
594
+ 🌍✈️📷</textarea>
595
  </div>
596
+
597
+ <div class="edit-form-group">
598
+ <label for="editWebsite">الموقع الإلكتروني</label>
599
+ <input type="text" id="editWebsite" value="www.sara-portfolio.com">
 
600
  </div>
601
  </div>
602
  </div>
 
 
 
 
 
 
 
 
603
  </div>
604
 
605
+ <!-- Create Story Modal -->
606
+ <div class="modal" id="createStoryModal">
607
+ <div class="modal-content story-modal-content">
608
  <div class="modal-header">
609
+ <div class="modal-close" onclick="hideCreateStoryModal()">
610
  <i class="fas fa-times"></i>
611
  </div>
612
+ <div class="modal-title">إنشاء قصة جديدة</div>
 
613
  </div>
614
+
615
+ <img src="" alt="Story Preview" class="story-modal-preview" id="storyPreview">
616
+
617
+ <div class="story-modal-footer">
618
+ <button class="story-post-btn" onclick="postStory()">نشر القصة</button>
 
 
619
  </div>
620
+
621
+ <input type="file" id="storyUpload" accept="image/*,video/*" style="display: none;">
622
  </div>
623
  </div>
624
 
625
  <script>
626
+ // بيانات المستخدم
627
+ const userProfile = {
628
+ name: "سار�� أحمد",
629
+ username: "@sara_ahmed",
630
+ bio: "مصممة جرافيك | محبة للسفر والتصوير | أعيش في دبي\n🌍✈️📷",
631
+ website: "www.sara-portfolio.com",
632
+ avatar: "https://randomuser.me/api/portraits/women/44.jpg",
633
+ postsCount: 24,
634
+ followersCount: "1.2K",
635
+ followingCount: 340,
636
+ posts: [
637
+ { id: 1, image: "https://source.unsplash.com/random/600x600?design", likes: 124, comments: 12 },
638
+ { id: 2, image: "https://source.unsplash.com/random/600x600?dubai", likes: 89, comments: 5 },
639
+ { id: 3, image: "https://source.unsplash.com/random/600x600?travel", likes: 156, comments: 23 },
640
+ { id: 4, image: "https://source.unsplash.com/random/600x600?photography", likes: 201, comments: 18 },
641
+ { id: 5, image: "https://source.unsplash.com/random/600x600?art", likes: 76, comments: 7 },
642
+ { id: 6, image: "https://source.unsplash.com/random/600x600?nature", likes: 312, comments: 42 },
643
+ { id: 7, image: "https://source.unsplash.com/random/600x600?beach", likes: 178, comments: 15 },
644
+ { id: 8, image: "https://source.unsplash.com/random/600x600?architecture", likes: 92, comments: 9 },
645
+ { id: 9, image: "https://source.unsplash.com/random/600x600?food", likes: 145, comments: 21 }
646
+ ]
647
+ };
648
 
649
  // عناصر DOM
650
+ const editProfileModal = document.getElementById('editProfileModal');
651
+ const createStoryModal = document.getElementById('createStoryModal');
652
+ const postsGrid = document.getElementById('postsGrid');
653
+ const avatarUpload = document.getElementById('avatarUpload');
654
+ const storyUpload = document.getElementById('storyUpload');
655
+
656
+ // تهيئة الصفحة
657
+ function initProfilePage() {
658
+ // عرض بيانات المستخدم
659
+ document.getElementById('profileName').textContent = userProfile.name;
660
+ document.getElementById('profileUsername').textContent = userProfile.username;
661
+ document.getElementById('profileBio').textContent = userProfile.bio;
662
+ document.getElementById('profileWebsite').textContent = userProfile.website;
663
+ document.getElementById('profileAvatarImg').src = userProfile.avatar;
664
+ document.getElementById('postsCount').textContent = userProfile.postsCount;
665
+ document.getElementById('followersCount').textContent = userProfile.followersCount;
666
+ document.getElementById('followingCount').textContent = userProfile.followingCount;
667
 
668
+ // عرض المنشورات
669
+ renderPosts();
 
 
 
 
 
 
 
 
 
670
  }
671
 
672
+ // عرض المنشورات في الشبكة
673
+ function renderPosts() {
674
+ postsGrid.innerHTML = '';
 
675
 
676
+ userProfile.posts.forEach(post => {
677
+ const postElement = document.createElement('div');
678
+ postElement.className = 'post-thumbnail';
679
+ postElement.innerHTML = `
680
+ <img src="${post.image}" alt="Post ${post.id}">
681
+ <div class="post-thumbnail-overlay">
682
+ <div class="post-thumbnail-stat">
683
+ <i class="fas fa-heart"></i>
684
+ <span>${post.likes}</span>
685
+ </div>
686
+ <div class="post-thumbnail-stat">
687
+ <i class="fas fa-comment"></i>
688
+ <span>${post.comments}</span>
689
+ </div>
690
+ </div>
691
+ `;
692
+
693
+ postsGrid.appendChild(postElement);
694
+ });
695
+ }
696
+
697
+ // عرض نافذة تعديل الملف الشخصي
698
+ function showEditProfileModal() {
699
+ // تعبئة البيانات الحالية في النموذج
700
+ document.getElementById('editName').value = userProfile.name;
701
+ document.getElementById('editUsername').value = userProfile.username;
702
+ document.getElementById('editBio').value = userProfile.bio;
703
+ document.getElementById('editWebsite').value = userProfile.website;
704
+ document.getElementById('avatarPreview').src = userProfile.avatar;
705
 
706
+ editProfileModal.style.display = 'flex';
 
 
 
707
  }
708
 
709
+ // إخفاء نافذة تعديل الملف الشخصي
710
+ function hideEditProfileModal() {
711
+ editProfileModal.style.display = 'none';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
712
  }
713
 
714
+ // حفظ التعديلات على الملف الشخصي
715
+ function saveProfileChanges() {
716
+ userProfile.name = document.getElementById('editName').value;
717
+ userProfile.username = document.getElementById('editUsername').value;
718
+ userProfile.bio = document.getElementById('editBio').value;
719
+ userProfile.website = document.getElementById('editWebsite').value;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
720
 
721
+ // تحديث واجهة المستخدم بالبيانات الجديدة
722
+ document.getElementById('profileName').textContent = userProfile.name;
723
+ document.getElementById('profileUsername').textContent = userProfile.username;
724
+ document.getElementById('profileBio').textContent = userProfile.bio;
725
+ document.getElementById('profileWebsite').textContent = userProfile.website;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
726
 
727
+ hideEditProfileModal();
 
 
 
 
 
 
 
 
 
 
 
 
 
728
  }
729
 
730
+ // تغيير الصورة الشخصية
731
+ function changeProfilePicture() {
732
+ avatarUpload.click();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
733
  }
734
 
735
+ // عرض نافذة تعديل الصورة الشخصية مباشرة
736
+ function showEditAvatarModal() {
737
+ showEditProfileModal();
738
+ changeProfilePicture();
 
739
  }
740
 
741
+ // عرض نافذة إنشاء قصة
742
+ function showCreateStoryModal() {
743
+ createStoryModal.style.display = 'flex';
744
+ storyUpload.click();
745
  }
746
 
747
+ // إخفاء نافذة إنشاء قصة
748
+ function hideCreateStoryModal() {
749
+ createStoryModal.style.display = 'none';
750
  }
751
 
752
+ // نشر القصة
753
+ function postStory() {
754
+ alert('تم نشر قصتك بنجاح!');
755
+ hideCreateStoryModal();
756
  }
757
 
758
+ // معالجة اختيار صورة جديدة للصورة الشخصية
759
+ avatarUpload.addEventListener('change', function(e) {
760
+ if (this.files && this.files[0]) {
761
+ const reader = new FileReader();
762
+
763
+ reader.onload = function(event) {
764
+ // تحديث الصورة في نافذة التعديل
765
+ document.getElementById('avatarPreview').src = event.target.result;
766
+
767
+ // تحديث الصورة في الملف الشخصي
768
+ userProfile.avatar = event.target.result;
769
+ document.getElementById('profileAvatarImg').src = event.target.result;
770
+ };
771
+
772
+ reader.readAsDataURL(this.files[0]);
773
+ }
774
  });
775
 
776
+ // معالجة اختيار صورة/فيديو للقصة
777
+ storyUpload.addEventListener('change', function(e) {
 
 
 
778
  if (this.files && this.files[0]) {
779
+ const file = this.files[0];
780
+ const reader = new FileReader();
781
+
782
+ reader.onload = function(event) {
783
+ document.getElementById('storyPreview').src = event.target.result;
784
+ };
785
+
786
+ if (file.type.includes('image')) {
787
+ reader.readAsDataURL(file);
788
+ } else if (file.type.includes('video')) {
789
+ // يمكنك هنا معالجة ملفات الفيديو إذا أردت
790
+ alert('تم اختيار فيديو للقصة');
791
+ }
792
  }
793
  });
794
+
795
+ // تهيئة الصفحة عند التحميل
796
+ window.addEventListener('DOMContentLoaded', initProfilePage);
797
  </script>
798
  </body>
799
  </html>