joermd commited on
Commit
87874cf
·
verified ·
1 Parent(s): cbaa455

Update login.html

Browse files
Files changed (1) hide show
  1. login.html +11 -271
login.html CHANGED
@@ -1,282 +1,19 @@
1
  <!DOCTYPE html>
2
  <html lang="ar" 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
  <link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&display=swap" rel="stylesheet">
8
  <style>
9
- :root {
10
- --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #818cf8 100%);
11
- --secondary-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
12
- --text-primary: #ffffff;
13
- --text-secondary: #94a3b8;
14
- --text-error: #ef4444;
15
- --text-success: #10b981;
16
- --bg-dark: #0f172a;
17
- --bg-card: rgba(255, 255, 255, 0.05);
18
- --border-color: rgba(255, 255, 255, 0.1);
19
- }
20
-
21
- * {
22
- margin: 0;
23
- padding: 0;
24
- box-sizing: border-box;
25
- font-family: 'Cairo', sans-serif;
26
- }
27
-
28
- body {
29
- min-height: 100vh;
30
- display: flex;
31
- justify-content: center;
32
- align-items: center;
33
- background: var(--bg-dark);
34
- position: relative;
35
- overflow: hidden;
36
- }
37
-
38
- .background-animation {
39
- position: fixed;
40
- top: 0;
41
- left: 0;
42
- width: 100%;
43
- height: 100%;
44
- z-index: 0;
45
- opacity: 0.5;
46
- }
47
-
48
- .circle {
49
- position: absolute;
50
- border-radius: 50%;
51
- animation: float 15s infinite ease-in-out;
52
- }
53
-
54
- .circle-1 {
55
- width: 400px;
56
- height: 400px;
57
- background: var(--primary-gradient);
58
- top: -200px;
59
- left: -200px;
60
- opacity: 0.2;
61
- }
62
-
63
- .circle-2 {
64
- width: 500px;
65
- height: 500px;
66
- background: var(--secondary-gradient);
67
- bottom: -250px;
68
- right: -250px;
69
- opacity: 0.15;
70
- }
71
-
72
- @keyframes float {
73
- 0%, 100% { transform: translate(0, 0) rotate(0deg); }
74
- 50% { transform: translate(30px, 30px) rotate(15deg); }
75
- }
76
-
77
- .container {
78
- width: 100%;
79
- max-width: 420px;
80
- padding: 2rem;
81
- position: relative;
82
- z-index: 1;
83
- }
84
-
85
- .auth-card {
86
- background: var(--bg-card);
87
- backdrop-filter: blur(10px);
88
- border: 1px solid var(--border-color);
89
- border-radius: 24px;
90
- padding: 2.5rem;
91
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
92
- animation: cardAppear 0.6s ease-out;
93
- }
94
-
95
- @keyframes cardAppear {
96
- from { opacity: 0; transform: translateY(20px); }
97
- to { opacity: 1; transform: translateY(0); }
98
- }
99
-
100
- .card-header {
101
- text-align: center;
102
- margin-bottom: 2rem;
103
- }
104
-
105
- .card-header h1 {
106
- color: var(--text-primary);
107
- font-size: 2rem;
108
- margin-bottom: 0.5rem;
109
- animation: glowText 2s infinite alternate;
110
- }
111
-
112
- .card-header p {
113
- color: var(--text-secondary);
114
- font-size: 1rem;
115
- }
116
-
117
- @keyframes glowText {
118
- from { text-shadow: 0 0 10px rgba(79, 70, 229, 0); }
119
- to { text-shadow: 0 0 20px rgba(79, 70, 229, 0.5); }
120
- }
121
-
122
- .form-group {
123
- margin-bottom: 1.5rem;
124
- position: relative;
125
- }
126
-
127
- .form-label {
128
- display: block;
129
- color: var(--text-primary);
130
- margin-bottom: 0.5rem;
131
- font-size: 0.95rem;
132
- font-weight: 500;
133
- }
134
-
135
- .form-input {
136
- width: 100%;
137
- padding: 1rem;
138
- background: rgba(255, 255, 255, 0.05);
139
- border: 1px solid var(--border-color);
140
- border-radius: 12px;
141
- color: var(--text-primary);
142
- font-size: 1rem;
143
- transition: all 0.3s ease;
144
- }
145
-
146
- .form-input:focus {
147
- outline: none;
148
- border-color: #4f46e5;
149
- box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
150
- }
151
-
152
- .form-input::placeholder {
153
- color: var(--text-secondary);
154
- }
155
-
156
- .submit-btn {
157
- width: 100%;
158
- padding: 1rem;
159
- background: var(--primary-gradient);
160
- border: none;
161
- border-radius: 12px;
162
- color: var(--text-primary);
163
- font-size: 1.1rem;
164
- font-weight: 600;
165
- cursor: pointer;
166
- transition: all 0.3s ease;
167
- position: relative;
168
- overflow: hidden;
169
- }
170
-
171
- .submit-btn:hover {
172
- transform: translateY(-2px);
173
- box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
174
- }
175
-
176
- .message {
177
- padding: 1rem;
178
- border-radius: 12px;
179
- margin-bottom: 1.5rem;
180
- text-align: center;
181
- animation: messageSlide 0.3s ease-out;
182
- font-weight: 500;
183
- }
184
-
185
- @keyframes messageSlide {
186
- from { opacity: 0; transform: translateY(-10px); }
187
- to { opacity: 1; transform: translateY(0); }
188
- }
189
-
190
- .error-message {
191
- background: rgba(239, 68, 68, 0.1);
192
- border: 1px solid rgba(239, 68, 68, 0.2);
193
- color: var(--text-error);
194
- }
195
-
196
- .success-message {
197
- background: rgba(16, 185, 129, 0.1);
198
- border: 1px solid rgba(16, 185, 129, 0.2);
199
- color: var(--text-success);
200
- }
201
-
202
- .switch-form {
203
- text-align: center;
204
- margin-top: 1.5rem;
205
- color: var(--text-secondary);
206
- }
207
-
208
- .switch-form a {
209
- color: #4f46e5;
210
- text-decoration: none;
211
- font-weight: 500;
212
- margin-right: 0.5rem;
213
- transition: all 0.3s ease;
214
- }
215
-
216
- .switch-form a:hover {
217
- color: #818cf8;
218
- text-decoration: underline;
219
- }
220
-
221
- .loading .submit-btn {
222
- pointer-events: none;
223
- opacity: 0.7;
224
- }
225
-
226
- .loading .submit-btn::after {
227
- content: '';
228
- position: absolute;
229
- left: 50%;
230
- top: 50%;
231
- transform: translate(-50%, -50%);
232
- width: 20px;
233
- height: 20px;
234
- border: 2px solid #ffffff;
235
- border-radius: 50%;
236
- border-top-color: transparent;
237
- animation: spin 1s linear infinite;
238
- }
239
-
240
- @keyframes spin {
241
- to { transform: translate(-50%, -50%) rotate(360deg); }
242
- }
243
-
244
- .tabs {
245
- display: flex;
246
- justify-content: center;
247
- margin-bottom: 2rem;
248
- gap: 1rem;
249
- }
250
-
251
- .tab {
252
- padding: 0.5rem 1.5rem;
253
- border: none;
254
- background: none;
255
- color: var(--text-secondary);
256
- cursor: pointer;
257
- font-size: 1rem;
258
- font-weight: 500;
259
- transition: all 0.3s ease;
260
- }
261
-
262
- .tab.active {
263
- color: var(--text-primary);
264
- position: relative;
265
- }
266
-
267
- .tab.active::after {
268
- content: '';
269
- position: absolute;
270
- bottom: -4px;
271
- left: 0;
272
- width: 100%;
273
- height: 2px;
274
- background: var(--primary-gradient);
275
- border-radius: 2px;
276
- }
277
  </style>
