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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
<style>
|
| 8 |
+
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');
|
| 9 |
+
|
| 10 |
+
:root {
|
| 11 |
+
--primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
|
| 12 |
+
--secondary-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
|
| 13 |
+
--glass-bg: rgba(255, 255, 255, 0.1);
|
| 14 |
+
--glass-border: rgba(255, 255, 255, 0.2);
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
* {
|
| 18 |
+
margin: 0;
|
| 19 |
+
padding: 0;
|
| 20 |
+
box-sizing: border-box;
|
| 21 |
+
font-family: 'Cairo', sans-serif;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
body {
|
| 25 |
+
min-height: 100vh;
|
| 26 |
+
display: flex;
|
| 27 |
+
justify-content: center;
|
| 28 |
+
align-items: center;
|
| 29 |
+
background: #0f172a;
|
| 30 |
+
background-image:
|
| 31 |
+
radial-gradient(circle at 15% 50%, #3b82f633 0%, transparent 25%),
|
| 32 |
+
radial-gradient(circle at 85% 30%, #6366f133 0%, transparent 25%);
|
| 33 |
+
position: relative;
|
| 34 |
+
overflow: hidden;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
/* Animated Background */
|
| 38 |
+
.bg-animation {
|
| 39 |
+
position: absolute;
|
| 40 |
+
width: 100%;
|
| 41 |
+
height: 100%;
|
| 42 |
+
z-index: 0;
|
| 43 |
+
opacity: 0.5;
|
| 44 |
+
background:
|
| 45 |
+
linear-gradient(45deg, transparent 48%, #2563eb 50%, transparent 52%),
|
| 46 |
+
linear-gradient(-45deg, transparent 48%, #4f46e5 50%, transparent 52%);
|
| 47 |
+
background-size: 60px 60px;
|
| 48 |
+
animation: bgMove 30s linear infinite;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
@keyframes bgMove {
|
| 52 |
+
from { background-position: 0 0; }
|
| 53 |
+
to { background-position: 60px 60px; }
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
.container {
|
| 57 |
+
position: relative;
|
| 58 |
+
width: 100%;
|
| 59 |
+
max-width: 420px;
|
| 60 |
+
padding: 2rem;
|
| 61 |
+
z-index: 1;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
.auth-card {
|
| 65 |
+
background: rgba(255, 255, 255, 0.05);
|
| 66 |
+
backdrop-filter: blur(10px);
|
| 67 |
+
border: 1px solid var(--glass-border);
|
| 68 |
+
border-radius: 20px;
|
| 69 |
+
overflow: hidden;
|
| 70 |
+
padding: 2rem;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
.card-header {
|
| 74 |
+
text-align: center;
|
| 75 |
+
margin-bottom: 2rem;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
.card-header h1 {
|
| 79 |
+
color: white;
|
| 80 |
+
font-size: 2rem;
|
| 81 |
+
margin-bottom: 0.5rem;
|
| 82 |
+
background: var(--primary-gradient);
|
| 83 |
+
-webkit-background-clip: text;
|
| 84 |
+
-webkit-text-fill-color: transparent;
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
.card-header p {
|
| 88 |
+
color: #94a3b8;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
.form-group {
|
| 92 |
+
margin-bottom: 1.5rem;
|
| 93 |
+
position: relative;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
.form-label {
|
| 97 |
+
display: block;
|
| 98 |
+
margin-bottom: 0.5rem;
|
| 99 |
+
color: #e2e8f0;
|
| 100 |
+
font-weight: 500;
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
.form-input {
|
| 104 |
+
width: 100%;
|
| 105 |
+
padding: 1rem;
|
| 106 |
+
background: rgba(255, 255, 255, 0.05);
|
| 107 |
+
border: 1px solid var(--glass-border);
|
| 108 |
+
border-radius: 12px;
|
| 109 |
+
color: white;
|
| 110 |
+
font-size: 1rem;
|
| 111 |
+
transition: all 0.3s ease;
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
.form-input:focus {
|
| 115 |
+
outline: none;
|
| 116 |
+
border-color: #6366f1;
|
| 117 |
+
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
.form-input::placeholder {
|
| 121 |
+
color: #64748b;
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
.btn {
|
| 125 |
+
width: 100%;
|
| 126 |
+
padding: 1rem;
|
| 127 |
+
border: none;
|
| 128 |
+
border-radius: 12px;
|
| 129 |
+
font-size: 1rem;
|
| 130 |
+
font-weight: 600;
|
| 131 |
+
color: white;
|
| 132 |
+
background: var(--primary-gradient);
|
| 133 |
+
cursor: pointer;
|
| 134 |
+
transition: all 0.3s ease;
|
| 135 |
+
position: relative;
|
| 136 |
+
overflow: hidden;
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
.btn:hover {
|
| 140 |
+
transform: translateY(-2px);
|
| 141 |
+
box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
.btn::after {
|
| 145 |
+
content: '';
|
| 146 |
+
position: absolute;
|
| 147 |
+
width: 200%;
|
| 148 |
+
height: 100%;
|
| 149 |
+
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
|
| 150 |
+
top: 0;
|
| 151 |
+
left: -100%;
|
| 152 |
+
transform: skewX(-15deg);
|
| 153 |
+
transition: 0.5s;
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
.btn:hover::after {
|
| 157 |
+
left: 100%;
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
.switch-form {
|
| 161 |
+
text-align: center;
|
| 162 |
+
margin-top: 1.5rem;
|
| 163 |
+
color: #94a3b8;
|
| 164 |
+
}
|
| 165 |
+
|
| 166 |
+
.switch-form a {
|
| 167 |
+
color: #6366f1;
|
| 168 |
+
text-decoration: none;
|
| 169 |
+
font-weight: 500;
|
| 170 |
+
margin-right: 0.5rem;
|
| 171 |
+
transition: all 0.3s ease;
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
.switch-form a:hover {
|
| 175 |
+
color: #818cf8;
|
| 176 |
+
text-decoration: underline;
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
/* Floating Icons Animation */
|
| 180 |
+
.floating-icons {
|
| 181 |
+
position: absolute;
|
| 182 |
+
width: 100%;
|
| 183 |
+
height: 100%;
|
| 184 |
+
top: 0;
|
| 185 |
+
left: 0;
|
| 186 |
+
pointer-events: none;
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
.icon {
|
| 190 |
+
position: absolute;
|
| 191 |
+
width: 30px;
|
| 192 |
+
height: 30px;
|
| 193 |
+
background: var(--primary-gradient);
|
| 194 |
+
border-radius: 50%;
|
| 195 |
+
opacity: 0.2;
|
| 196 |
+
animation: float 8s infinite;
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
.icon:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
|
| 200 |
+
.icon:nth-child(2) { top: 60%; left: 80%; animation-delay: 1s; }
|
| 201 |
+
.icon:nth-child(3) { top: 40%; left: 40%; animation-delay: 2s; }
|
| 202 |
+
.icon:nth-child(4) { top: 80%; left: 20%; animation-delay: 3s; }
|
| 203 |
+
.icon:nth-child(5) { top: 10%; left: 60%; animation-delay: 4s; }
|
| 204 |
+
|
| 205 |
+
@keyframes float {
|
| 206 |
+
0%, 100% { transform: translateY(0) rotate(0deg); }
|
| 207 |
+
50% { transform: translateY(-20px) rotate(180deg); }
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
+
.success-message {
|
| 211 |
+
color: #34d399;
|
| 212 |
+
background: rgba(52, 211, 153, 0.1);
|
| 213 |
+
border: 1px solid rgba(52, 211, 153, 0.2);
|
| 214 |
+
padding: 0.75rem;
|
| 215 |
+
border-radius: 8px;
|
| 216 |
+
margin-bottom: 1rem;
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
.error-message {
|
| 220 |
+
color: #f87171;
|
| 221 |
+
background: rgba(248, 113, 113, 0.1);
|
| 222 |
+
border: 1px solid rgba(248, 113, 113, 0.2);
|
| 223 |
+
padding: 0.75rem;
|
| 224 |
+
border-radius: 8px;
|
| 225 |
+
margin-bottom: 1rem;
|
| 226 |
+
}
|
| 227 |
+
</style>
|
| 228 |
+
</head>
|
| 229 |
+
<body>
|
| 230 |
+
<div class="bg-animation"></div>
|
| 231 |
+
<div class="floating-icons">
|
| 232 |
+
<div class="icon"></div>
|
| 233 |
+
<div class="icon"></div>
|
| 234 |
+
<div class="icon"></div>
|
| 235 |
+
<div class="icon"></div>
|
| 236 |
+
<div class="icon"></div>
|
| 237 |
+
</div>
|
| 238 |
+
|
| 239 |
+
<!-- صفحة تسجيل الدخول -->
|
| 240 |
+
<div class="container">
|
| 241 |
+
<div class="auth-card">
|
| 242 |
+
<div class="card-header">
|
| 243 |
+
<h1>تسجيل الدخول</h1>
|
| 244 |
+
<p>مرحباً بك في نظام المصادقة الذكي</p>
|
| 245 |
+
</div>
|
| 246 |
+
<form id="loginForm">
|
| 247 |
+
<div class="form-group">
|
| 248 |
+
<label class="form-label">اسم المستخدم</label>
|
| 249 |
+
<input type="text" class="form-input" name="username" placeholder="أدخل اسم المستخدم" required>
|
| 250 |
+
</div>
|
| 251 |
+
<div class="form-group">
|
| 252 |
+
<label class="form-label">كلمة المرور</label>
|
| 253 |
+
<input type="password" class="form-input" name="password" placeholder="أدخل كلمة المرور" required>
|
| 254 |
+
</div>
|
| 255 |
+
<div id="loginMessage"></div>
|
| 256 |
+
<button type="submit" class="btn">تسجيل الدخول</button>
|
| 257 |
+
</form>
|
| 258 |
+
<div class="switch-form">
|
| 259 |
+
<p>ليس لديك حساب؟ <a href="register.html">إنشاء حساب جديد</a></p>
|
| 260 |
+
</div>
|
| 261 |
+
</div>
|
| 262 |
+
</div>
|
| 263 |
+
|
| 264 |
+
<script>
|
| 265 |
+
const API_URL = 'https://j8fp9mu44k547j-7777.proxy.runpod.net/proxy/6000';
|
| 266 |
+
|
| 267 |
+
document.getElementById('loginForm').addEventListener('submit', async function(e) {
|
| 268 |
+
e.preventDefault();
|
| 269 |
+
const messageDiv = document.getElementById('loginMessage');
|
| 270 |
+
|
| 271 |
+
try {
|
| 272 |
+
const response = await fetch(`${API_URL}/token`, {
|
| 273 |
+
method: 'POST',
|
| 274 |
+
headers: { 'Content-Type': 'application/json' },
|
| 275 |
+
body: JSON.stringify({
|
| 276 |
+
username: this.username.value,
|
| 277 |
+
password: this.password.value
|
| 278 |
+
})
|
| 279 |
+
});
|
| 280 |
+
|
| 281 |
+
const data = await response.json();
|
| 282 |
+
|
| 283 |
+
if (response.ok) {
|
| 284 |
+
messageDiv.innerHTML = '<div class="success-message">تم تسجيل الدخول بنجاح!</div>';
|
| 285 |
+
localStorage.setItem('token', data.access_token);
|
| 286 |
+
setTimeout(() => window.location.href = '/dashboard.html', 1500);
|
| 287 |
+
} else {
|
| 288 |
+
messageDiv.innerHTML = `<div class="error-message">${data.detail || 'خطأ في تسجيل الدخول'}</div>`;
|
| 289 |
+
}
|
| 290 |
+
} catch (error) {
|
| 291 |
+
messageDiv.innerHTML = '<div class="error-message">خطأ في الاتصال بالخادم</div>';
|
| 292 |
+
}
|
| 293 |
+
});
|
| 294 |
+
</script>
|
| 295 |
+
</body>
|
| 296 |
+
</html>
|