Add 1 files
Browse files- index.html +810 -557
index.html
CHANGED
|
@@ -3,37 +3,56 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title
|
| 7 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 8 |
<style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
* {
|
| 10 |
margin: 0;
|
| 11 |
padding: 0;
|
| 12 |
box-sizing: border-box;
|
| 13 |
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
|
|
|
| 14 |
}
|
| 15 |
|
| 16 |
body {
|
| 17 |
-
background-color:
|
| 18 |
-
color:
|
|
|
|
| 19 |
}
|
| 20 |
|
| 21 |
-
/* Header
|
| 22 |
.header {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
display: flex;
|
| 24 |
justify-content: space-between;
|
| 25 |
align-items: center;
|
| 26 |
-
padding:
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
top: 0;
|
| 31 |
-
z-index: 10;
|
| 32 |
}
|
| 33 |
|
| 34 |
.header-logo {
|
|
|
|
| 35 |
font-size: 24px;
|
| 36 |
-
font-weight:
|
|
|
|
| 37 |
}
|
| 38 |
|
| 39 |
.header-icons {
|
|
@@ -44,410 +63,322 @@
|
|
| 44 |
.header-icons i {
|
| 45 |
font-size: 24px;
|
| 46 |
cursor: pointer;
|
|
|
|
| 47 |
}
|
| 48 |
|
| 49 |
-
/*
|
| 50 |
-
.
|
| 51 |
-
|
| 52 |
-
background-color: white;
|
| 53 |
-
margin-bottom: 20px;
|
| 54 |
-
border-bottom: 1px solid #dbdbdb;
|
| 55 |
}
|
| 56 |
|
| 57 |
-
|
|
|
|
| 58 |
display: flex;
|
| 59 |
-
|
| 60 |
-
|
| 61 |
}
|
| 62 |
|
| 63 |
-
.
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
margin-left: 20px;
|
| 69 |
-
border: 2px solid #f8f8f8;
|
| 70 |
cursor: pointer;
|
| 71 |
position: relative;
|
|
|
|
| 72 |
}
|
| 73 |
|
| 74 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
position: absolute;
|
| 76 |
bottom: 0;
|
|
|
|
| 77 |
right: 0;
|
| 78 |
-
|
| 79 |
-
color:
|
| 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 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
}
|
| 101 |
-
|
| 102 |
-
.stat-number {
|
| 103 |
-
font-weight: bold;
|
| 104 |
-
font-size: 18px;
|
| 105 |
}
|
| 106 |
|
| 107 |
-
.
|
| 108 |
-
|
| 109 |
-
color: #8e8e8e;
|
| 110 |
}
|
| 111 |
|
| 112 |
-
|
|
|
|
|
|
|
|
|
|
| 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 |
-
.
|
| 124 |
-
color:
|
| 125 |
-
|
| 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 |
-
|
| 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 {
|
| 162 |
-
display: flex;
|
| 163 |
-
flex-direction: column;
|
| 164 |
align-items: center;
|
| 165 |
-
|
| 166 |
-
|
| 167 |
}
|
| 168 |
|
| 169 |
-
.
|
| 170 |
-
width:
|
| 171 |
-
height:
|
| 172 |
border-radius: 50%;
|
| 173 |
-
|
| 174 |
-
|
| 175 |
}
|
| 176 |
|
| 177 |
-
.
|
| 178 |
-
|
| 179 |
-
height: 100%;
|
| 180 |
-
border-radius: 50%;
|
| 181 |
-
border: 2px solid white;
|
| 182 |
-
object-fit: cover;
|
| 183 |
}
|
| 184 |
|
| 185 |
-
.
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 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 |
-
.
|
|
|
|
| 198 |
font-size: 12px;
|
| 199 |
-
max-width: 70px;
|
| 200 |
-
overflow: hidden;
|
| 201 |
-
text-overflow: ellipsis;
|
| 202 |
-
white-space: nowrap;
|
| 203 |
}
|
| 204 |
|
| 205 |
-
|
| 206 |
-
.profile-tabs {
|
| 207 |
display: flex;
|
| 208 |
-
|
| 209 |
-
background-color: white;
|
| 210 |
-
border-top: 1px solid #dbdbdb;
|
| 211 |
-
border-bottom: 1px solid #dbdbdb;
|
| 212 |
}
|
| 213 |
|
| 214 |
-
.
|
| 215 |
-
padding:
|
| 216 |
-
|
| 217 |
-
|
|
|
|
| 218 |
cursor: pointer;
|
| 219 |
-
|
| 220 |
-
}
|
| 221 |
-
|
| 222 |
-
.tab.active {
|
| 223 |
-
font-weight: bold;
|
| 224 |
}
|
| 225 |
|
| 226 |
-
.
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
bottom: 0;
|
| 230 |
-
left: 0;
|
| 231 |
-
right: 0;
|
| 232 |
-
height: 1px;
|
| 233 |
-
background-color: #262626;
|
| 234 |
}
|
| 235 |
|
| 236 |
-
.
|
| 237 |
-
|
|
|
|
|
|
|
| 238 |
}
|
| 239 |
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
grid-template-columns: repeat(3, 1fr);
|
| 244 |
-
gap: 2px;
|
| 245 |
-
margin-bottom: 50px;
|
| 246 |
}
|
| 247 |
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
|
|
|
|
|
|
|
|
|
| 251 |
cursor: pointer;
|
| 252 |
}
|
| 253 |
|
| 254 |
-
.
|
| 255 |
-
width:
|
| 256 |
-
height:
|
|
|
|
| 257 |
object-fit: cover;
|
|
|
|
| 258 |
}
|
| 259 |
|
| 260 |
-
.
|
| 261 |
-
|
| 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 |
-
.
|
| 275 |
display: flex;
|
|
|
|
|
|
|
| 276 |
}
|
| 277 |
|
| 278 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 279 |
display: flex;
|
| 280 |
align-items: center;
|
| 281 |
-
gap: 5px;
|
| 282 |
}
|
| 283 |
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
display: flex;
|
| 292 |
-
justify-content: space-around;
|
| 293 |
-
padding: 10px 0;
|
| 294 |
-
border-top: 1px solid #dbdbdb;
|
| 295 |
}
|
| 296 |
|
| 297 |
-
.
|
| 298 |
-
|
| 299 |
-
|
|
|
|
|
|
|
|
|
|
| 300 |
}
|
| 301 |
|
| 302 |
-
/*
|
| 303 |
-
.modal {
|
| 304 |
-
display: none;
|
| 305 |
position: fixed;
|
| 306 |
top: 0;
|
| 307 |
left: 0;
|
| 308 |
right: 0;
|
| 309 |
bottom: 0;
|
| 310 |
background-color: rgba(0, 0, 0, 0.8);
|
| 311 |
-
z-index:
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
}
|
| 315 |
-
|
| 316 |
-
.modal-content {
|
| 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 |
-
.
|
|
|
|
| 326 |
padding: 15px;
|
| 327 |
-
border-bottom: 1px solid #dbdbdb;
|
| 328 |
display: flex;
|
| 329 |
-
justify-content: space-between;
|
| 330 |
align-items: center;
|
| 331 |
-
|
| 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 |
-
.
|
|
|
|
|
|
|
| 343 |
cursor: pointer;
|
| 344 |
-
z-index: 1;
|
| 345 |
}
|
| 346 |
|
| 347 |
-
.
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
.modal-save {
|
| 352 |
-
color: #0095f6;
|
| 353 |
}
|
| 354 |
|
| 355 |
-
.
|
| 356 |
-
|
|
|
|
|
|
|
|
|
|
| 357 |
}
|
| 358 |
|
| 359 |
-
.
|
| 360 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 361 |
}
|
| 362 |
|
| 363 |
-
.
|
| 364 |
-
|
| 365 |
-
margin-
|
| 366 |
-
|
| 367 |
-
color: #262626;
|
| 368 |
-
font-weight: bold;
|
| 369 |
}
|
| 370 |
|
| 371 |
-
.
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
border:
|
| 375 |
-
border-radius: 4px;
|
| 376 |
-
font-size: 14px;
|
| 377 |
}
|
| 378 |
|
| 379 |
-
.
|
| 380 |
-
|
| 381 |
-
|
|
|
|
|
|
|
| 382 |
}
|
| 383 |
|
| 384 |
-
.
|
|
|
|
|
|
|
|
|
|
| 385 |
display: flex;
|
| 386 |
-
flex-direction: column;
|
| 387 |
align-items: center;
|
| 388 |
-
margin-bottom: 20px;
|
| 389 |
}
|
| 390 |
|
| 391 |
-
.
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
border-radius:
|
| 395 |
-
|
| 396 |
-
|
|
|
|
| 397 |
}
|
| 398 |
|
| 399 |
-
.
|
| 400 |
-
|
| 401 |
-
font-
|
|
|
|
| 402 |
cursor: pointer;
|
| 403 |
}
|
| 404 |
|
| 405 |
-
/*
|
| 406 |
-
.
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 412 |
}
|
| 413 |
|
| 414 |
-
.
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
background-color: black;
|
| 419 |
}
|
| 420 |
|
| 421 |
-
.
|
| 422 |
-
|
| 423 |
-
justify-content: center;
|
| 424 |
-
padding: 15px;
|
| 425 |
}
|
| 426 |
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
padding: 8px 20px;
|
| 432 |
-
border-radius: 4px;
|
| 433 |
-
font-weight: bold;
|
| 434 |
-
cursor: pointer;
|
| 435 |
}
|
| 436 |
|
| 437 |
/* Responsive */
|
| 438 |
@media (max-width: 450px) {
|
| 439 |
-
.
|
| 440 |
-
width:
|
| 441 |
-
height:
|
| 442 |
-
margin-left: 10px;
|
| 443 |
}
|
| 444 |
|
| 445 |
-
.
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
.stat-label {
|
| 450 |
-
font-size: 12px;
|
| 451 |
}
|
| 452 |
}
|
| 453 |
</style>
|
|
@@ -455,345 +386,667 @@
|
|
| 455 |
<body>
|
| 456 |
<!-- Header -->
|
| 457 |
<div class="header">
|
| 458 |
-
<div class="header-logo"
|
| 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 |
-
<!--
|
| 466 |
-
<div class="
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 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 |
-
|
| 492 |
-
|
| 493 |
-
|
|
|
|
|
|
|
| 494 |
</div>
|
| 495 |
-
|
| 496 |
-
<div
|
| 497 |
-
|
| 498 |
-
🌍✈️📷
|
| 499 |
</div>
|
| 500 |
-
<a href="#" class="profile-website" id="profileWebsite">www.sara-portfolio.com</a>
|
| 501 |
</div>
|
| 502 |
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 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 |
-
|
| 519 |
-
|
| 520 |
-
|
| 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 |
-
|
| 527 |
-
|
| 528 |
-
|
|
|
|
|
|
|
|
|
|
| 529 |
</div>
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 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 |
-
<!--
|
| 565 |
-
<div class="modal" id="
|
| 566 |
-
<div class="
|
| 567 |
-
<div class="
|
| 568 |
-
<
|
| 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 |
-
|
| 604 |
-
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
|
| 608 |
-
<div class="
|
| 609 |
-
<
|
| 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
|
| 628 |
-
|
| 629 |
-
|
| 630 |
-
|
| 631 |
-
|
| 632 |
-
|
| 633 |
-
|
| 634 |
-
|
| 635 |
-
|
| 636 |
-
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
|
| 642 |
-
|
| 643 |
-
{
|
| 644 |
-
|
| 645 |
-
|
| 646 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 647 |
};
|
| 648 |
|
| 649 |
// عناصر DOM
|
| 650 |
-
const
|
| 651 |
-
const
|
| 652 |
-
const
|
| 653 |
-
const
|
| 654 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 655 |
|
| 656 |
// تهيئة الصفحة
|
| 657 |
-
function
|
| 658 |
-
|
| 659 |
-
|
| 660 |
-
|
| 661 |
-
|
| 662 |
-
|
| 663 |
-
|
| 664 |
-
|
| 665 |
-
|
| 666 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 667 |
|
| 668 |
-
// عرض
|
| 669 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 670 |
}
|
| 671 |
|
| 672 |
-
// عرض
|
| 673 |
-
function
|
| 674 |
-
|
| 675 |
|
| 676 |
-
|
| 677 |
-
|
| 678 |
-
|
| 679 |
-
|
| 680 |
-
|
| 681 |
-
|
| 682 |
-
|
| 683 |
-
|
| 684 |
-
|
| 685 |
-
|
| 686 |
-
|
| 687 |
-
|
| 688 |
-
|
| 689 |
-
|
|
|
|
|
|
|
|
|
|
| 690 |
</div>
|
| 691 |
`;
|
| 692 |
|
| 693 |
-
|
| 694 |
});
|
| 695 |
}
|
| 696 |
|
| 697 |
-
// عرض
|
| 698 |
-
function
|
| 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 |
-
|
| 707 |
-
|
| 708 |
-
|
| 709 |
-
|
| 710 |
-
|
| 711 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 712 |
}
|
| 713 |
|
| 714 |
-
//
|
| 715 |
-
function
|
| 716 |
-
|
| 717 |
-
userProfile.username = document.getElementById('editUsername').value;
|
| 718 |
-
userProfile.bio = document.getElementById('editBio').value;
|
| 719 |
-
userProfile.website = document.getElementById('editWebsite').value;
|
| 720 |
|
| 721 |
-
|
| 722 |
-
|
| 723 |
-
|
| 724 |
-
|
| 725 |
-
document.getElementById('profileWebsite').textContent = userProfile.website;
|
| 726 |
|
| 727 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 728 |
}
|
| 729 |
|
| 730 |
-
//
|
| 731 |
-
function
|
| 732 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 733 |
}
|
| 734 |
|
| 735 |
-
//
|
| 736 |
-
function
|
| 737 |
-
|
| 738 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 739 |
}
|
| 740 |
|
| 741 |
-
//
|
| 742 |
-
function
|
| 743 |
-
|
| 744 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 745 |
}
|
| 746 |
|
| 747 |
-
//
|
| 748 |
-
function
|
| 749 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 750 |
}
|
| 751 |
|
| 752 |
-
//
|
| 753 |
-
function
|
| 754 |
-
|
| 755 |
-
|
| 756 |
}
|
| 757 |
|
| 758 |
-
//
|
| 759 |
-
|
| 760 |
-
|
| 761 |
-
|
|
|
|
|
|
|
| 762 |
|
| 763 |
-
|
| 764 |
-
|
| 765 |
-
|
| 766 |
-
|
| 767 |
-
|
| 768 |
-
|
| 769 |
-
document.
|
| 770 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 771 |
|
| 772 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 773 |
}
|
| 774 |
-
}
|
| 775 |
|
| 776 |
-
//
|
| 777 |
-
|
| 778 |
-
|
| 779 |
-
|
| 780 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 781 |
|
| 782 |
-
|
| 783 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 784 |
};
|
| 785 |
|
| 786 |
-
|
| 787 |
-
|
| 788 |
-
|
| 789 |
-
|
| 790 |
-
|
| 791 |
-
}
|
| 792 |
}
|
| 793 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 794 |
|
| 795 |
// تهيئة الصفحة عند التحميل
|
| 796 |
-
window.addEventListener('DOMContentLoaded',
|
| 797 |
</script>
|
| 798 |
</body>
|
| 799 |
</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 |
+
:root {
|
| 10 |
+
--primary-color: #0095f6;
|
| 11 |
+
--primary-light: #b3dffd;
|
| 12 |
+
--text-dark: #262626;
|
| 13 |
+
--text-gray: #8e8e8e;
|
| 14 |
+
--border-color: #dbdbdb;
|
| 15 |
+
--bg-white: #ffffff;
|
| 16 |
+
--bg-light: #fafafa;
|
| 17 |
+
--error-color: #ed4956;
|
| 18 |
+
--success-color: #4BB543;
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
* {
|
| 22 |
margin: 0;
|
| 23 |
padding: 0;
|
| 24 |
box-sizing: border-box;
|
| 25 |
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
| 26 |
+
-webkit-tap-highlight-color: transparent;
|
| 27 |
}
|
| 28 |
|
| 29 |
body {
|
| 30 |
+
background-color: var(--bg-light);
|
| 31 |
+
color: var(--text-dark);
|
| 32 |
+
padding-bottom: 60px;
|
| 33 |
}
|
| 34 |
|
| 35 |
+
/* Header */
|
| 36 |
.header {
|
| 37 |
+
position: fixed;
|
| 38 |
+
top: 0;
|
| 39 |
+
left: 0;
|
| 40 |
+
right: 0;
|
| 41 |
+
height: 54px;
|
| 42 |
display: flex;
|
| 43 |
justify-content: space-between;
|
| 44 |
align-items: center;
|
| 45 |
+
padding: 0 16px;
|
| 46 |
+
background-color: var(--bg-white);
|
| 47 |
+
border-bottom: 1px solid var(--border-color);
|
| 48 |
+
z-index: 100;
|
|
|
|
|
|
|
| 49 |
}
|
| 50 |
|
| 51 |
.header-logo {
|
| 52 |
+
font-family: 'Billabong', cursive;
|
| 53 |
font-size: 24px;
|
| 54 |
+
font-weight: 600;
|
| 55 |
+
margin-top: 5px;
|
| 56 |
}
|
| 57 |
|
| 58 |
.header-icons {
|
|
|
|
| 63 |
.header-icons i {
|
| 64 |
font-size: 24px;
|
| 65 |
cursor: pointer;
|
| 66 |
+
color: var(--text-dark);
|
| 67 |
}
|
| 68 |
|
| 69 |
+
/* Main Content */
|
| 70 |
+
.main-content {
|
| 71 |
+
margin-top: 54px;
|
|
|
|
|
|
|
|
|
|
| 72 |
}
|
| 73 |
|
| 74 |
+
/* Tabs Navigation */
|
| 75 |
+
.tabs-navigation {
|
| 76 |
display: flex;
|
| 77 |
+
background-color: var(--bg-white);
|
| 78 |
+
border-bottom: 1px solid var(--border-color);
|
| 79 |
}
|
| 80 |
|
| 81 |
+
.tab-btn {
|
| 82 |
+
flex: 1;
|
| 83 |
+
text-align: center;
|
| 84 |
+
padding: 15px 0;
|
| 85 |
+
font-weight: 600;
|
|
|
|
|
|
|
| 86 |
cursor: pointer;
|
| 87 |
position: relative;
|
| 88 |
+
color: var(--text-gray);
|
| 89 |
}
|
| 90 |
|
| 91 |
+
.tab-btn.active {
|
| 92 |
+
color: var(--text-dark);
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
.tab-btn.active::after {
|
| 96 |
+
content: '';
|
| 97 |
position: absolute;
|
| 98 |
bottom: 0;
|
| 99 |
+
left: 0;
|
| 100 |
right: 0;
|
| 101 |
+
height: 2px;
|
| 102 |
+
background-color: var(--text-dark);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
}
|
| 104 |
|
| 105 |
+
/* Tab Content */
|
| 106 |
+
.tab-content {
|
| 107 |
+
display: none;
|
| 108 |
+
padding: 15px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
}
|
| 110 |
|
| 111 |
+
.tab-content.active {
|
| 112 |
+
display: block;
|
|
|
|
| 113 |
}
|
| 114 |
|
| 115 |
+
/* Friend Requests Section */
|
| 116 |
+
.section-title {
|
| 117 |
+
font-size: 16px;
|
| 118 |
+
font-weight: 600;
|
| 119 |
margin-bottom: 15px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
display: flex;
|
| 121 |
+
justify-content: space-between;
|
| 122 |
align-items: center;
|
| 123 |
}
|
| 124 |
|
| 125 |
+
.section-title a {
|
| 126 |
+
color: var(--text-gray);
|
| 127 |
+
font-size: 14px;
|
| 128 |
+
font-weight: normal;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
text-decoration: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
}
|
| 131 |
|
| 132 |
+
.friend-request-item, .suggested-friend-item {
|
|
|
|
| 133 |
display: flex;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
align-items: center;
|
| 135 |
+
padding: 10px 0;
|
| 136 |
+
border-bottom: 1px solid var(--border-color);
|
| 137 |
}
|
| 138 |
|
| 139 |
+
.friend-avatar {
|
| 140 |
+
width: 50px;
|
| 141 |
+
height: 50px;
|
| 142 |
border-radius: 50%;
|
| 143 |
+
object-fit: cover;
|
| 144 |
+
margin-left: 15px;
|
| 145 |
}
|
| 146 |
|
| 147 |
+
.friend-info {
|
| 148 |
+
flex: 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
}
|
| 150 |
|
| 151 |
+
.friend-name {
|
| 152 |
+
font-weight: 600;
|
| 153 |
+
font-size: 14px;
|
| 154 |
+
margin-bottom: 3px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 155 |
}
|
| 156 |
|
| 157 |
+
.friend-meta {
|
| 158 |
+
color: var(--text-gray);
|
| 159 |
font-size: 12px;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
}
|
| 161 |
|
| 162 |
+
.friend-actions {
|
|
|
|
| 163 |
display: flex;
|
| 164 |
+
gap: 8px;
|
|
|
|
|
|
|
|
|
|
| 165 |
}
|
| 166 |
|
| 167 |
+
.btn {
|
| 168 |
+
padding: 7px 12px;
|
| 169 |
+
border-radius: 8px;
|
| 170 |
+
font-size: 12px;
|
| 171 |
+
font-weight: 600;
|
| 172 |
cursor: pointer;
|
| 173 |
+
border: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
}
|
| 175 |
|
| 176 |
+
.btn-primary {
|
| 177 |
+
background-color: var(--primary-color);
|
| 178 |
+
color: white;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
}
|
| 180 |
|
| 181 |
+
.btn-outline {
|
| 182 |
+
background-color: transparent;
|
| 183 |
+
border: 1px solid var(--border-color);
|
| 184 |
+
color: var(--text-dark);
|
| 185 |
}
|
| 186 |
|
| 187 |
+
.btn-danger {
|
| 188 |
+
background-color: var(--error-color);
|
| 189 |
+
color: white;
|
|
|
|
|
|
|
|
|
|
| 190 |
}
|
| 191 |
|
| 192 |
+
/* Messages Section */
|
| 193 |
+
.message-item {
|
| 194 |
+
display: flex;
|
| 195 |
+
align-items: center;
|
| 196 |
+
padding: 12px 0;
|
| 197 |
+
border-bottom: 1px solid var(--border-color);
|
| 198 |
cursor: pointer;
|
| 199 |
}
|
| 200 |
|
| 201 |
+
.message-avatar {
|
| 202 |
+
width: 60px;
|
| 203 |
+
height: 60px;
|
| 204 |
+
border-radius: 50%;
|
| 205 |
object-fit: cover;
|
| 206 |
+
margin-left: 10px;
|
| 207 |
}
|
| 208 |
|
| 209 |
+
.message-content {
|
| 210 |
+
flex: 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 211 |
}
|
| 212 |
|
| 213 |
+
.message-header {
|
| 214 |
display: flex;
|
| 215 |
+
justify-content: space-between;
|
| 216 |
+
margin-bottom: 5px;
|
| 217 |
}
|
| 218 |
|
| 219 |
+
.message-sender {
|
| 220 |
+
font-weight: 600;
|
| 221 |
+
font-size: 14px;
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
.message-time {
|
| 225 |
+
color: var(--text-gray);
|
| 226 |
+
font-size: 12px;
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
.message-preview {
|
| 230 |
display: flex;
|
| 231 |
align-items: center;
|
|
|
|
| 232 |
}
|
| 233 |
|
| 234 |
+
.message-text {
|
| 235 |
+
font-size: 13px;
|
| 236 |
+
color: var(--text-gray);
|
| 237 |
+
max-width: 80%;
|
| 238 |
+
white-space: nowrap;
|
| 239 |
+
overflow: hidden;
|
| 240 |
+
text-overflow: ellipsis;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 241 |
}
|
| 242 |
|
| 243 |
+
.message-unread {
|
| 244 |
+
background-color: var(--primary-color);
|
| 245 |
+
width: 8px;
|
| 246 |
+
height: 8px;
|
| 247 |
+
border-radius: 50%;
|
| 248 |
+
margin-right: 5px;
|
| 249 |
}
|
| 250 |
|
| 251 |
+
/* Chat Modal */
|
| 252 |
+
.chat-modal {
|
|
|
|
| 253 |
position: fixed;
|
| 254 |
top: 0;
|
| 255 |
left: 0;
|
| 256 |
right: 0;
|
| 257 |
bottom: 0;
|
| 258 |
background-color: rgba(0, 0, 0, 0.8);
|
| 259 |
+
z-index: 200;
|
| 260 |
+
display: none;
|
| 261 |
+
flex-direction: column;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 262 |
}
|
| 263 |
|
| 264 |
+
.chat-header {
|
| 265 |
+
background-color: var(--bg-white);
|
| 266 |
padding: 15px;
|
|
|
|
| 267 |
display: flex;
|
|
|
|
| 268 |
align-items: center;
|
| 269 |
+
border-bottom: 1px solid var(--border-color);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 270 |
}
|
| 271 |
|
| 272 |
+
.chat-back-btn {
|
| 273 |
+
margin-left: 10px;
|
| 274 |
+
font-size: 20px;
|
| 275 |
cursor: pointer;
|
|
|
|
| 276 |
}
|
| 277 |
|
| 278 |
+
.chat-title {
|
| 279 |
+
flex: 1;
|
| 280 |
+
font-weight: 600;
|
| 281 |
+
text-align: center;
|
|
|
|
|
|
|
| 282 |
}
|
| 283 |
|
| 284 |
+
.chat-body {
|
| 285 |
+
flex: 1;
|
| 286 |
+
background-color: var(--bg-white);
|
| 287 |
+
padding: 15px;
|
| 288 |
+
overflow-y: auto;
|
| 289 |
}
|
| 290 |
|
| 291 |
+
.message-bubble {
|
| 292 |
+
max-width: 70%;
|
| 293 |
+
padding: 10px 15px;
|
| 294 |
+
border-radius: 18px;
|
| 295 |
+
margin-bottom: 10px;
|
| 296 |
+
font-size: 14px;
|
| 297 |
+
position: relative;
|
| 298 |
}
|
| 299 |
|
| 300 |
+
.message-in {
|
| 301 |
+
background-color: var(--bg-light);
|
| 302 |
+
margin-right: auto;
|
| 303 |
+
border-bottom-right-radius: 0;
|
|
|
|
|
|
|
| 304 |
}
|
| 305 |
|
| 306 |
+
.message-out {
|
| 307 |
+
background-color: var(--primary-light);
|
| 308 |
+
margin-left: auto;
|
| 309 |
+
border-bottom-left-radius: 0;
|
|
|
|
|
|
|
| 310 |
}
|
| 311 |
|
| 312 |
+
.message-time {
|
| 313 |
+
font-size: 10px;
|
| 314 |
+
color: var(--text-gray);
|
| 315 |
+
margin-top: 5px;
|
| 316 |
+
text-align: right;
|
| 317 |
}
|
| 318 |
|
| 319 |
+
.chat-footer {
|
| 320 |
+
background-color: var(--bg-white);
|
| 321 |
+
padding: 15px;
|
| 322 |
+
border-top: 1px solid var(--border-color);
|
| 323 |
display: flex;
|
|
|
|
| 324 |
align-items: center;
|
|
|
|
| 325 |
}
|
| 326 |
|
| 327 |
+
.message-input {
|
| 328 |
+
flex: 1;
|
| 329 |
+
padding: 12px 15px;
|
| 330 |
+
border-radius: 22px;
|
| 331 |
+
border: 1px solid var(--border-color);
|
| 332 |
+
font-size: 14px;
|
| 333 |
+
background-color: var(--bg-light);
|
| 334 |
}
|
| 335 |
|
| 336 |
+
.send-btn {
|
| 337 |
+
margin-right: 10px;
|
| 338 |
+
font-size: 20px;
|
| 339 |
+
color: var(--primary-color);
|
| 340 |
cursor: pointer;
|
| 341 |
}
|
| 342 |
|
| 343 |
+
/* Bottom Navigation */
|
| 344 |
+
.bottom-nav {
|
| 345 |
+
position: fixed;
|
| 346 |
+
bottom: 0;
|
| 347 |
+
left: 0;
|
| 348 |
+
right: 0;
|
| 349 |
+
background-color: var(--bg-white);
|
| 350 |
+
display: flex;
|
| 351 |
+
justify-content: space-around;
|
| 352 |
+
padding: 12px 0;
|
| 353 |
+
border-top: 1px solid var(--border-color);
|
| 354 |
}
|
| 355 |
|
| 356 |
+
.bottom-nav i {
|
| 357 |
+
font-size: 24px;
|
| 358 |
+
cursor: pointer;
|
| 359 |
+
color: var(--text-dark);
|
|
|
|
| 360 |
}
|
| 361 |
|
| 362 |
+
.bottom-nav i.active {
|
| 363 |
+
color: var(--primary-color);
|
|
|
|
|
|
|
| 364 |
}
|
| 365 |
|
| 366 |
+
/* Font for Instagram-like logo */
|
| 367 |
+
@font-face {
|
| 368 |
+
font-family: 'Billabong';
|
| 369 |
+
src: url('https://fonts.cdnfonts.com/s/13949/Billabong.woff') format('woff');
|
|
|
|
|
|
|
|
|
|
|
|
|
| 370 |
}
|
| 371 |
|
| 372 |
/* Responsive */
|
| 373 |
@media (max-width: 450px) {
|
| 374 |
+
.friend-avatar, .message-avatar {
|
| 375 |
+
width: 45px;
|
| 376 |
+
height: 45px;
|
|
|
|
| 377 |
}
|
| 378 |
|
| 379 |
+
.btn {
|
| 380 |
+
padding: 5px 8px;
|
| 381 |
+
font-size: 11px;
|
|
|
|
|
|
|
|
|
|
| 382 |
}
|
| 383 |
}
|
| 384 |
</style>
|
|
|
|
| 386 |
<body>
|
| 387 |
<!-- Header -->
|
| 388 |
<div class="header">
|
| 389 |
+
<div class="header-logo">إنستا</div>
|
| 390 |
<div class="header-icons">
|
| 391 |
+
<i class="far fa-heart" id="notificationsBtn"></i>
|
| 392 |
+
<i class="far fa-paper-plane" id="messagesBtn"></i>
|
| 393 |
</div>
|
| 394 |
</div>
|
| 395 |
|
| 396 |
+
<!-- Main Content -->
|
| 397 |
+
<div class="main-content">
|
| 398 |
+
<!-- Tabs Navigation -->
|
| 399 |
+
<div class="tabs-navigation">
|
| 400 |
+
<div class="tab-btn active" data-tab="friends">طلبات الصداقة</div>
|
| 401 |
+
<div class="tab-btn" data-tab="suggestions">اقتراحات</div>
|
| 402 |
+
<div class="tab-btn" data-tab="messages">المراسلة</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 403 |
</div>
|
| 404 |
|
| 405 |
+
<!-- Friend Requests Tab -->
|
| 406 |
+
<div class="tab-content active" id="friends-tab">
|
| 407 |
+
<div class="section-title">
|
| 408 |
+
<span>طلبات الصداقة</span>
|
| 409 |
+
<a href="#" id="seeAllRequests">عرض الكل</a>
|
| 410 |
</div>
|
| 411 |
+
|
| 412 |
+
<div id="friendRequestsList">
|
| 413 |
+
<!-- سيتم ملؤها بالطلبات ديناميكيًا -->
|
|
|
|
| 414 |
</div>
|
|
|
|
| 415 |
</div>
|
| 416 |
|
| 417 |
+
<!-- Suggestions Tab -->
|
| 418 |
+
<div class="tab-content" id="suggestions-tab">
|
| 419 |
+
<div class="section-title">
|
| 420 |
+
<span>أشخاص قد تعرفهم</span>
|
| 421 |
+
<a href="#" id="refreshSuggestions">تحديث</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 422 |
</div>
|
| 423 |
+
|
| 424 |
+
<div id="suggestionsList">
|
| 425 |
+
<!-- سيتم ملؤها بالاقتراحات ديناميكيًا -->
|
|
|
|
|
|
|
| 426 |
</div>
|
|
|
|
| 427 |
</div>
|
| 428 |
+
|
| 429 |
+
<!-- Messages Tab -->
|
| 430 |
+
<div class="tab-content" id="messages-tab">
|
| 431 |
+
<div class="section-title">
|
| 432 |
+
<span>المراسلة</span>
|
| 433 |
+
<a href="#" id="newMessageBtn">رسالة جديدة</a>
|
| 434 |
</div>
|
| 435 |
+
|
| 436 |
+
<div id="messagesList">
|
| 437 |
+
<!-- سيتم ملؤها بالرسائل ديناميكيًا -->
|
|
|
|
|
|
|
| 438 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 439 |
</div>
|
| 440 |
</div>
|
| 441 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 442 |
<!-- Bottom Navigation -->
|
| 443 |
<div class="bottom-nav">
|
| 444 |
+
<i class="fas fa-home active"></i>
|
| 445 |
<i class="fas fa-search"></i>
|
| 446 |
<i class="far fa-plus-square"></i>
|
| 447 |
<i class="far fa-heart"></i>
|
| 448 |
<i class="fas fa-user"></i>
|
| 449 |
</div>
|
| 450 |
|
| 451 |
+
<!-- Chat Modal -->
|
| 452 |
+
<div class="chat-modal" id="chatModal">
|
| 453 |
+
<div class="chat-header">
|
| 454 |
+
<div class="chat-back-btn" id="chatBackBtn">
|
| 455 |
+
<i class="fas fa-arrow-left"></i>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 456 |
</div>
|
| 457 |
+
<div class="chat-title" id="chatTitle">محادثة</div>
|
| 458 |
</div>
|
| 459 |
+
<div class="chat-body" id="chatBody">
|
| 460 |
+
<!-- سيتم ملؤها بالرسائل ديناميكيًا -->
|
| 461 |
+
</div>
|
| 462 |
+
<div class="chat-footer">
|
| 463 |
+
<input type="text" class="message-input" id="messageInput" placeholder="اكتب رسالة...">
|
| 464 |
+
<div class="send-btn" id="sendMessageBtn">
|
| 465 |
+
<i class="far fa-paper-plane"></i>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 466 |
</div>
|
|
|
|
|
|
|
| 467 |
</div>
|
| 468 |
</div>
|
| 469 |
|
| 470 |
<script>
|
| 471 |
+
// بيانات التطبيق
|
| 472 |
+
const appData = {
|
| 473 |
+
currentUser: {
|
| 474 |
+
id: 1,
|
| 475 |
+
name: "سارة أحمد",
|
| 476 |
+
username: "@sara_ahmed",
|
| 477 |
+
avatar: "https://randomuser.me/api/portraits/women/44.jpg"
|
| 478 |
+
},
|
| 479 |
+
friendRequests: [
|
| 480 |
+
{
|
| 481 |
+
id: 2,
|
| 482 |
+
name: "أحمد محمد",
|
| 483 |
+
username: "@ahmed_mohamed",
|
| 484 |
+
avatar: "https://randomuser.me/api/portraits/men/32.jpg",
|
| 485 |
+
mutualFriends: 4,
|
| 486 |
+
date: "منذ ساعتين"
|
| 487 |
+
},
|
| 488 |
+
{
|
| 489 |
+
id: 3,
|
| 490 |
+
name: "ليلى خالد",
|
| 491 |
+
username: "@laila_khalid",
|
| 492 |
+
avatar: "https://randomuser.me/api/portraits/women/63.jpg",
|
| 493 |
+
mutualFriends: 2,
|
| 494 |
+
date: "منذ يوم"
|
| 495 |
+
},
|
| 496 |
+
{
|
| 497 |
+
id: 4,
|
| 498 |
+
name: "محمد علي",
|
| 499 |
+
username: "@mohamed_ali",
|
| 500 |
+
avatar: "https://randomuser.me/api/portraits/men/45.jpg",
|
| 501 |
+
mutualFriends: 7,
|
| 502 |
+
date: "منذ 3 أيام"
|
| 503 |
+
}
|
| 504 |
+
],
|
| 505 |
+
suggestedFriends: [
|
| 506 |
+
{
|
| 507 |
+
id: 5,
|
| 508 |
+
name: "نورا سعيد",
|
| 509 |
+
username: "@nora_saeed",
|
| 510 |
+
avatar: "https://randomuser.me/api/portraits/women/22.jpg",
|
| 511 |
+
mutualFriends: 3
|
| 512 |
+
},
|
| 513 |
+
{
|
| 514 |
+
id: 6,
|
| 515 |
+
name: "خالد عمر",
|
| 516 |
+
username: "@khaled_omar",
|
| 517 |
+
avatar: "https://randomuser.me/api/portraits/men/12.jpg",
|
| 518 |
+
mutualFriends: 5
|
| 519 |
+
},
|
| 520 |
+
{
|
| 521 |
+
id: 7,
|
| 522 |
+
name: "هناء وليد",
|
| 523 |
+
username: "@hanna_waleed",
|
| 524 |
+
avatar: "https://randomuser.me/api/portraits/women/33.jpg",
|
| 525 |
+
mutualFriends: 1
|
| 526 |
+
},
|
| 527 |
+
{
|
| 528 |
+
id: 8,
|
| 529 |
+
name: "ياسر ناصر",
|
| 530 |
+
username: "@yasser_nasser",
|
| 531 |
+
avatar: "https://randomuser.me/api/portraits/men/67.jpg",
|
| 532 |
+
mutualFriends: 2
|
| 533 |
+
}
|
| 534 |
+
],
|
| 535 |
+
messages: [
|
| 536 |
+
{
|
| 537 |
+
id: 2,
|
| 538 |
+
user: {
|
| 539 |
+
id: 2,
|
| 540 |
+
name: "أحمد محمد",
|
| 541 |
+
username: "@ahmed_mohamed",
|
| 542 |
+
avatar: "https://randomuser.me/api/portraits/men/32.jpg"
|
| 543 |
+
},
|
| 544 |
+
lastMessage: "مرحبًا، كيف حالك؟",
|
| 545 |
+
time: "10:30 ص",
|
| 546 |
+
unread: true,
|
| 547 |
+
chat: [
|
| 548 |
+
{
|
| 549 |
+
id: 1,
|
| 550 |
+
sender: 2,
|
| 551 |
+
text: "مرحبًا سارة!",
|
| 552 |
+
time: "10:20 ص"
|
| 553 |
+
},
|
| 554 |
+
{
|
| 555 |
+
id: 2,
|
| 556 |
+
sender: 2,
|
| 557 |
+
text: "كيف حالك؟",
|
| 558 |
+
time: "10:21 ص"
|
| 559 |
+
},
|
| 560 |
+
{
|
| 561 |
+
id: 3,
|
| 562 |
+
sender: 1,
|
| 563 |
+
text: "أهلاً أحمد، أنا بخير الحمد لله",
|
| 564 |
+
time: "10:25 ص"
|
| 565 |
+
},
|
| 566 |
+
{
|
| 567 |
+
id: 4,
|
| 568 |
+
sender: 2,
|
| 569 |
+
text: "هل أنتِ متاحة للقاء غدًا؟",
|
| 570 |
+
time: "10:30 ص"
|
| 571 |
+
}
|
| 572 |
+
]
|
| 573 |
+
},
|
| 574 |
+
{
|
| 575 |
+
id: 3,
|
| 576 |
+
user: {
|
| 577 |
+
id: 3,
|
| 578 |
+
name: "ليلى خالد",
|
| 579 |
+
username: "@laila_khalid",
|
| 580 |
+
avatar: "https://randomuser.me/api/portraits/women/63.jpg"
|
| 581 |
+
},
|
| 582 |
+
lastMessage: "شكرًا لكِ!",
|
| 583 |
+
time: "أمس",
|
| 584 |
+
unread: false,
|
| 585 |
+
chat: [
|
| 586 |
+
{
|
| 587 |
+
id: 1,
|
| 588 |
+
sender: 3,
|
| 589 |
+
text: "مرحبًا سارة، شكرًا على المساعدة",
|
| 590 |
+
time: "9:00 م"
|
| 591 |
+
},
|
| 592 |
+
{
|
| 593 |
+
id: 2,
|
| 594 |
+
sender: 1,
|
| 595 |
+
text: "لا شكر على واجب ليلى",
|
| 596 |
+
time: "9:05 م"
|
| 597 |
+
},
|
| 598 |
+
{
|
| 599 |
+
id: 3,
|
| 600 |
+
sender: 3,
|
| 601 |
+
text: "حقًا ساعدتيني كثيرًا",
|
| 602 |
+
time: "9:10 م"
|
| 603 |
+
},
|
| 604 |
+
{
|
| 605 |
+
id: 4,
|
| 606 |
+
sender: 3,
|
| 607 |
+
text: "شكرًا لكِ!",
|
| 608 |
+
time: "9:12 م"
|
| 609 |
+
}
|
| 610 |
+
]
|
| 611 |
+
}
|
| 612 |
+
],
|
| 613 |
+
friends: []
|
| 614 |
};
|
| 615 |
|
| 616 |
// عناصر DOM
|
| 617 |
+
const tabBtns = document.querySelectorAll('.tab-btn');
|
| 618 |
+
const tabContents = document.querySelectorAll('.tab-content');
|
| 619 |
+
const friendRequestsList = document.getElementById('friendRequestsList');
|
| 620 |
+
const suggestionsList = document.getElementById('suggestionsList');
|
| 621 |
+
const messagesList = document.getElementById('messagesList');
|
| 622 |
+
const chatModal = document.getElementById('chatModal');
|
| 623 |
+
const chatBody = document.getElementById('chatBody');
|
| 624 |
+
const messageInput = document.getElementById('messageInput');
|
| 625 |
+
const sendMessageBtn = document.getElementById('sendMessageBtn');
|
| 626 |
+
const chatBackBtn = document.getElementById('chatBackBtn');
|
| 627 |
+
const chatTitle = document.getElementById('chatTitle');
|
| 628 |
+
const messagesBtn = document.getElementById('messagesBtn');
|
| 629 |
+
const notificationsBtn = document.getElementById('notificationsBtn');
|
| 630 |
+
const seeAllRequests = document.getElementById('seeAllRequests');
|
| 631 |
+
const refreshSuggestions = document.getElementById('refreshSuggestions');
|
| 632 |
+
const newMessageBtn = document.getElementById('newMessageBtn');
|
| 633 |
|
| 634 |
// تهيئة الصفحة
|
| 635 |
+
function initPage() {
|
| 636 |
+
renderFriendRequests();
|
| 637 |
+
renderSuggestedFriends();
|
| 638 |
+
renderMessages();
|
| 639 |
+
setupEventListeners();
|
| 640 |
+
}
|
| 641 |
+
|
| 642 |
+
// إعداد مستمعي الأحداث
|
| 643 |
+
function setupEventListeners() {
|
| 644 |
+
// تبديل التبويبات
|
| 645 |
+
tabBtns.forEach(btn => {
|
| 646 |
+
btn.addEventListener('click', () => {
|
| 647 |
+
tabBtns.forEach(b => b.classList.remove('active'));
|
| 648 |
+
btn.classList.add('active');
|
| 649 |
+
|
| 650 |
+
tabContents.forEach(content => content.classList.remove('active'));
|
| 651 |
+
document.getElementById(`${btn.dataset.tab}-tab`).classList.add('active');
|
| 652 |
+
});
|
| 653 |
+
});
|
| 654 |
+
|
| 655 |
+
// فتح وإغلاق الدردشة
|
| 656 |
+
messagesBtn.addEventListener('click', () => {
|
| 657 |
+
tabBtns.forEach(b => b.classList.remove('active'));
|
| 658 |
+
document.querySelector('.tab-btn[data-tab="messages"]').classList.add('active');
|
| 659 |
+
|
| 660 |
+
tabContents.forEach(content => content.classList.remove('active'));
|
| 661 |
+
document.getElementById('messages-tab').classList.add('active');
|
| 662 |
+
});
|
| 663 |
+
|
| 664 |
+
notificationsBtn.addEventListener('click', () => {
|
| 665 |
+
tabBtns.forEach(b => b.classList.remove('active'));
|
| 666 |
+
document.querySelector('.tab-btn[data-tab="friends"]').classList.add('active');
|
| 667 |
+
|
| 668 |
+
tabContents.forEach(content => content.classList.remove('active'));
|
| 669 |
+
document.getElementById('friends-tab').classList.add('active');
|
| 670 |
+
});
|
| 671 |
+
|
| 672 |
+
chatBackBtn.addEventListener('click', closeChat);
|
| 673 |
+
|
| 674 |
+
// إرسال رسالة
|
| 675 |
+
sendMessageBtn.addEventListener('click', sendMessage);
|
| 676 |
+
messageInput.addEventListener('keypress', (e) => {
|
| 677 |
+
if (e.key === 'Enter') {
|
| 678 |
+
sendMessage();
|
| 679 |
+
}
|
| 680 |
+
});
|
| 681 |
|
| 682 |
+
// عرض كل الطلبات
|
| 683 |
+
seeAllRequests.addEventListener('click', (e) => {
|
| 684 |
+
e.preventDefault();
|
| 685 |
+
alert('عرض جميع طلبات الصداقة');
|
| 686 |
+
});
|
| 687 |
+
|
| 688 |
+
// تحديث الاقتراحات
|
| 689 |
+
refreshSuggestions.addEventListener('click', (e) => {
|
| 690 |
+
e.preventDefault();
|
| 691 |
+
refreshFriendSuggestions();
|
| 692 |
+
});
|
| 693 |
+
|
| 694 |
+
// رسالة جديدة
|
| 695 |
+
newMessageBtn.addEventListener('click', (e) => {
|
| 696 |
+
e.preventDefault();
|
| 697 |
+
startNewMessage();
|
| 698 |
+
});
|
| 699 |
}
|
| 700 |
|
| 701 |
+
// عرض طلبات الصداقة
|
| 702 |
+
function renderFriendRequests() {
|
| 703 |
+
friendRequestsList.innerHTML = '';
|
| 704 |
|
| 705 |
+
if (appData.friendRequests.length === 0) {
|
| 706 |
+
friendRequestsList.innerHTML = '<p style="text-align: center; color: var(--text-gray); padding: 20px;">لا توجد طلبات صداقة جديدة</p>';
|
| 707 |
+
return;
|
| 708 |
+
}
|
| 709 |
+
|
| 710 |
+
appData.friendRequests.forEach(request => {
|
| 711 |
+
const requestElement = document.createElement('div');
|
| 712 |
+
requestElement.className = 'friend-request-item';
|
| 713 |
+
requestElement.innerHTML = `
|
| 714 |
+
<img src="${request.avatar}" class="friend-avatar" alt="${request.name}">
|
| 715 |
+
<div class="friend-info">
|
| 716 |
+
<div class="friend-name">${request.name}</div>
|
| 717 |
+
<div class="friend-meta">${request.mutualFriends} أصدقاء مشتركين • ${request.date}</div>
|
| 718 |
+
</div>
|
| 719 |
+
<div class="friend-actions">
|
| 720 |
+
<button class="btn btn-primary" onclick="acceptFriendRequest(${request.id})">قبول</button>
|
| 721 |
+
<button class="btn btn-outline" onclick="declineFriendRequest(${request.id})">حذف</button>
|
| 722 |
</div>
|
| 723 |
`;
|
| 724 |
|
| 725 |
+
friendRequestsList.appendChild(requestElement);
|
| 726 |
});
|
| 727 |
}
|
| 728 |
|
| 729 |
+
// عرض اقتراحات الأصدقاء
|
| 730 |
+
function renderSuggestedFriends() {
|
| 731 |
+
suggestionsList.innerHTML = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 732 |
|
| 733 |
+
appData.suggestedFriends.forEach(friend => {
|
| 734 |
+
const friendElement = document.createElement('div');
|
| 735 |
+
friendElement.className = 'suggested-friend-item';
|
| 736 |
+
friendElement.innerHTML = `
|
| 737 |
+
<img src="${friend.avatar}" class="friend-avatar" alt="${friend.name}">
|
| 738 |
+
<div class="friend-info">
|
| 739 |
+
<div class="friend-name">${friend.name}</div>
|
| 740 |
+
<div class="friend-meta">${friend.mutualFriends} أصدقاء مشتركين</div>
|
| 741 |
+
</div>
|
| 742 |
+
<div class="friend-actions">
|
| 743 |
+
<button class="btn btn-primary" onclick="sendFriendRequest(${friend.id})">إرسال طلب</button>
|
| 744 |
+
<button class="btn btn-outline" onclick="removeSuggestion(${friend.id})">إزالة</button>
|
| 745 |
+
</div>
|
| 746 |
+
`;
|
| 747 |
+
|
| 748 |
+
suggestionsList.appendChild(friendElement);
|
| 749 |
+
});
|
| 750 |
}
|
| 751 |
|
| 752 |
+
// عرض الرسائل
|
| 753 |
+
function renderMessages() {
|
| 754 |
+
messagesList.innerHTML = '';
|
|
|
|
|
|
|
|
|
|
| 755 |
|
| 756 |
+
if (appData.messages.length === 0) {
|
| 757 |
+
messagesList.innerHTML = '<p style="text-align: center; color: var(--text-gray); padding: 20px;">لا توجد رسائل</p>';
|
| 758 |
+
return;
|
| 759 |
+
}
|
|
|
|
| 760 |
|
| 761 |
+
appData.messages.forEach(message => {
|
| 762 |
+
const messageElement = document.createElement('div');
|
| 763 |
+
messageElement.className = 'message-item';
|
| 764 |
+
messageElement.innerHTML = `
|
| 765 |
+
<img src="${message.user.avatar}" class="message-avatar" alt="${message.user.name}">
|
| 766 |
+
<div class="message-content">
|
| 767 |
+
<div class="message-header">
|
| 768 |
+
<div class="message-sender">${message.user.name}</div>
|
| 769 |
+
<div class="message-time">${message.time}</div>
|
| 770 |
+
</div>
|
| 771 |
+
<div class="message-preview">
|
| 772 |
+
${message.unread ? '<div class="message-unread"></div>' : ''}
|
| 773 |
+
<div class="message-text">${message.lastMessage}</div>
|
| 774 |
+
</div>
|
| 775 |
+
</div>
|
| 776 |
+
`;
|
| 777 |
+
|
| 778 |
+
messageElement.addEventListener('click', () => openChat(message.user.id));
|
| 779 |
+
messagesList.appendChild(messageElement);
|
| 780 |
+
});
|
| 781 |
}
|
| 782 |
|
| 783 |
+
// قبول طلب صداقة
|
| 784 |
+
function acceptFriendRequest(userId) {
|
| 785 |
+
const requestIndex = appData.friendRequests.findIndex(req => req.id === userId);
|
| 786 |
+
if (requestIndex !== -1) {
|
| 787 |
+
const acceptedUser = appData.friendRequests[requestIndex];
|
| 788 |
+
|
| 789 |
+
// نقل المستخدم إلى قائمة الأصدقاء
|
| 790 |
+
appData.friends.push({
|
| 791 |
+
id: acceptedUser.id,
|
| 792 |
+
name: acceptedUser.name,
|
| 793 |
+
username: acceptedUser.username,
|
| 794 |
+
avatar: acceptedUser.avatar
|
| 795 |
+
});
|
| 796 |
+
|
| 797 |
+
// إزالة الطلب من القائمة
|
| 798 |
+
appData.friendRequests.splice(requestIndex, 1);
|
| 799 |
+
|
| 800 |
+
// عرض تنبيه
|
| 801 |
+
showAlert('تم قبول طلب الصداقة بنجاح', 'success');
|
| 802 |
+
|
| 803 |
+
// تحديث الواجهة
|
| 804 |
+
renderFriendRequests();
|
| 805 |
+
}
|
| 806 |
}
|
| 807 |
|
| 808 |
+
// رفض طلب صداقة
|
| 809 |
+
function declineFriendRequest(userId) {
|
| 810 |
+
const requestIndex = appData.friendRequests.findIndex(req => req.id === userId);
|
| 811 |
+
if (requestIndex !== -1) {
|
| 812 |
+
appData.friendRequests.splice(requestIndex, 1);
|
| 813 |
+
showAlert('تم حذف طلب الصداقة', 'info');
|
| 814 |
+
renderFriendRequests();
|
| 815 |
+
}
|
| 816 |
}
|
| 817 |
|
| 818 |
+
// إرسال طلب صداقة
|
| 819 |
+
function sendFriendRequest(userId) {
|
| 820 |
+
const friendIndex = appData.suggestedFriends.findIndex(f => f.id === userId);
|
| 821 |
+
if (friendIndex !== -1) {
|
| 822 |
+
const friend = appData.suggestedFriends[friendIndex];
|
| 823 |
+
showAlert(`تم إرسال طلب صداقة إلى ${friend.name}`, 'success');
|
| 824 |
+
|
| 825 |
+
// في تطبيق حقيقي، سيتم إرسال الطلب إلى الخادم
|
| 826 |
+
setTimeout(() => {
|
| 827 |
+
removeSuggestion(userId);
|
| 828 |
+
}, 1000);
|
| 829 |
+
}
|
| 830 |
}
|
| 831 |
|
| 832 |
+
// إزالة اقتراح
|
| 833 |
+
function removeSuggestion(userId) {
|
| 834 |
+
const friendIndex = appData.suggestedFriends.findIndex(f => f.id === userId);
|
| 835 |
+
if (friendIndex !== -1) {
|
| 836 |
+
appData.suggestedFriends.splice(friendIndex, 1);
|
| 837 |
+
renderSuggestedFriends();
|
| 838 |
+
}
|
| 839 |
}
|
| 840 |
|
| 841 |
+
// تحديث اقتراحات الأصدقاء
|
| 842 |
+
function refreshFriendSuggestions() {
|
| 843 |
+
// في تطبيق حقيقي، سيتم جلب بيانات جديدة من الخادم
|
| 844 |
+
showAlert('تم تحديث اقتراحات الأصدقاء', 'info');
|
| 845 |
}
|
| 846 |
|
| 847 |
+
// فتح الدردشة
|
| 848 |
+
function openChat(userId) {
|
| 849 |
+
const message = appData.messages.find(m => m.user.id === userId);
|
| 850 |
+
if (message) {
|
| 851 |
+
// تحديث حالة الرسائل كمقروءة
|
| 852 |
+
message.unread = false;
|
| 853 |
|
| 854 |
+
// عرض الدردشة
|
| 855 |
+
chatTitle.textContent = message.user.name;
|
| 856 |
+
chatBody.innerHTML = '';
|
| 857 |
+
|
| 858 |
+
message.chat.forEach(msg => {
|
| 859 |
+
const messageClass = msg.sender === appData.currentUser.id ? 'message-out' : 'message-in';
|
| 860 |
+
const messageElement = document.createElement('div');
|
| 861 |
+
messageElement.className = `message-bubble ${messageClass}`;
|
| 862 |
+
messageElement.innerHTML = `
|
| 863 |
+
<div>${msg.text}</div>
|
| 864 |
+
<div class="message-time">${msg.time}</div>
|
| 865 |
+
`;
|
| 866 |
+
chatBody.appendChild(messageElement);
|
| 867 |
+
});
|
| 868 |
+
|
| 869 |
+
// التمرير إلى الأسفل
|
| 870 |
+
chatBody.scrollTop = chatBody.scrollHeight;
|
| 871 |
|
| 872 |
+
// فتح نافذة الدردشة
|
| 873 |
+
chatModal.style.display = 'flex';
|
| 874 |
+
document.body.style.overflow = 'hidden';
|
| 875 |
+
|
| 876 |
+
// حفظ معرف المستخدم في زر الإرسال
|
| 877 |
+
sendMessageBtn.dataset.userId = userId;
|
| 878 |
}
|
| 879 |
+
}
|
| 880 |
|
| 881 |
+
// إغلاق الدردشة
|
| 882 |
+
function closeChat() {
|
| 883 |
+
chatModal.style.display = 'none';
|
| 884 |
+
document.body.style.overflow = 'auto';
|
| 885 |
+
|
| 886 |
+
// تحديث قائمة الرسائل
|
| 887 |
+
renderMessages();
|
| 888 |
+
}
|
| 889 |
+
|
| 890 |
+
// إرسال رسالة
|
| 891 |
+
function sendMessage() {
|
| 892 |
+
const text = messageInput.value.trim();
|
| 893 |
+
if (text && sendMessageBtn.dataset.userId) {
|
| 894 |
+
const userId = parseInt(sendMessageBtn.dataset.userId);
|
| 895 |
+
const message = appData.messages.find(m => m.user.id === userId);
|
| 896 |
|
| 897 |
+
if (message) {
|
| 898 |
+
// إنشاء رسالة جديدة
|
| 899 |
+
const newMessage = {
|
| 900 |
+
id: message.chat.length + 1,
|
| 901 |
+
sender: appData.currentUser.id,
|
| 902 |
+
text: text,
|
| 903 |
+
time: getCurrentTime()
|
| 904 |
+
};
|
| 905 |
+
|
| 906 |
+
// إضافة الرسالة إلى المحادثة
|
| 907 |
+
message.chat.push(newMessage);
|
| 908 |
+
|
| 909 |
+
// تحديث آخر رسالة
|
| 910 |
+
message.lastMessage = text;
|
| 911 |
+
message.time = 'الآن';
|
| 912 |
+
message.unread = false;
|
| 913 |
+
|
| 914 |
+
// عرض الرسالة في الدردشة
|
| 915 |
+
const messageElement = document.createElement('div');
|
| 916 |
+
messageElement.className = 'message-bubble message-out';
|
| 917 |
+
messageElement.innerHTML = `
|
| 918 |
+
<div>${text}</div>
|
| 919 |
+
<div class="message-time">${newMessage.time}</div>
|
| 920 |
+
`;
|
| 921 |
+
chatBody.appendChild(messageElement);
|
| 922 |
+
|
| 923 |
+
// مسح حقل الإدخال
|
| 924 |
+
messageInput.value = '';
|
| 925 |
+
|
| 926 |
+
// التمرير إلى الأسفل
|
| 927 |
+
chatBody.scrollTop = chatBody.scrollHeight;
|
| 928 |
+
|
| 929 |
+
// في تطبيق حقيقي، سيتم إرسال الرسالة إلى الخادم
|
| 930 |
+
// هنا سنقوم بمحاكاة الرد بعد ثانيتين
|
| 931 |
+
setTimeout(() => {
|
| 932 |
+
const replyMessage = {
|
| 933 |
+
id: message.chat.length + 1,
|
| 934 |
+
sender: userId,
|
| 935 |
+
text: getRandomReply(),
|
| 936 |
+
time: getCurrentTime()
|
| 937 |
+
};
|
| 938 |
+
|
| 939 |
+
message.chat.push(replyMessage);
|
| 940 |
+
message.lastMessage = replyMessage.text;
|
| 941 |
+
|
| 942 |
+
if (!chatModal.style.display || chatModal.style.display === 'none') {
|
| 943 |
+
message.unread = true;
|
| 944 |
+
} else {
|
| 945 |
+
const replyElement = document.createElement('div');
|
| 946 |
+
replyElement.className = 'message-bubble message-in';
|
| 947 |
+
replyElement.innerHTML = `
|
| 948 |
+
<div>${replyMessage.text}</div>
|
| 949 |
+
<div class="message-time">${replyMessage.time}</div>
|
| 950 |
+
`;
|
| 951 |
+
chatBody.appendChild(replyElement);
|
| 952 |
+
chatBody.scrollTop = chatBody.scrollHeight;
|
| 953 |
+
}
|
| 954 |
+
|
| 955 |
+
renderMessages();
|
| 956 |
+
}, 2000);
|
| 957 |
+
}
|
| 958 |
+
}
|
| 959 |
+
}
|
| 960 |
+
|
| 961 |
+
// بدء رسالة جديدة
|
| 962 |
+
function startNewMessage() {
|
| 963 |
+
// في تطبيق حقيقي، سيكون هناك واجهة لاختيار المستلم
|
| 964 |
+
const randomFriend = appData.suggestedFriends[Math.floor(Math.random() * appData.suggestedFriends.length)];
|
| 965 |
+
|
| 966 |
+
if (randomFriend) {
|
| 967 |
+
// إنشاء محادثة جديدة
|
| 968 |
+
const newChat = {
|
| 969 |
+
id: randomFriend.id,
|
| 970 |
+
user: {
|
| 971 |
+
id: randomFriend.id,
|
| 972 |
+
name: randomFriend.name,
|
| 973 |
+
username: randomFriend.username,
|
| 974 |
+
avatar: randomFriend.avatar
|
| 975 |
+
},
|
| 976 |
+
lastMessage: "بدأت محادثة جديدة",
|
| 977 |
+
time: "الآن",
|
| 978 |
+
unread: false,
|
| 979 |
+
chat: []
|
| 980 |
};
|
| 981 |
|
| 982 |
+
appData.messages.unshift(newChat);
|
| 983 |
+
renderMessages();
|
| 984 |
+
openChat(randomFriend.id);
|
| 985 |
+
} else {
|
| 986 |
+
showAlert('لا يوجد أصدقاء متاحين لبدء محادثة جديدة', 'error');
|
|
|
|
| 987 |
}
|
| 988 |
+
}
|
| 989 |
+
|
| 990 |
+
// الحصول على الوقت الحالي بتنسيق مناسب
|
| 991 |
+
function getCurrentTime() {
|
| 992 |
+
const now = new Date();
|
| 993 |
+
const hours = now.getHours();
|
| 994 |
+
const minutes = now.getMinutes();
|
| 995 |
+
const ampm = hours >= 12 ? 'م' : 'ص';
|
| 996 |
+
const formattedHours = hours % 12 || 12;
|
| 997 |
+
return `${formattedHours}:${minutes < 10 ? '0' + minutes : minutes} ${ampm}`;
|
| 998 |
+
}
|
| 999 |
+
|
| 1000 |
+
// توليد رد عشوائي
|
| 1001 |
+
function getRandomReply() {
|
| 1002 |
+
const replies = [
|
| 1003 |
+
"نعم، بالتأكيد!",
|
| 1004 |
+
"سأرد عليك لاحقًا",
|
| 1005 |
+
"شكرًا لك",
|
| 1006 |
+
"أنا مشغول الآن، سأتحدث معك لاحقًا",
|
| 1007 |
+
"حسنًا، فهمت",
|
| 1008 |
+
"ممتاز!",
|
| 1009 |
+
"هل يمكننا التحدث غدًا؟",
|
| 1010 |
+
"أنا موافق على ذلك",
|
| 1011 |
+
"هذا رائع!",
|
| 1012 |
+
"لا أعتقد أن هذا ممكن"
|
| 1013 |
+
];
|
| 1014 |
+
return replies[Math.floor(Math.random() * replies.length)];
|
| 1015 |
+
}
|
| 1016 |
+
|
| 1017 |
+
// عرض تنبيه
|
| 1018 |
+
function showAlert(message, type) {
|
| 1019 |
+
const alertDiv = document.createElement('div');
|
| 1020 |
+
alertDiv.style.position = 'fixed';
|
| 1021 |
+
alertDiv.style.top = '20px';
|
| 1022 |
+
alertDiv.style.left = '50%';
|
| 1023 |
+
alertDiv.style.transform = 'translateX(-50%)';
|
| 1024 |
+
alertDiv.style.padding = '10px 20px';
|
| 1025 |
+
alertDiv.style.borderRadius = '8px';
|
| 1026 |
+
alertDiv.style.color = 'white';
|
| 1027 |
+
alertDiv.style.fontWeight = '600';
|
| 1028 |
+
alertDiv.style.zIndex = '1000';
|
| 1029 |
+
alertDiv.style.boxShadow = '0 2px 10px rgba(0,0,0,0.2)';
|
| 1030 |
+
alertDiv.style.animation = 'fadeIn 0.3s, fadeOut 0.3s 2.7s';
|
| 1031 |
+
|
| 1032 |
+
if (type === 'success') {
|
| 1033 |
+
alertDiv.style.backgroundColor = 'var(--success-color)';
|
| 1034 |
+
} else if (type === 'error') {
|
| 1035 |
+
alertDiv.style.backgroundColor = 'var(--error-color)';
|
| 1036 |
+
} else {
|
| 1037 |
+
alertDiv.style.backgroundColor = 'var(--primary-color)';
|
| 1038 |
+
}
|
| 1039 |
+
|
| 1040 |
+
alertDiv.textContent = message;
|
| 1041 |
+
document.body.appendChild(alertDiv);
|
| 1042 |
+
|
| 1043 |
+
setTimeout(() => {
|
| 1044 |
+
document.body.removeChild(alertDiv);
|
| 1045 |
+
}, 3000);
|
| 1046 |
+
}
|
| 1047 |
|
| 1048 |
// تهيئة الصفحة عند التحميل
|
| 1049 |
+
window.addEventListener('DOMContentLoaded', initPage);
|
| 1050 |
</script>
|
| 1051 |
</body>
|
| 1052 |
</html>
|