278
  </head>
279
  <body>
 
280
  <div class="background-animation">
281
  <div class="circle circle-1"></div>
282
  <div class="circle circle-2"></div>
@@ -331,6 +68,9 @@
331
  </div>
332
 
333
  <script>
 
 
 
334
  function switchTab(tab) {
335
  const loginForm = document.getElementById('loginForm');
336
  const registerForm = document.getElementById('registerForm');
@@ -360,7 +100,7 @@
360
  formData.append('username', form.username.value);
361
  formData.append('password', form.password.value);
362
 
363
- const response = await fetch('http://localhost:6000/token', {
364
  method: 'POST',
365
  body: formData
366
  });
@@ -374,7 +114,7 @@
374
  </div>
375
  `;
376
  localStorage.setItem('token', data.access_token);
377
- // Redirect or update UI as needed
378
  } else {
379
  throw new Error(data.detail || 'خطأ في تسجيل الدخول');
380
  }
@@ -397,7 +137,7 @@
397
  try {
398
  form.classList.add('loading');
399
 
400
- const response = await fetch('http://localhost:6000/register', {
401
  method: 'POST',
402
  headers: {
403
  'Content-Type': 'application/json',
 
1
  <!DOCTYPE html>
2
  <html lang="ar" dir="rtl">
3
+ <!-- Previous head and style sections remain exactly the same -->
4
  <head>
5
+ <!-- Previous head content remains the same -->
6
  <meta charset="UTF-8">
7
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
  <title>نظام المصادقة الذكي</title>
9
  <link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&display=swap" rel="stylesheet">
10
  <style>
11
+ /* Previous styles remain exactly the same */
12
+ /* ... */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  </style>
14
  </head>
15
  <body>
16
+ <!-- Previous HTML structure remains exactly the same until the script section -->
17
  <div class="background-animation">
18
  <div class="circle circle-1"></div>
19
  <div class="circle circle-2"></div>
 
68
  </div>
69
 
70
  <script>
71
+ // API Base URL
72
+ const API_URL = 'https://j8fp9mu44k547j-7777.proxy.runpod.net/proxy/6000';
73
+
74
  function switchTab(tab) {
75
  const loginForm = document.getElementById('loginForm');
76
  const registerForm = document.getElementById('registerForm');
 
100
  formData.append('username', form.username.value);
101
  formData.append('password', form.password.value);
102
 
103
+ const response = await fetch(`${API_URL}/token`, {
104
  method: 'POST',
105
  body: formData
106
  });
 
114
  </div>
115
  `;
116
  localStorage.setItem('token', data.access_token);
117
+ // يمكنك إضافة إعادة توجيه هنا إذا كنت ترغب
118
  } else {
119
  throw new Error(data.detail || 'خطأ في تسجيل الدخول');
120
  }
 
137
  try {
138
  form.classList.add('loading');
139
 
140
+ const response = await fetch(`${API_URL}/register`, {
141
  method: 'POST',
142
  headers: {
143
  'Content-Type': 'application/json',