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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="fa" dir="rtl">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>چت روم | پلتفرم گفتگوی آنلاین</title>
|
| 7 |
+
|
| 8 |
+
<!-- Google Fonts: Vazirmatn for Persian -->
|
| 9 |
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 10 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 11 |
+
<link href="https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;300;400;500;700;900&display=swap" rel="stylesheet">
|
| 12 |
+
|
| 13 |
+
<!-- Phosphor Icons -->
|
| 14 |
+
<script src="https://unpkg.com/@phosphor-icons/web"></script>
|
| 15 |
+
|
| 16 |
+
<style>
|
| 17 |
+
:root {
|
| 18 |
+
--primary: #6366f1;
|
| 19 |
+
--primary-dark: #4f46e5;
|
| 20 |
+
--secondary: #ec4899;
|
| 21 |
+
--bg: #0f172a;
|
| 22 |
+
--surface: #1e293b;
|
| 23 |
+
--surface-light: #334155;
|
| 24 |
+
--text: #f8fafc;
|
| 25 |
+
--text-muted: #94a3b8;
|
| 26 |
+
--success: #10b981;
|
| 27 |
+
--warning: #f59e0b;
|
| 28 |
+
--error: #ef4444;
|
| 29 |
+
--glass: rgba(30, 41, 59, 0.7);
|
| 30 |
+
--shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
|
| 31 |
+
--radius: 1rem;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
* {
|
| 35 |
+
margin: 0;
|
| 36 |
+
padding: 0;
|
| 37 |
+
box-sizing: border-box;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
body {
|
| 41 |
+
font-family: 'Vazirmatn', sans-serif;
|
| 42 |
+
background: var(--bg);
|
| 43 |
+
color: var(--text);
|
| 44 |
+
min-height: 100vh;
|
| 45 |
+
overflow-x: hidden;
|
| 46 |
+
line-height: 1.6;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
/* Animated Background */
|
| 50 |
+
.bg-animation {
|
| 51 |
+
position: fixed;
|
| 52 |
+
top: 0;
|
| 53 |
+
left: 0;
|
| 54 |
+
width: 100%;
|
| 55 |
+
height: 100%;
|
| 56 |
+
z-index: -1;
|
| 57 |
+
background:
|
| 58 |
+
radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
|
| 59 |
+
radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
|
| 60 |
+
radial-gradient(circle at 40% 20%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
|
| 61 |
+
filter: blur(60px);
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
/* Scrollbar */
|
| 65 |
+
::-webkit-scrollbar {
|
| 66 |
+
width: 8px;
|
| 67 |
+
}
|
| 68 |
+
::-webkit-scrollbar-track {
|
| 69 |
+
background: var(--bg);
|
| 70 |
+
}
|
| 71 |
+
::-webkit-scrollbar-thumb {
|
| 72 |
+
background: var(--surface-light);
|
| 73 |
+
border-radius: 4px;
|
| 74 |
+
}
|
| 75 |
+
::-webkit-scrollbar-thumb:hover {
|
| 76 |
+
background: var(--primary);
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
/* Layout */
|
| 80 |
+
.container {
|
| 81 |
+
max-width: 1200px;
|
| 82 |
+
margin: 0 auto;
|
| 83 |
+
padding: 1rem;
|
| 84 |
+
min-height: 100vh;
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
.hidden {
|
| 88 |
+
display: none !important;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
/* Header */
|
| 92 |
+
header {
|
| 93 |
+
display: flex;
|
| 94 |
+
justify-content: space-between;
|
| 95 |
+
align-items: center;
|
| 96 |
+
padding: 1rem 2rem;
|
| 97 |
+
background: var(--glass);
|
| 98 |
+
backdrop-filter: blur(12px);
|
| 99 |
+
border-bottom: 1px solid rgba(255,255,255,0.1);
|
| 100 |
+
position: sticky;
|
| 101 |
+
top: 0;
|
| 102 |
+
z-index: 100;
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
.logo {
|
| 106 |
+
display: flex;
|
| 107 |
+
align-items: center;
|
| 108 |
+
gap: 0.5rem;
|
| 109 |
+
font-size: 1.5rem;
|
| 110 |
+
font-weight: 900;
|
| 111 |
+
background: linear-gradient(135deg, var(--primary), var(--secondary));
|
| 112 |
+
-webkit-background-clip: text;
|
| 113 |
+
-webkit-text-fill-color: transparent;
|
| 114 |
+
text-decoration: none;
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
.nav-links {
|
| 118 |
+
display: flex;
|
| 119 |
+
gap: 2rem;
|
| 120 |
+
align-items: center;
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
.nav-links a {
|
| 124 |
+
color: var(--text-muted);
|
| 125 |
+
text-decoration: none;
|
| 126 |
+
font-weight: 500;
|
| 127 |
+
transition: all 0.3s;
|
| 128 |
+
display: flex;
|
| 129 |
+
align-items: center;
|
| 130 |
+
gap: 0.5rem;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
.nav-links a:hover {
|
| 134 |
+
color: var(--text);
|
| 135 |
+
transform: translateY(-2px);
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
.user-menu {
|
| 139 |
+
display: flex;
|
| 140 |
+
align-items: center;
|
| 141 |
+
gap: 1rem;
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
.avatar-small {
|
| 145 |
+
width: 40px;
|
| 146 |
+
height: 40px;
|
| 147 |
+
border-radius: 50%;
|
| 148 |
+
background: var(--surface);
|
| 149 |
+
display: flex;
|
| 150 |
+
align-items: center;
|
| 151 |
+
justify-content: center;
|
| 152 |
+
font-size: 1.5rem;
|
| 153 |
+
border: 2px solid var(--primary);
|
| 154 |
+
cursor: pointer;
|
| 155 |
+
transition: transform 0.3s;
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
.avatar-small:hover {
|
| 159 |
+
transform: scale(1.1);
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
/* Buttons */
|
| 163 |
+
.btn {
|
| 164 |
+
padding: 0.75rem 1.5rem;
|
| 165 |
+
border: none;
|
| 166 |
+
border-radius: var(--radius);
|
| 167 |
+
font-family: inherit;
|
| 168 |
+
font-weight: 600;
|
| 169 |
+
cursor: pointer;
|
| 170 |
+
transition: all 0.3s;
|
| 171 |
+
display: inline-flex;
|
| 172 |
+
align-items: center;
|
| 173 |
+
justify-content: center;
|
| 174 |
+
gap: 0.5rem;
|
| 175 |
+
font-size: 1rem;
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
.btn-primary {
|
| 179 |
+
background: linear-gradient(135deg, var(--primary), var(--primary-dark));
|
| 180 |
+
color: white;
|
| 181 |
+
box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
.btn-primary:hover {
|
| 185 |
+
transform: translateY(-2px);
|
| 186 |
+
box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
.btn-secondary {
|
| 190 |
+
background: var(--surface);
|
| 191 |
+
color: var(--text);
|
| 192 |
+
border: 1px solid var(--surface-light);
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
.btn-secondary:hover {
|
| 196 |
+
background: var(--surface-light);
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
.btn-danger {
|
| 200 |
+
background: rgba(239, 68, 68, 0.2);
|
| 201 |
+
color: var(--error);
|
| 202 |
+
border: 1px solid var(--error);
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
.btn-danger:hover {
|
| 206 |
+
background: var(--error);
|
| 207 |
+
color: white;
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
+
.btn-ghost {
|
| 211 |
+
background: transparent;
|
| 212 |
+
color: var(--text-muted);
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
.btn-ghost:hover {
|
| 216 |
+
color: var(--text);
|
| 217 |
+
background: rgba(255,255,255,0.05);
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
/* Cards */
|
| 221 |
+
.card {
|
| 222 |
+
background: var(--glass);
|
| 223 |
+
backdrop-filter: blur(12px);
|
| 224 |
+
border: 1px solid rgba(255,255,255,0.1);
|
| 225 |
+
border-radius: var(--radius);
|
| 226 |
+
padding: 2rem;
|
| 227 |
+
box-shadow: var(--shadow);
|
| 228 |
+
}
|
| 229 |
+
|
| 230 |
+
/* Forms */
|
| 231 |
+
.form-group {
|
| 232 |
+
margin-bottom: 1.5rem;
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
.form-group label {
|
| 236 |
+
display: block;
|
| 237 |
+
margin-bottom: 0.5rem;
|
| 238 |
+
color: var(--text-muted);
|
| 239 |
+
font-weight: 500;
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
.form-control {
|
| 243 |
+
width: 100%;
|
| 244 |
+
padding: 0.75rem 1rem;
|
| 245 |
+
background: var(--surface);
|
| 246 |
+
border: 1px solid var(--surface-light);
|
| 247 |
+
border-radius: var(--radius);
|
| 248 |
+
color: var(--text);
|
| 249 |
+
font-family: inherit;
|
| 250 |
+
font-size: 1rem;
|
| 251 |
+
transition: all 0.3s;
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
.form-control:focus {
|
| 255 |
+
outline: none;
|
| 256 |
+
border-color: var(--primary);
|
| 257 |
+
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
|
| 258 |
+
}
|
| 259 |
+
|
| 260 |
+
/* Landing Page */
|
| 261 |
+
.hero {
|
| 262 |
+
min-height: 80vh;
|
| 263 |
+
display: flex;
|
| 264 |
+
flex-direction: column;
|
| 265 |
+
justify-content: center;
|
| 266 |
+
align-items: center;
|
| 267 |
+
text-align: center;
|
| 268 |
+
padding: 2rem;
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
.hero h1 {
|
| 272 |
+
font-size: clamp(2.5rem, 8vw, 4rem);
|
| 273 |
+
font-weight: 900;
|
| 274 |
+
margin-bottom: 1rem;
|
| 275 |
+
line-height: 1.2;
|
| 276 |
+
}
|
| 277 |
+
|
| 278 |
+
.hero h1 span {
|
| 279 |
+
background: linear-gradient(135deg, var(--primary), var(--secondary));
|
| 280 |
+
-webkit-background-clip: text;
|
| 281 |
+
-webkit-text-fill-color: transparent;
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
.hero p {
|
| 285 |
+
font-size: 1.25rem;
|
| 286 |
+
color: var(--text-muted);
|
| 287 |
+
max-width: 600px;
|
| 288 |
+
margin-bottom: 2rem;
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
.features {
|
| 292 |
+
display: grid;
|
| 293 |
+
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
| 294 |
+
gap: 2rem;
|
| 295 |
+
margin-top: 4rem;
|
| 296 |
+
width: 100%;
|
| 297 |
+
max-width: 1000px;
|
| 298 |
+
}
|
| 299 |
+
|
| 300 |
+
.feature-card {
|
| 301 |
+
background: var(--glass);
|
| 302 |
+
padding: 2rem;
|
| 303 |
+
border-radius: var(--radius);
|
| 304 |
+
border: 1px solid rgba(255,255,255,0.1);
|
| 305 |
+
transition: transform 0.3s;
|
| 306 |
+
}
|
| 307 |
+
|
| 308 |
+
.feature-card:hover {
|
| 309 |
+
transform: translateY(-5px);
|
| 310 |
+
border-color: var(--primary);
|
| 311 |
+
}
|
| 312 |
+
|
| 313 |
+
.feature-card i {
|
| 314 |
+
font-size: 2.5rem;
|
| 315 |
+
color: var(--primary);
|
| 316 |
+
margin-bottom: 1rem;
|
| 317 |
+
}
|
| 318 |
+
|
| 319 |
+
/* Auth Pages */
|
| 320 |
+
.auth-container {
|
| 321 |
+
min-height: 80vh;
|
| 322 |
+
display: flex;
|
| 323 |
+
align-items: center;
|
| 324 |
+
justify-content: center;
|
| 325 |
+
padding: 2rem;
|
| 326 |
+
}
|
| 327 |
+
|
| 328 |
+
.auth-box {
|
| 329 |
+
width: 100%;
|
| 330 |
+
max-width: 450px;
|
| 331 |
+
}
|
| 332 |
+
|
| 333 |
+
.auth-header {
|
| 334 |
+
text-align: center;
|
| 335 |
+
margin-bottom: 2rem;
|
| 336 |
+
}
|
| 337 |
+
|
| 338 |
+
.auth-header h2 {
|
| 339 |
+
font-size: 2rem;
|
| 340 |
+
margin-bottom: 0.5rem;
|
| 341 |
+
}
|
| 342 |
+
|
| 343 |
+
.auth-header p {
|
| 344 |
+
color: var(--text-muted);
|
| 345 |
+
}
|
| 346 |
+
|
| 347 |
+
/* Rooms Grid */
|
| 348 |
+
.rooms-grid {
|
| 349 |
+
display: grid;
|
| 350 |
+
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
| 351 |
+
gap: 1.5rem;
|
| 352 |
+
margin-top: 2rem;
|
| 353 |
+
}
|
| 354 |
+
|
| 355 |
+
.room-card {
|
| 356 |
+
background: var(--surface);
|
| 357 |
+
border-radius: var(--radius);
|
| 358 |
+
padding: 1.5rem;
|
| 359 |
+
border: 1px solid var(--surface-light);
|
| 360 |
+
transition: all 0.3s;
|
| 361 |
+
position: relative;
|
| 362 |
+
overflow: hidden;
|
| 363 |
+
}
|
| 364 |
+
|
| 365 |
+
.room-card::before {
|
| 366 |
+
content: '';
|
| 367 |
+
position: absolute;
|
| 368 |
+
top: 0;
|
| 369 |
+
left: 0;
|
| 370 |
+
width: 100%;
|
| 371 |
+
height: 4px;
|
| 372 |
+
background: linear-gradient(90deg, var(--primary), var(--secondary));
|
| 373 |
+
transform: scaleX(0);
|
| 374 |
+
transition: transform 0.3s;
|
| 375 |
+
}
|
| 376 |
+
|
| 377 |
+
.room-card:hover::before {
|
| 378 |
+
transform: scaleX(1);
|
| 379 |
+
}
|
| 380 |
+
|
| 381 |
+
.room-card:hover {
|
| 382 |
+
transform: translateY(-3px);
|
| 383 |
+
border-color: var(--primary);
|
| 384 |
+
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
|
| 385 |
+
}
|
| 386 |
+
|
| 387 |
+
.room-header {
|
| 388 |
+
display: flex;
|
| 389 |
+
justify-content: space-between;
|
| 390 |
+
align-items: start;
|
| 391 |
+
margin-bottom: 1rem;
|
| 392 |
+
}
|
| 393 |
+
|
| 394 |
+
.room-title {
|
| 395 |
+
font-size: 1.25rem;
|
| 396 |
+
font-weight: 700;
|
| 397 |
+
}
|
| 398 |
+
|
| 399 |
+
.room-meta {
|
| 400 |
+
display: flex;
|
| 401 |
+
gap: 1rem;
|
| 402 |
+
color: var(--text-muted);
|
| 403 |
+
font-size: 0.875rem;
|
| 404 |
+
margin-bottom: 1rem;
|
| 405 |
+
}
|
| 406 |
+
|
| 407 |
+
.room-actions {
|
| 408 |
+
display: flex;
|
| 409 |
+
gap: 0.5rem;
|
| 410 |
+
margin-top: 1rem;
|
| 411 |
+
}
|
| 412 |
+
|
| 413 |
+
.btn-small {
|
| 414 |
+
padding: 0.5rem 1rem;
|
| 415 |
+
font-size: 0.875rem;
|
| 416 |
+
}
|
| 417 |
+
|
| 418 |
+
/* Chat Layout */
|
| 419 |
+
.chat-container {
|
| 420 |
+
display: grid;
|
| 421 |
+
grid-template-columns: 300px 1fr;
|
| 422 |
+
height: calc(100vh - 80px);
|
| 423 |
+
gap: 1rem;
|
| 424 |
+
padding: 1rem;
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
.sidebar {
|
| 428 |
+
background: var(--glass);
|
| 429 |
+
backdrop-filter: blur(12px);
|
| 430 |
+
border-radius: var(--radius);
|
| 431 |
+
border: 1px solid rgba(255,255,255,0.1);
|
| 432 |
+
display: flex;
|
| 433 |
+
flex-direction: column;
|
| 434 |
+
overflow: hidden;
|
| 435 |
+
}
|
| 436 |
+
|
| 437 |
+
.sidebar-header {
|
| 438 |
+
padding: 1.5rem;
|
| 439 |
+
border-bottom: 1px solid rgba(255,255,255,0.1);
|
| 440 |
+
}
|
| 441 |
+
|
| 442 |
+
.users-list {
|
| 443 |
+
flex: 1;
|
| 444 |
+
overflow-y: auto;
|
| 445 |
+
padding: 1rem;
|
| 446 |
+
}
|
| 447 |
+
|
| 448 |
+
.user-item {
|
| 449 |
+
display: flex;
|
| 450 |
+
align-items: center;
|
| 451 |
+
gap: 0.75rem;
|
| 452 |
+
padding: 0.75rem;
|
| 453 |
+
border-radius: 0.5rem;
|
| 454 |
+
margin-bottom: 0.5rem;
|
| 455 |
+
transition: background 0.3s;
|
| 456 |
+
}
|
| 457 |
+
|
| 458 |
+
.user-item:hover {
|
| 459 |
+
background: rgba(255,255,255,0.05);
|
| 460 |
+
}
|
| 461 |
+
|
| 462 |
+
.user-item .avatar {
|
| 463 |
+
width: 40px;
|
| 464 |
+
height: 40px;
|
| 465 |
+
border-radius: 50%;
|
| 466 |
+
background: var(--surface-light);
|
| 467 |
+
display: flex;
|
| 468 |
+
align-items: center;
|
| 469 |
+
justify-content: center;
|
| 470 |
+
font-size: 1.25rem;
|
| 471 |
+
}
|
| 472 |
+
|
| 473 |
+
.user-item .info {
|
| 474 |
+
flex: 1;
|
| 475 |
+
}
|
| 476 |
+
|
| 477 |
+
.user-item .name {
|
| 478 |
+
font-weight: 600;
|
| 479 |
+
font-size: 0.9rem;
|
| 480 |
+
}
|
| 481 |
+
|
| 482 |
+
.user-item .status {
|
| 483 |
+
font-size: 0.75rem;
|
| 484 |
+
color: var(--success);
|
| 485 |
+
display: flex;
|
| 486 |
+
align-items: center;
|
| 487 |
+
gap: 0.25rem;
|
| 488 |
+
}
|
| 489 |
+
|
| 490 |
+
.chat-area {
|
| 491 |
+
background: var(--glass);
|
| 492 |
+
backdrop-filter: blur(12px);
|
| 493 |
+
border-radius: var(--radius);
|
| 494 |
+
border: 1px solid rgba(255,255,255,0.1);
|
| 495 |
+
display: flex;
|
| 496 |
+
flex-direction: column;
|
| 497 |
+
overflow: hidden;
|
| 498 |
+
}
|
| 499 |
+
|
| 500 |
+
.chat-header {
|
| 501 |
+
padding: 1rem 1.5rem;
|
| 502 |
+
border-bottom: 1px solid rgba(255,255,255,0.1);
|
| 503 |
+
display: flex;
|
| 504 |
+
justify-content: space-between;
|
| 505 |
+
align-items: center;
|
| 506 |
+
}
|
| 507 |
+
|
| 508 |
+
.chat-messages {
|
| 509 |
+
flex: 1;
|
| 510 |
+
overflow-y: auto;
|
| 511 |
+
padding: 1.5rem;
|
| 512 |
+
display: flex;
|
| 513 |
+
flex-direction: column;
|
| 514 |
+
gap: 1rem;
|
| 515 |
+
}
|
| 516 |
+
|
| 517 |
+
.message {
|
| 518 |
+
max-width: 70%;
|
| 519 |
+
padding: 1rem;
|
| 520 |
+
border-radius: var(--radius);
|
| 521 |
+
position: relative;
|
| 522 |
+
animation: messageSlide 0.3s ease-out;
|
| 523 |
+
}
|
| 524 |
+
|
| 525 |
+
@keyframes messageSlide {
|
| 526 |
+
from {
|
| 527 |
+
opacity: 0;
|
| 528 |
+
transform: translateY(10px);
|
| 529 |
+
}
|
| 530 |
+
to {
|
| 531 |
+
opacity: 1;
|
| 532 |
+
transform: translateY(0);
|
| 533 |
+
}
|
| 534 |
+
}
|
| 535 |
+
|
| 536 |
+
.message.own {
|
| 537 |
+
align-self: flex-end;
|
| 538 |
+
background: linear-gradient(135deg, var(--primary), var(--primary-dark));
|
| 539 |
+
color: white;
|
| 540 |
+
border-bottom-right-radius: 0.25rem;
|
| 541 |
+
}
|
| 542 |
+
|
| 543 |
+
.message.other {
|
| 544 |
+
align-self: flex-start;
|
| 545 |
+
background: var(--surface);
|
| 546 |
+
border-bottom-left-radius: 0.25rem;
|
| 547 |
+
}
|
| 548 |
+
|
| 549 |
+
.message-header {
|
| 550 |
+
display: flex;
|
| 551 |
+
align-items: center;
|
| 552 |
+
gap: 0.5rem;
|
| 553 |
+
margin-bottom: 0.5rem;
|
| 554 |
+
font-size: 0.875rem;
|
| 555 |
+
opacity: 0.9;
|
| 556 |
+
}
|
| 557 |
+
|
| 558 |
+
.message-text {
|
| 559 |
+
line-height: 1.5;
|
| 560 |
+
}
|
| 561 |
+
|
| 562 |
+
.message-time {
|
| 563 |
+
font-size: 0.75rem;
|
| 564 |
+
opacity: 0.7;
|
| 565 |
+
margin-top: 0.5rem;
|
| 566 |
+
text-align: left;
|
| 567 |
+
}
|
| 568 |
+
|
| 569 |
+
.chat-input-area {
|
| 570 |
+
padding: 1rem 1.5rem;
|
| 571 |
+
border-top: 1px solid rgba(255,255,255,0.1);
|
| 572 |
+
display: flex;
|
| 573 |
+
gap: 0.75rem;
|
| 574 |
+
}
|
| 575 |
+
|
| 576 |
+
.chat-input {
|
| 577 |
+
flex: 1;
|
| 578 |
+
background: var(--surface);
|
| 579 |
+
border: 1px solid var(--surface-light);
|
| 580 |
+
border-radius: 2rem;
|
| 581 |
+
padding: 0.75rem 1.25rem;
|
| 582 |
+
color: var(--text);
|
| 583 |
+
font-family: inherit;
|
| 584 |
+
font-size: 1rem;
|
| 585 |
+
transition: all 0.3s;
|
| 586 |
+
}
|
| 587 |
+
|
| 588 |
+
.chat-input:focus {
|
| 589 |
+
outline: none;
|
| 590 |
+
border-color: var(--primary);
|
| 591 |
+
}
|
| 592 |
+
|
| 593 |
+
.btn-icon {
|
| 594 |
+
width: 48px;
|
| 595 |
+
height: 48px;
|
| 596 |
+
border-radius: 50%;
|
| 597 |
+
display: flex;
|
| 598 |
+
align-items: center;
|
| 599 |
+
justify-content: center;
|
| 600 |
+
padding: 0;
|
| 601 |
+
}
|
| 602 |
+
|
| 603 |
+
/* Settings */
|
| 604 |
+
.settings-grid {
|
| 605 |
+
display: grid;
|
| 606 |
+
grid-template-columns: 250px 1fr;
|
| 607 |
+
gap: 2rem;
|
| 608 |
+
max-width: 900px;
|
| 609 |
+
margin: 2rem auto;
|
| 610 |
+
}
|
| 611 |
+
|
| 612 |
+
.settings-nav {
|
| 613 |
+
display: flex;
|
| 614 |
+
flex-direction: column;
|
| 615 |
+
gap: 0.5rem;
|
| 616 |
+
}
|
| 617 |
+
|
| 618 |
+
.settings-nav-item {
|
| 619 |
+
padding: 1rem;
|
| 620 |
+
border-radius: var(--radius);
|
| 621 |
+
cursor: pointer;
|
| 622 |
+
transition: all 0.3s;
|
| 623 |
+
display: flex;
|
| 624 |
+
align-items: center;
|
| 625 |
+
gap: 0.75rem;
|
| 626 |
+
color: var(--text-muted);
|
| 627 |
+
}
|
| 628 |
+
|
| 629 |
+
.settings-nav-item:hover,
|
| 630 |
+
.settings-nav-item.active {
|
| 631 |
+
background: var(--surface);
|
| 632 |
+
color: var(--text);
|
| 633 |
+
}
|
| 634 |
+
|
| 635 |
+
.settings-nav-item.active {
|
| 636 |
+
background: var(--primary);
|
| 637 |
+
color: white;
|
| 638 |
+
}
|
| 639 |
+
|
| 640 |
+
.settings-content {
|
| 641 |
+
background: var(--glass);
|
| 642 |
+
backdrop-filter: blur(12px);
|
| 643 |
+
border-radius: var(--radius);
|
| 644 |
+
padding: 2rem;
|
| 645 |
+
border: 1px solid rgba(255,255,255,0.1);
|
| 646 |
+
}
|
| 647 |
+
|
| 648 |
+
.avatar-selector {
|
| 649 |
+
display: grid;
|
| 650 |
+
grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
|
| 651 |
+
gap: 1rem;
|
| 652 |
+
margin-top: 1rem;
|
| 653 |
+
}
|
| 654 |
+
|
| 655 |
+
.avatar-option {
|
| 656 |
+
aspect-ratio: 1;
|
| 657 |
+
background: var(--surface);
|
| 658 |
+
border-radius: 1rem;
|
| 659 |
+
display: flex;
|
| 660 |
+
align-items: center;
|
| 661 |
+
justify-content: center;
|
| 662 |
+
font-size: 2.5rem;
|
| 663 |
+
cursor: pointer;
|
| 664 |
+
border: 2px solid transparent;
|
| 665 |
+
transition: all 0.3s;
|
| 666 |
+
}
|
| 667 |
+
|
| 668 |
+
.avatar-option:hover {
|
| 669 |
+
transform: scale(1.1);
|
| 670 |
+
border-color: var(--primary);
|
| 671 |
+
}
|
| 672 |
+
|
| 673 |
+
.avatar-option.selected {
|
| 674 |
+
border-color: var(--primary);
|
| 675 |
+
background: rgba(99, 102, 241, 0.2);
|
| 676 |
+
box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
|
| 677 |
+
}
|
| 678 |
+
|
| 679 |
+
/* Toast Notifications */
|
| 680 |
+
.toast-container {
|
| 681 |
+
position: fixed;
|
| 682 |
+
top: 100px;
|
| 683 |
+
left: 2rem;
|
| 684 |
+
z-index: 1000;
|
| 685 |
+
display: flex;
|
| 686 |
+
flex-direction: column;
|
| 687 |
+
gap: 0.5rem;
|
| 688 |
+
}
|
| 689 |
+
|
| 690 |
+
.toast {
|
| 691 |
+
background: var(--surface);
|
| 692 |
+
color: var(--text);
|
| 693 |
+
padding: 1rem 1.5rem;
|
| 694 |
+
border-radius: var(--radius);
|
| 695 |
+
border-right: 4px solid var(--primary);
|
| 696 |
+
box-shadow: var(--shadow);
|
| 697 |
+
display: flex;
|
| 698 |
+
align-items: center;
|
| 699 |
+
gap: 0.75rem;
|
| 700 |
+
animation: slideIn 0.3s ease-out;
|
| 701 |
+
min-width: 300px;
|
| 702 |
+
}
|
| 703 |
+
|
| 704 |
+
.toast.success { border-right-color: var(--success); }
|
| 705 |
+
.toast.error { border-right-color: var(--error); }
|
| 706 |
+
.toast.warning { border-right-color: var(--warning); }
|
| 707 |
+
|
| 708 |
+
@keyframes slideIn {
|
| 709 |
+
from {
|
| 710 |
+
transform: translateX(-100%);
|
| 711 |
+
opacity: 0;
|
| 712 |
+
}
|
| 713 |
+
to {
|
| 714 |
+
transform: translateX(0);
|
| 715 |
+
opacity: 1;
|
| 716 |
+
}
|
| 717 |
+
}
|
| 718 |
+
|
| 719 |
+
/* Responsive */
|
| 720 |
+
@media (max-width: 768px) {
|
| 721 |
+
.chat-container {
|
| 722 |
+
grid-template-columns: 1fr;
|
| 723 |
+
}
|
| 724 |
+
|
| 725 |
+
.sidebar {
|
| 726 |
+
display: none;
|
| 727 |
+
}
|
| 728 |
+
|
| 729 |
+
.settings-grid {
|
| 730 |
+
grid-template-columns: 1fr;
|
| 731 |
+
}
|
| 732 |
+
|
| 733 |
+
.nav-links {
|
| 734 |
+
display: none;
|
| 735 |
+
}
|
| 736 |
+
|
| 737 |
+
.message {
|
| 738 |
+
max-width: 85%;
|
| 739 |
+
}
|
| 740 |
+
}
|
| 741 |
+
|
| 742 |
+
/* Empty State */
|
| 743 |
+
.empty-state {
|
| 744 |
+
text-align: center;
|
| 745 |
+
padding: 4rem 2rem;
|
| 746 |
+
color: var(--text-muted);
|
| 747 |
+
}
|
| 748 |
+
|
| 749 |
+
.empty-state i {
|
| 750 |
+
font-size: 4rem;
|
| 751 |
+
margin-bottom: 1rem;
|
| 752 |
+
opacity: 0.5;
|
| 753 |
+
}
|
| 754 |
+
|
| 755 |
+
/* Modal */
|
| 756 |
+
.modal-overlay {
|
| 757 |
+
position: fixed;
|
| 758 |
+
top: 0;
|
| 759 |
+
left: 0;
|
| 760 |
+
width: 100%;
|
| 761 |
+
height: 100%;
|
| 762 |
+
background: rgba(0,0,0,0.8);
|
| 763 |
+
backdrop-filter: blur(5px);
|
| 764 |
+
display: flex;
|
| 765 |
+
align-items: center;
|
| 766 |
+
justify-content: center;
|
| 767 |
+
z-index: 1000;
|
| 768 |
+
opacity: 0;
|
| 769 |
+
visibility: hidden;
|
| 770 |
+
transition: all 0.3s;
|
| 771 |
+
}
|
| 772 |
+
|
| 773 |
+
.modal-overlay.active {
|
| 774 |
+
opacity: 1;
|
| 775 |
+
visibility: visible;
|
| 776 |
+
}
|
| 777 |
+
|
| 778 |
+
.modal {
|
| 779 |
+
background: var(--surface);
|
| 780 |
+
border-radius: var(--radius);
|
| 781 |
+
padding: 2rem;
|
| 782 |
+
width: 90%;
|
| 783 |
+
max-width: 500px;
|
| 784 |
+
transform: scale(0.9);
|
| 785 |
+
transition: transform 0.3s;
|
| 786 |
+
}
|
| 787 |
+
|
| 788 |
+
.modal-overlay.active .modal {
|
| 789 |
+
transform: scale(1);
|
| 790 |
+
}
|
| 791 |
+
|
| 792 |
+
.modal-header {
|
| 793 |
+
display: flex;
|
| 794 |
+
justify-content: space-between;
|
| 795 |
+
align-items: center;
|
| 796 |
+
margin-bottom: 1.5rem;
|
| 797 |
+
}
|
| 798 |
+
|
| 799 |
+
.modal-header h3 {
|
| 800 |
+
font-size: 1.5rem;
|
| 801 |
+
}
|
| 802 |
+
|
| 803 |
+
.close-btn {
|
| 804 |
+
background: none;
|
| 805 |
+
border: none;
|
| 806 |
+
color: var(--text-muted);
|
| 807 |
+
font-size: 1.5rem;
|
| 808 |
+
cursor: pointer;
|
| 809 |
+
transition: color 0.3s;
|
| 810 |
+
}
|
| 811 |
+
|
| 812 |
+
.close-btn:hover {
|
| 813 |
+
color: var(--text);
|
| 814 |
+
}
|
| 815 |
+
|
| 816 |
+
/* Built with anycoder */
|
| 817 |
+
.built-with {
|
| 818 |
+
position: fixed;
|
| 819 |
+
bottom: 1rem;
|
| 820 |
+
left: 1rem;
|
| 821 |
+
background: rgba(99, 102, 241, 0.2);
|
| 822 |
+
color: var(--primary);
|
| 823 |
+
padding: 0.5rem 1rem;
|
| 824 |
+
border-radius: 2rem;
|
| 825 |
+
font-size: 0.875rem;
|
| 826 |
+
text-decoration: none;
|
| 827 |
+
border: 1px solid rgba(99, 102, 241, 0.3);
|
| 828 |
+
transition: all 0.3s;
|
| 829 |
+
z-index: 50;
|
| 830 |
+
}
|
| 831 |
+
|
| 832 |
+
.built-with:hover {
|
| 833 |
+
background: var(--primary);
|
| 834 |
+
color: white;
|
| 835 |
+
transform: translateY(-2px);
|
| 836 |
+
}
|
| 837 |
+
</style>
|
| 838 |
+
</head>
|
| 839 |
+
<body>
|
| 840 |
+
<div class="bg-animation"></div>
|
| 841 |
+
|
| 842 |
+
<!-- Toast Container -->
|
| 843 |
+
<div class="toast-container" id="toastContainer"></div>
|
| 844 |
+
|
| 845 |
+
<!-- Header -->
|
| 846 |
+
<header id="mainHeader" class="hidden">
|
| 847 |
+
<a href="#" class="logo" onclick="router.navigate('home')">
|
| 848 |
+
<i class="ph ph-chat-circle-text"></i>
|
| 849 |
+
<span>چت روم</span>
|
| 850 |
+
</a>
|
| 851 |
+
|
| 852 |
+
<nav class="nav-links">
|
| 853 |
+
<a href="#" onclick="router.navigate('rooms')">
|
| 854 |
+
<i class="ph ph-house"></i>
|
| 855 |
+
رومهای من
|
| 856 |
+
</a>
|
| 857 |
+
<a href="#" onclick="router.navigate('settings')">
|
| 858 |
+
<i class="ph ph-gear"></i>
|
| 859 |
+
تنظیمات
|
| 860 |
+
</a>
|
| 861 |
+
</nav>
|
| 862 |
+
|
| 863 |
+
<div class="user-menu">
|
| 864 |
+
<span id="userNameDisplay"></span>
|
| 865 |
+
<div class="avatar-small" id="headerAvatar" onclick="router.navigate('settings')"></div>
|
| 866 |
+
<button class="btn btn-ghost" onclick="auth.logout()">
|
| 867 |
+
<i class="ph ph-sign-out"></i>
|
| 868 |
+
</button>
|
| 869 |
+
</div>
|
| 870 |
+
</header>
|
| 871 |
+
|
| 872 |
+
<!-- Main Container -->
|
| 873 |
+
<div class="container">
|
| 874 |
+
|
| 875 |
+
<!-- Landing Page -->
|
| 876 |
+
<section id="page-home" class="page">
|
| 877 |
+
<div class="hero">
|
| 878 |
+
<h1>به <span>چت روم</span> خوش آمدید</h1>
|
| 879 |
+
<p>پلتفرم گفتگوی آنلاین با قابلیت ایجاد رومهای خصوصی، اشتراکگذاری لینک و چت لحظهای با دوستان</p>
|
| 880 |
+
|
| 881 |
+
<div style="display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center;">
|
| 882 |
+
<button class="btn btn-primary btn-lg" onclick="router.navigate('register')">
|
| 883 |
+
<i class="ph ph-user-plus"></i>
|
| 884 |
+
شروع کنید
|
| 885 |
+
</button>
|
| 886 |
+
<button class="btn btn-secondary" onclick="document.getElementById('features').scrollIntoView({behavior: 'smooth'})">
|
| 887 |
+
<i class="ph ph-info"></i>
|
| 888 |
+
بیشتر بدانید
|
| 889 |
+
</button>
|
| 890 |
+
</div>
|
| 891 |
+
|
| 892 |
+
<div class="features" id="features">
|
| 893 |
+
<div class="feature-card">
|
| 894 |
+
<i class="ph ph-lock-key"></i>
|
| 895 |
+
<h3>امنیت بالا</h3>
|
| 896 |
+
<p>ورود با شماره تلفن و رمز عبور امن</p>
|
| 897 |
+
</div>
|
| 898 |
+
<div class="feature-card">
|
| 899 |
+
<i class="ph ph-users-three"></i>
|
| 900 |
+
<h3>رومهای خصوصی</h3>
|
| 901 |
+
<p>تا ۳ روم خصوصی ایجاد کنید و لینک را به اشتراک بگذارید</p>
|
| 902 |
+
</div>
|
| 903 |
+
<div class="feature-card">
|
| 904 |
+
<i class="ph ph-lightning"></i>
|
| 905 |
+
<h3>چت لحظهای</h3>
|
| 906 |
+
<p>گفتگوی آنلاین بدون تأخیر با کاربران</p>
|
| 907 |
+
</div>
|
| 908 |
+
</div>
|
| 909 |
+
|
| 910 |
+
<a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="built-with">Built with anycoder</a>
|
| 911 |
+
</div>
|
| 912 |
+
</section>
|
| 913 |
+
|
| 914 |
+
<!-- Register Page -->
|
| 915 |
+
<section id="page-register" class="page hidden">
|
| 916 |
+
<div class="auth-container">
|
| 917 |
+
<div class="auth-box card">
|
| 918 |
+
<div class="auth-header">
|
| 919 |
+
<h2>ثبت نام</h2>
|
| 920 |
+
<p>برای استفاده از چت روم ثبت نام کنید</p>
|
| 921 |
+
</div>
|
| 922 |
+
|
| 923 |
+
<form id="registerForm" onsubmit="auth.register(event)">
|
| 924 |
+
<div class="form-group">
|
| 925 |
+
<label>شماره تلفن</label>
|
| 926 |
+
<input type="tel" class="form-control" id="regPhone" placeholder="مثال: 09123456789" required pattern="09[0-9]{9}">
|
| 927 |
+
</div>
|
| 928 |
+
|
| 929 |
+
<div class="form-group">
|
| 930 |
+
<label>رمز عبور</label>
|
| 931 |
+
<input type="password" class="form-control" id="regPassword" placeholder="حداقل ۶ کاراکتر" required minlength="6">
|
| 932 |
+
</div>
|
| 933 |
+
|
| 934 |
+
<div class="form-group">
|
| 935 |
+
<label>نام نمایشی</label>
|
| 936 |
+
<input type="text" class="form-control" id="regName" placeholder="نام شما در چت" required>
|
| 937 |
+
</div>
|
| 938 |
+
|
| 939 |
+
<button type="submit" class="btn btn-primary" style="width: 100%;">
|
| 940 |
+
<i class="ph ph-user-plus"></i>
|
| 941 |
+
ثبت نام
|
| 942 |
+
</button>
|
| 943 |
+
</form>
|
| 944 |
+
|
| 945 |
+
<div style="text-align: center; margin-top: 1.5rem; color: var(--text-muted);">
|
| 946 |
+
قبلاً ثبت نام کردهاید؟
|
| 947 |
+
<a href="#" onclick="router.navigate('login')" style="color: var(--primary); text-decoration: none;">وارد شوید</a>
|
| 948 |
+
</div>
|
| 949 |
+
</div>
|
| 950 |
+
</div>
|
| 951 |
+
</section>
|
| 952 |
+
|
| 953 |
+
<!-- Login Page -->
|
| 954 |
+
<section id="page-login" class="page hidden">
|
| 955 |
+
<div class="auth-container">
|
| 956 |
+
<div class="auth-box card">
|
| 957 |
+
<div class="auth-header">
|
| 958 |
+
<h2>ورود</h2>
|
| 959 |
+
<p>وارد حساب کاربری خود شوید</p>
|
| 960 |
+
</div>
|
| 961 |
+
|
| 962 |
+
<form id="loginForm" onsubmit="auth.login(event)">
|
| 963 |
+
<div class="form-group">
|
| 964 |
+
<label>شماره تلفن</label>
|
| 965 |
+
<input type="tel" class="form-control" id="loginPhone" placeholder="شماره تلفن" required>
|
| 966 |
+
</div>
|
| 967 |
+
|
| 968 |
+
<div class="form-group">
|
| 969 |
+
<label>رمز عبور</label>
|
| 970 |
+
<input type="password" class="form-control" id="loginPassword" placeholder="رمز عبور" required>
|
| 971 |
+
</div>
|
| 972 |
+
|
| 973 |
+
<button type="submit" class="btn btn-primary" style="width: 100%;">
|
| 974 |
+
<i class="ph ph-sign-in"></i>
|
| 975 |
+
ورود
|
| 976 |
+
</button>
|
| 977 |
+
</form>
|
| 978 |
+
|
| 979 |
+
<div style="text-align: center; margin-top: 1.5rem; color: var(--text-muted);">
|
| 980 |
+
حساب ندارید؟
|
| 981 |
+
<a href="#" onclick="router.navigate('register')" style="color: var(--primary); text-decoration: none;">ثبت نام کنید</a>
|
| 982 |
+
</div>
|
| 983 |
+
</div>
|
| 984 |
+
</div>
|
| 985 |
+
</section>
|
| 986 |
+
|
| 987 |
+
<!-- Rooms Page -->
|
| 988 |
+
<section id="page-rooms" class="page hidden">
|
| 989 |
+
<div style="max-width: 1000px; margin: 0 auto; padding: 2rem 0;">
|
| 990 |
+
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem;">
|
| 991 |
+
<div>
|
| 992 |
+
<h2>رومهای من</h2>
|
| 993 |
+
<p style="color: var(--text-muted);">تا ۳ روم میتوانید ایجاد کنید</p>
|
| 994 |
+
</div>
|
| 995 |
+
<button class="btn btn-primary" onclick="roomManager.showCreateModal()">
|
| 996 |
+
<i class="ph ph-plus"></i>
|
| 997 |
+
روم جدید
|
| 998 |
+
</button>
|
| 999 |
+
</div>
|
| 1000 |
+
|
| 1001 |
+
<div id="roomsList" class="rooms-grid">
|
| 1002 |
+
<!-- Rooms will be loaded here -->
|
| 1003 |
+
</div>
|
| 1004 |
+
|
| 1005 |
+
<div id="emptyRooms" class="empty-state hidden">
|
| 1006 |
+
<i class="ph ph-chat-teardrop-text"></i>
|
| 1007 |
+
<h3>هنوز رومی ایجاد نکردهاید</h3>
|
| 1008 |
+
<p>با ایجاد روم، لینک را با دوستان خود به اشتراک بگذارید</p>
|
| 1009 |
+
</div>
|
| 1010 |
+
</div>
|
| 1011 |
+
</section>
|
| 1012 |
+
|
| 1013 |
+
<!-- Chat Page -->
|
| 1014 |
+
<section id="page-chat" class="page hidden">
|
| 1015 |
+
<div class="chat-container">
|
| 1016 |
+
<aside class="sidebar">
|
| 1017 |
+
<div class="sidebar-header">
|
| 1018 |
+
<h3>کاربران آنلاین</h3>
|
| 1019 |
+
</div>
|
| 1020 |
+
<div class="users-list" id="onlineUsers">
|
| 1021 |
+
<!-- Users will be loaded here -->
|
| 1022 |
+
</div>
|
| 1023 |
+
</aside>
|
| 1024 |
+
|
| 1025 |
+
<div class="chat-area">
|
| 1026 |
+
<div class="chat-header">
|
| 1027 |
+
<div>
|
| 1028 |
+
<h3 id="chatRoomName">نام روم</h3>
|
| 1029 |
+
<small style="color: var(--text-muted);" id="chatRoomId">شناسه: -</small>
|
| 1030 |
+
</div>
|
| 1031 |
+
<div style="display: flex; gap: 0.5rem;">
|
| 1032 |
+
<button class="btn btn-secondary btn-small" onclick="chat.copyLink()">
|
| 1033 |
+
<i class="ph ph-link"></i>
|
| 1034 |
+
کپی لینک
|
| 1035 |
+
</button>
|
| 1036 |
+
<button class="btn btn-ghost" onclick="router.navigate('rooms')">
|
| 1037 |
+
<i class="ph ph-x"></i>
|
| 1038 |
+
</button>
|
| 1039 |
+
</div>
|
| 1040 |
+
</div>
|
| 1041 |
+
|
| 1042 |
+
<div class="chat-messages" id="chatMessages">
|
| 1043 |
+
<!-- Messages will appear here -->
|
| 1044 |
+
</div>
|
| 1045 |
+
|
| 1046 |
+
<div class="chat-input-area">
|
| 1047 |
+
<input type="text" class="chat-input" id="messageInput" placeholder="پیام خود را بنویسید..." onkeypress="if(event.key==='Enter') chat.sendMessage()">
|
| 1048 |
+
<button class="btn btn-primary btn-icon" onclick="chat.sendMessage()">
|
| 1049 |
+
<i class="ph ph-paper-plane-right"></i>
|
| 1050 |
+
</button>
|
| 1051 |
+
</div>
|
| 1052 |
+
</div>
|
| 1053 |
+
</div>
|
| 1054 |
+
</section>
|
| 1055 |
+
|
| 1056 |
+
<!-- Settings Page -->
|
| 1057 |
+
<section id="page-settings" class="page hidden">
|
| 1058 |
+
<div class="settings-grid">
|
| 1059 |
+
<div class="settings-nav">
|
| 1060 |
+
<div class="settings-nav-item active" onclick="settings.showTab('profile')">
|
| 1061 |
+
<i class="ph ph-user"></i>
|
| 1062 |
+
پروفایل
|
| 1063 |
+
</div>
|
| 1064 |
+
<div class="settings-nav-item" onclick="settings.showTab('account')">
|
| 1065 |
+
<i class="ph ph-lock"></i>
|
| 1066 |
+
حساب کاربری
|
| 1067 |
+
</div>
|
| 1068 |
+
</div>
|
| 1069 |
+
|
| 1070 |
+
<div class="settings-content">
|
| 1071 |
+
<div id="tab-profile">
|
| 1072 |
+
<h2 style="margin-bottom: 1.5rem;">تنظیمات پروفایل</h2>
|
| 1073 |
+
|
| 1074 |
+
<div class="form-group">
|
| 1075 |
+
<label>نام نمایشی</label>
|
| 1076 |
+
<input type="text" class="form-control" id="settingsName" placeholder="نام شما">
|
| 1077 |
+
</div>
|
| 1078 |
+
|
| 1079 |
+
<div class="form-group">
|
| 1080 |
+
<label>انتخاب آواتار</label>
|
| 1081 |
+
<div class="avatar-selector" id="avatarSelector">
|
| 1082 |
+
<!-- Avatars will be generated here -->
|
| 1083 |
+
</div>
|
| 1084 |
+
</div>
|
| 1085 |
+
|
| 1086 |
+
<button class="btn btn-primary" onclick="settings.saveProfile()">
|
| 1087 |
+
<i class="ph ph-floppy-disk"></i>
|
| 1088 |
+
ذخیره تغییرات
|
| 1089 |
+
</button>
|
| 1090 |
+
</div>
|
| 1091 |
+
|
| 1092 |
+
<div id="tab-account" class="hidden">
|
| 1093 |
+
<h2 style="margin-bottom: 1.5rem;">حساب کاربری</h2>
|
| 1094 |
+
|
| 1095 |
+
<div style="background: rgba(239, 68, 68, 0.1); border: 1px solid var(--error); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem;">
|
| 1096 |
+
<h4 style="color: var(--error); margin-bottom: 0.5rem;">
|
| 1097 |
+
<i class="ph ph-warning"></i>
|
| 1098 |
+
هشدار
|
| 1099 |
+
</h4>
|
| 1100 |
+
<p style="color: var(--text-muted); font-size: 0.9rem;">
|
| 1101 |
+
حذف حساب کاربری باعث حذف تمام رومها و پیامهای شما میشود. این عملیات قابل بازگشت نیست.
|
| 1102 |
+
</p>
|
| 1103 |
+
</div>
|
| 1104 |
+
|
| 1105 |
+
<button class="btn btn-danger" onclick="auth.deleteAccount()">
|
| 1106 |
+
<i class="ph ph-trash"></i>
|
| 1107 |
+
حذف حساب کاربری
|
| 1108 |
+
</button>
|
| 1109 |
+
</div>
|
| 1110 |
+
</div>
|
| 1111 |
+
</div>
|
| 1112 |
+
</section>
|
| 1113 |
+
|
| 1114 |
+
</div>
|
| 1115 |
+
|
| 1116 |
+
<!-- Create Room Modal -->
|
| 1117 |
+
<div class="modal-overlay" id="createRoomModal">
|
| 1118 |
+
<div class="modal">
|
| 1119 |
+
<div class="modal-header">
|
| 1120 |
+
<h3>ایجاد روم جدید</h3>
|
| 1121 |
+
<button class="close-btn" onclick="roomManager.hideCreateModal()">
|
| 1122 |
+
<i class="ph ph-x"></i>
|
| 1123 |
+
</button>
|
| 1124 |
+
</div>
|
| 1125 |
+
|
| 1126 |
+
<form onsubmit="roomManager.createRoom(event)">
|
| 1127 |
+
<div class="form-group">
|
| 1128 |
+
<label>نام روم</label>
|
| 1129 |
+
<input type="text" class="form-control" id="newRoomName" placeholder="مثال: گفتگوی دوستانه" required>
|
| 1130 |
+
</div>
|
| 1131 |
+
|
| 1132 |
+
<div style="display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.5rem;">
|
| 1133 |
+
<button type="button" class="btn btn-secondary" onclick="roomManager.hideCreateModal()">انصراف</button>
|
| 1134 |
+
<button type="submit" class="btn btn-primary">ایجاد روم</button>
|
| 1135 |
+
</div>
|
| 1136 |
+
</form>
|
| 1137 |
+
</div>
|
| 1138 |
+
</div>
|
| 1139 |
+
|
| 1140 |
+
<script>
|
| 1141 |
+
// Data Management
|
| 1142 |
+
const db = {
|
| 1143 |
+
getUsers() {
|
| 1144 |
+
return JSON.parse(localStorage.getItem('chat_users') || '[]');
|
| 1145 |
+
},
|
| 1146 |
+
saveUsers(users) {
|
| 1147 |
+
localStorage.setItem('chat_users', JSON.stringify(users));
|
| 1148 |
+
},
|
| 1149 |
+
getRooms() {
|
| 1150 |
+
return JSON.parse(localStorage.getItem('chat_rooms') || '[]');
|
| 1151 |
+
},
|
| 1152 |
+
saveRooms(rooms) {
|
| 1153 |
+
localStorage.setItem('chat_rooms', JSON.stringify(rooms));
|
| 1154 |
+
},
|
| 1155 |
+
getMessages() {
|
| 1156 |
+
return JSON.parse(localStorage.getItem('chat_messages') || '{}');
|
| 1157 |
+
},
|
| 1158 |
+
saveMessages(messages) {
|
| 1159 |
+
localStorage.setItem('chat_messages', JSON.stringify(messages));
|
| 1160 |
+
},
|
| 1161 |
+
getCurrentUser() {
|
| 1162 |
+
return JSON.parse(sessionStorage.getItem('current_user') || 'null');
|
| 1163 |
+
},
|
| 1164 |
+
setCurrentUser(user) {
|
| 1165 |
+
sessionStorage.setItem('current_user', JSON.stringify(user));
|
| 1166 |
+
}
|
| 1167 |
+
};
|
| 1168 |
+
|
| 1169 |
+
// Toast Notification
|
| 1170 |
+
const toast = {
|
| 1171 |
+
show(message, type = 'info') {
|
| 1172 |
+
const container = document.getElementById('toastContainer');
|
| 1173 |
+
const toast = document.createElement('div');
|
| 1174 |
+
toast.className = `toast ${type}`;
|
| 1175 |
+
|
| 1176 |
+
const icons = {
|
| 1177 |
+
success: 'ph-check-circle',
|
| 1178 |
+
error: 'ph-x-circle',
|
| 1179 |
+
warning: 'ph-warning',
|
| 1180 |
+
info: 'ph-info'
|
| 1181 |
+
};
|
| 1182 |
+
|
| 1183 |
+
toast.innerHTML = `
|
| 1184 |
+
<i class="ph ${icons[type]}"></i>
|
| 1185 |
+
<span>${message}</span>
|
| 1186 |
+
`;
|
| 1187 |
+
|
| 1188 |
+
container.appendChild(toast);
|
| 1189 |
+
|
| 1190 |
+
setTimeout(() => {
|
| 1191 |
+
toast.style.opacity = '0';
|
| 1192 |
+
toast.style.transform = 'translateX(-100%)';
|
| 1193 |
+
setTimeout(() => toast.remove(), 300);
|
| 1194 |
+
}, 3000);
|
| 1195 |
+
}
|
| 1196 |
+
};
|
| 1197 |
+
|
| 1198 |
+
// Router
|
| 1199 |
+
const router = {
|
| 1200 |
+
currentPage: '',
|
| 1201 |
+
|
| 1202 |
+
navigate(page, params = {}) {
|
| 1203 |
+
// Check auth for protected pages
|
| 1204 |
+
const protectedPages = ['rooms', 'chat', 'settings'];
|
| 1205 |
+
const publicPages = ['home', 'login', 'register'];
|
| 1206 |
+
|
| 1207 |
+
if (protectedPages.includes(page) && !db.getCurrentUser()) {
|
| 1208 |
+
toast.show('لطفاً ابتدا وارد شوید', 'warning');
|
| 1209 |
+
page = 'login';
|
| 1210 |
+
}
|
| 1211 |
+
|
| 1212 |
+
if (publicPages.includes(page) && db.getCurrentUser() && (page === 'login' || page === 'register')) {
|
| 1213 |
+
page = 'rooms';
|
| 1214 |
+
}
|
| 1215 |
+
|
| 1216 |
+
// Hide all pages
|
| 1217 |
+
document.querySelectorAll('.page').forEach(p => p.classList.add('hidden'));
|
| 1218 |
+
|
| 1219 |
+
// Show target page
|
| 1220 |
+
const targetPage = document.getElementById(`page-${page}`);
|
| 1221 |
+
if (targetPage) {
|
| 1222 |
+
targetPage.classList.remove('hidden');
|
| 1223 |
+
this.currentPage = page;
|
| 1224 |
+
|
| 1225 |
+
// Update UI based on page
|
| 1226 |
+
if (page === 'rooms') roomManager.loadRooms();
|
| 1227 |
+
if (page === 'settings') settings.load();
|
| 1228 |
+
if (page === 'chat' && params.roomId) chat.loadRoom(params.roomId);
|
| 1229 |
+
|
| 1230 |
+
// Show/hide header
|
| 1231 |
+
const header = document.getElementById('mainHeader');
|
| 1232 |
+
if (page === 'home' || page === 'login' || page === 'register') {
|
| 1233 |
+
header.classList.add('hidden');
|
| 1234 |
+
} else {
|
| 1235 |
+
header.classList.remove('hidden');
|
| 1236 |
+
this.updateHeader();
|
| 1237 |
+
}
|
| 1238 |
+
}
|
| 1239 |
+
|
| 1240 |
+
window.location.hash = page;
|
| 1241 |
+
},
|
| 1242 |
+
|
| 1243 |
+
updateHeader() {
|
| 1244 |
+
const user = db.getCurrentUser();
|
| 1245 |
+
if (user) {
|
| 1246 |
+
document.getElementById('userNameDisplay').textContent = user.name;
|
| 1247 |
+
document.getElementById('headerAvatar').textContent = user.avatar;
|
| 1248 |
+
}
|
| 1249 |
+
},
|
| 1250 |
+
|
| 1251 |
+
init() {
|
| 1252 |
+
const hash = window.location.hash.slice(1) || 'home';
|
| 1253 |
+
const params = {};
|
| 1254 |
+
|
| 1255 |
+
if (hash.includes('chat/')) {
|
| 1256 |
+
const parts = hash.split('/');
|
| 1257 |
+
params.roomId = parts[1];
|
| 1258 |
+
this.navigate('chat', params);
|
| 1259 |
+
} else {
|
| 1260 |
+
this.navigate(hash);
|
| 1261 |
+
}
|
| 1262 |
+
}
|
| 1263 |
+
};
|
| 1264 |
+
|
| 1265 |
+
// Auth Manager
|
| 1266 |
+
const auth = {
|
| 1267 |
+
register(e) {
|
| 1268 |
+
e.preventDefault();
|
| 1269 |
+
|
| 1270 |
+
const phone = document.getElementById('regPhone').value;
|
| 1271 |
+
const password = document.getElementById('regPassword').value;
|
| 1272 |
+
const name = document.getElementById('regName').value;
|
| 1273 |
+
|
| 1274 |
+
const users = db.getUsers();
|
| 1275 |
+
|
| 1276 |
+
if (users.find(u => u.phone === phone)) {
|
| 1277 |
+
toast.show('این شماره قبلاً ثبت شده است', 'error');
|
| 1278 |
+
return;
|
| 1279 |
+
}
|
| 1280 |
+
|
| 1281 |
+
const newUser = {
|
| 1282 |
+
id: Date.now().toString(),
|
| 1283 |
+
phone,
|
| 1284 |
+
password,
|
| 1285 |
+
name,
|
| 1286 |
+
avatar: '👤',
|
| 1287 |
+
createdAt: new Date().toISOString()
|
| 1288 |
+
};
|
| 1289 |
+
|
| 1290 |
+
users.push(newUser);
|
| 1291 |
+
db.saveUsers(users);
|
| 1292 |
+
db.setCurrentUser(newUser);
|
| 1293 |
+
|
| 1294 |
+
toast.show('ثبت نام با موفقیت انجام شد', 'success');
|
| 1295 |
+
router.navigate('rooms');
|
| 1296 |
+
},
|
| 1297 |
+
|
| 1298 |
+
login(e) {
|
| 1299 |
+
e.preventDefault();
|
| 1300 |
+
|
| 1301 |
+
const phone = document.getElementById('loginPhone').value;
|
| 1302 |
+
const password = document.get
|