Spaces:
Running
Running
Update login.html
Browse files- login.html +169 -28
login.html
CHANGED
|
@@ -4,7 +4,10 @@
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>نظام تسجيل الدخول</title>
|
|
|
|
| 7 |
<style>
|
|
|
|
|
|
|
| 8 |
* {
|
| 9 |
margin: 0;
|
| 10 |
padding: 0;
|
|
@@ -13,105 +16,203 @@
|
|
| 13 |
}
|
| 14 |
|
| 15 |
body {
|
| 16 |
-
background: linear-gradient(
|
| 17 |
height: 100vh;
|
| 18 |
display: flex;
|
| 19 |
align-items: center;
|
| 20 |
justify-content: center;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
}
|
| 22 |
|
| 23 |
.container {
|
| 24 |
width: 100%;
|
| 25 |
-
max-width:
|
| 26 |
padding: 20px;
|
| 27 |
display: flex;
|
| 28 |
-
gap:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
}
|
| 30 |
|
| 31 |
.form-box {
|
| 32 |
-
background:
|
| 33 |
padding: 40px;
|
| 34 |
-
border-radius:
|
| 35 |
-
box-shadow: 0
|
| 36 |
flex: 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
}
|
| 38 |
|
| 39 |
h2 {
|
| 40 |
text-align: center;
|
| 41 |
-
color: #
|
| 42 |
margin-bottom: 30px;
|
|
|
|
| 43 |
}
|
| 44 |
|
| 45 |
.input-group {
|
| 46 |
-
margin-bottom:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
}
|
| 48 |
|
| 49 |
input {
|
| 50 |
width: 100%;
|
| 51 |
-
padding:
|
| 52 |
-
border:
|
| 53 |
-
border-radius:
|
| 54 |
font-size: 16px;
|
| 55 |
-
transition:
|
|
|
|
| 56 |
}
|
| 57 |
|
| 58 |
input:focus {
|
| 59 |
-
border-color: #
|
|
|
|
| 60 |
outline: none;
|
| 61 |
}
|
| 62 |
|
| 63 |
button {
|
| 64 |
width: 100%;
|
| 65 |
-
padding:
|
| 66 |
-
background: #
|
| 67 |
border: none;
|
| 68 |
-
border-radius:
|
| 69 |
color: white;
|
| 70 |
font-size: 16px;
|
|
|
|
| 71 |
cursor: pointer;
|
| 72 |
-
transition:
|
|
|
|
|
|
|
| 73 |
}
|
| 74 |
|
| 75 |
button:hover {
|
| 76 |
-
background: #
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
}
|
| 78 |
|
| 79 |
.message {
|
| 80 |
margin-top: 15px;
|
| 81 |
text-align: center;
|
| 82 |
-
padding:
|
| 83 |
-
border-radius:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
}
|
| 85 |
|
| 86 |
.error {
|
| 87 |
-
color: #
|
| 88 |
-
background-color: #
|
| 89 |
}
|
| 90 |
|
| 91 |
.success {
|
| 92 |
-
color: #
|
| 93 |
-
background-color: #
|
| 94 |
}
|
| 95 |
|
| 96 |
@media (max-width: 768px) {
|
| 97 |
.container {
|
| 98 |
flex-direction: column;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
}
|
| 100 |
}
|
| 101 |
</style>
|
| 102 |
</head>
|
| 103 |
<body>
|
|
|
|
|
|
|
| 104 |
<div class="container">
|
| 105 |
<!-- نموذج تسجيل الدخول -->
|
| 106 |
<div class="form-box">
|
|
|
|
|
|
|
|
|
|
| 107 |
<h2>تسجيل الدخول</h2>
|
| 108 |
<div class="input-group">
|
|
|
|
| 109 |
<input type="text" id="loginUsername" placeholder="اسم المستخدم">
|
| 110 |
</div>
|
| 111 |
<div class="input-group">
|
|
|
|
| 112 |
<input type="password" id="loginPassword" placeholder="كلمة المرور">
|
| 113 |
</div>
|
| 114 |
-
<button onclick="login()"
|
|
|
|
|
|
|
| 115 |
<div id="loginMessage" class="message"></div>
|
| 116 |
</div>
|
| 117 |
|
|
@@ -119,9 +220,11 @@
|
|
| 119 |
<div class="form-box">
|
| 120 |
<h2>إنشاء حساب جديد</h2>
|
| 121 |
<div class="input-group">
|
|
|
|
| 122 |
<input type="text" id="registerUsername" placeholder="اسم المستخدم">
|
| 123 |
</div>
|
| 124 |
<div class="input-group">
|
|
|
|
| 125 |
<input type="password" id="registerPassword" placeholder="كلمة المرور">
|
| 126 |
</div>
|
| 127 |
<button onclick="register()">إنشاء حساب</button>
|
|
@@ -130,19 +233,46 @@
|
|
| 130 |
</div>
|
| 131 |
|
| 132 |
<script>
|
| 133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
|
|
|
|
|
|
|
| 135 |
function showMessage(elementId, message, isError = false) {
|
| 136 |
const element = document.getElementById(elementId);
|
| 137 |
element.textContent = message;
|
| 138 |
element.className = `message ${isError ? 'error' : 'success'}`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
setTimeout(() => {
|
| 140 |
-
element.
|
| 141 |
-
|
|
|
|
|
|
|
|
|
|
| 142 |
}, 3000);
|
| 143 |
}
|
| 144 |
|
| 145 |
async function login() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
const username = document.getElementById('loginUsername').value;
|
| 147 |
const password = document.getElementById('loginPassword').value;
|
| 148 |
|
|
@@ -167,10 +297,18 @@
|
|
| 167 |
}
|
| 168 |
} catch (error) {
|
| 169 |
showMessage('loginMessage', 'حدث خطأ في الاتصال', true);
|
|
|
|
|
|
|
|
|
|
| 170 |
}
|
| 171 |
}
|
| 172 |
|
| 173 |
async function register() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
const username = document.getElementById('registerUsername').value;
|
| 175 |
const password = document.getElementById('registerPassword').value;
|
| 176 |
|
|
@@ -194,6 +332,9 @@
|
|
| 194 |
}
|
| 195 |
} catch (error) {
|
| 196 |
showMessage('registerMessage', 'حدث خطأ في الاتصال', true);
|
|
|
|
|
|
|
|
|
|
| 197 |
}
|
| 198 |
}
|
| 199 |
</script>
|
|
|
|
| 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.0.0/css/all.min.css">
|
| 8 |
<style>
|
| 9 |
+
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');
|
| 10 |
+
|
| 11 |
* {
|
| 12 |
margin: 0;
|
| 13 |
padding: 0;
|
|
|
|
| 16 |
}
|
| 17 |
|
| 18 |
body {
|
| 19 |
+
background: linear-gradient(135deg, #1a237e, #0d47a1);
|
| 20 |
height: 100vh;
|
| 21 |
display: flex;
|
| 22 |
align-items: center;
|
| 23 |
justify-content: center;
|
| 24 |
+
overflow: hidden;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
.background-squares {
|
| 28 |
+
position: absolute;
|
| 29 |
+
top: 0;
|
| 30 |
+
left: 0;
|
| 31 |
+
width: 100%;
|
| 32 |
+
height: 100%;
|
| 33 |
+
overflow: hidden;
|
| 34 |
+
z-index: 1;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.square {
|
| 38 |
+
position: absolute;
|
| 39 |
+
background: rgba(255, 255, 255, 0.1);
|
| 40 |
+
animation: animate 10s linear infinite;
|
| 41 |
+
border-radius: 10px;
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
@keyframes animate {
|
| 45 |
+
0% {
|
| 46 |
+
transform: translateY(100vh) rotate(0deg);
|
| 47 |
+
opacity: 0;
|
| 48 |
+
}
|
| 49 |
+
100% {
|
| 50 |
+
transform: translateY(-100vh) rotate(360deg);
|
| 51 |
+
opacity: 0.3;
|
| 52 |
+
}
|
| 53 |
}
|
| 54 |
|
| 55 |
.container {
|
| 56 |
width: 100%;
|
| 57 |
+
max-width: 1000px;
|
| 58 |
padding: 20px;
|
| 59 |
display: flex;
|
| 60 |
+
gap: 30px;
|
| 61 |
+
position: relative;
|
| 62 |
+
z-index: 2;
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
.logo-container {
|
| 66 |
+
text-align: center;
|
| 67 |
+
margin-bottom: 20px;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
.logo {
|
| 71 |
+
width: 150px;
|
| 72 |
+
height: auto;
|
| 73 |
+
margin-bottom: 20px;
|
| 74 |
+
animation: float 3s ease-in-out infinite;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
@keyframes float {
|
| 78 |
+
0%, 100% { transform: translateY(0); }
|
| 79 |
+
50% { transform: translateY(-10px); }
|
| 80 |
}
|
| 81 |
|
| 82 |
.form-box {
|
| 83 |
+
background: rgba(255, 255, 255, 0.95);
|
| 84 |
padding: 40px;
|
| 85 |
+
border-radius: 20px;
|
| 86 |
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
|
| 87 |
flex: 1;
|
| 88 |
+
transform: translateY(0);
|
| 89 |
+
transition: all 0.3s ease;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
.form-box:hover {
|
| 93 |
+
transform: translateY(-5px);
|
| 94 |
}
|
| 95 |
|
| 96 |
h2 {
|
| 97 |
text-align: center;
|
| 98 |
+
color: #1a237e;
|
| 99 |
margin-bottom: 30px;
|
| 100 |
+
font-weight: 700;
|
| 101 |
}
|
| 102 |
|
| 103 |
.input-group {
|
| 104 |
+
margin-bottom: 25px;
|
| 105 |
+
position: relative;
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
.input-group i {
|
| 109 |
+
position: absolute;
|
| 110 |
+
right: 15px;
|
| 111 |
+
top: 50%;
|
| 112 |
+
transform: translateY(-50%);
|
| 113 |
+
color: #1a237e;
|
| 114 |
}
|
| 115 |
|
| 116 |
input {
|
| 117 |
width: 100%;
|
| 118 |
+
padding: 15px 45px 15px 15px;
|
| 119 |
+
border: 2px solid #e0e0e0;
|
| 120 |
+
border-radius: 10px;
|
| 121 |
font-size: 16px;
|
| 122 |
+
transition: all 0.3s;
|
| 123 |
+
background: rgba(255, 255, 255, 0.9);
|
| 124 |
}
|
| 125 |
|
| 126 |
input:focus {
|
| 127 |
+
border-color: #1a237e;
|
| 128 |
+
box-shadow: 0 0 10px rgba(26, 35, 126, 0.2);
|
| 129 |
outline: none;
|
| 130 |
}
|
| 131 |
|
| 132 |
button {
|
| 133 |
width: 100%;
|
| 134 |
+
padding: 15px;
|
| 135 |
+
background: #1a237e;
|
| 136 |
border: none;
|
| 137 |
+
border-radius: 10px;
|
| 138 |
color: white;
|
| 139 |
font-size: 16px;
|
| 140 |
+
font-weight: 500;
|
| 141 |
cursor: pointer;
|
| 142 |
+
transition: all 0.3s;
|
| 143 |
+
position: relative;
|
| 144 |
+
overflow: hidden;
|
| 145 |
}
|
| 146 |
|
| 147 |
button:hover {
|
| 148 |
+
background: #0d47a1;
|
| 149 |
+
transform: translateY(-2px);
|
| 150 |
+
box-shadow: 0 5px 15px rgba(26, 35, 126, 0.3);
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
button:active {
|
| 154 |
+
transform: translateY(0);
|
| 155 |
}
|
| 156 |
|
| 157 |
.message {
|
| 158 |
margin-top: 15px;
|
| 159 |
text-align: center;
|
| 160 |
+
padding: 12px;
|
| 161 |
+
border-radius: 10px;
|
| 162 |
+
font-size: 14px;
|
| 163 |
+
transform: scale(0.95);
|
| 164 |
+
opacity: 0;
|
| 165 |
+
transition: all 0.3s;
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
.message.active {
|
| 169 |
+
transform: scale(1);
|
| 170 |
+
opacity: 1;
|
| 171 |
}
|
| 172 |
|
| 173 |
.error {
|
| 174 |
+
color: #d32f2f;
|
| 175 |
+
background-color: #ffebee;
|
| 176 |
}
|
| 177 |
|
| 178 |
.success {
|
| 179 |
+
color: #2e7d32;
|
| 180 |
+
background-color: #e8f5e9;
|
| 181 |
}
|
| 182 |
|
| 183 |
@media (max-width: 768px) {
|
| 184 |
.container {
|
| 185 |
flex-direction: column;
|
| 186 |
+
padding: 10px;
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
.form-box {
|
| 190 |
+
padding: 30px 20px;
|
| 191 |
}
|
| 192 |
}
|
| 193 |
</style>
|
| 194 |
</head>
|
| 195 |
<body>
|
| 196 |
+
<div class="background-squares"></div>
|
| 197 |
+
|
| 198 |
<div class="container">
|
| 199 |
<!-- نموذج تسجيل الدخول -->
|
| 200 |
<div class="form-box">
|
| 201 |
+
<div class="logo-container">
|
| 202 |
+
<img src="https://ufastpro.com/wp-content/uploads/2024/11/تصميم-بدون-عنوان-3.png" alt="Logo" class="logo">
|
| 203 |
+
</div>
|
| 204 |
<h2>تسجيل الدخول</h2>
|
| 205 |
<div class="input-group">
|
| 206 |
+
<i class="fas fa-user"></i>
|
| 207 |
<input type="text" id="loginUsername" placeholder="اسم المستخدم">
|
| 208 |
</div>
|
| 209 |
<div class="input-group">
|
| 210 |
+
<i class="fas fa-lock"></i>
|
| 211 |
<input type="password" id="loginPassword" placeholder="كلمة المرور">
|
| 212 |
</div>
|
| 213 |
+
<button onclick="login()">
|
| 214 |
+
<span>دخول</span>
|
| 215 |
+
</button>
|
| 216 |
<div id="loginMessage" class="message"></div>
|
| 217 |
</div>
|
| 218 |
|
|
|
|
| 220 |
<div class="form-box">
|
| 221 |
<h2>إنشاء حساب جديد</h2>
|
| 222 |
<div class="input-group">
|
| 223 |
+
<i class="fas fa-user-plus"></i>
|
| 224 |
<input type="text" id="registerUsername" placeholder="اسم المستخدم">
|
| 225 |
</div>
|
| 226 |
<div class="input-group">
|
| 227 |
+
<i class="fas fa-key"></i>
|
| 228 |
<input type="password" id="registerPassword" placeholder="كلمة المرور">
|
| 229 |
</div>
|
| 230 |
<button onclick="register()">إنشاء حساب</button>
|
|
|
|
| 233 |
</div>
|
| 234 |
|
| 235 |
<script>
|
| 236 |
+
// إضافة المربعات المتحركة في الخلفية
|
| 237 |
+
const backgroundSquares = document.querySelector('.background-squares');
|
| 238 |
+
for (let i = 0; i < 10; i++) {
|
| 239 |
+
const square = document.createElement('div');
|
| 240 |
+
square.classList.add('square');
|
| 241 |
+
square.style.left = Math.random() * 100 + 'vw';
|
| 242 |
+
square.style.width = Math.random() * 50 + 20 + 'px';
|
| 243 |
+
square.style.height = square.style.width;
|
| 244 |
+
square.style.animationDuration = (Math.random() * 5 + 5) + 's';
|
| 245 |
+
square.style.animationDelay = Math.random() * 2 + 's';
|
| 246 |
+
backgroundSquares.appendChild(square);
|
| 247 |
+
}
|
| 248 |
|
| 249 |
+
const API_URL = 'https://j8fp9mu44k547j-7777.proxy.runpod.net/proxy/6500/api';
|
| 250 |
+
|
| 251 |
function showMessage(elementId, message, isError = false) {
|
| 252 |
const element = document.getElementById(elementId);
|
| 253 |
element.textContent = message;
|
| 254 |
element.className = `message ${isError ? 'error' : 'success'}`;
|
| 255 |
+
|
| 256 |
+
// تفعيل التأثير
|
| 257 |
+
setTimeout(() => {
|
| 258 |
+
element.classList.add('active');
|
| 259 |
+
}, 10);
|
| 260 |
+
|
| 261 |
setTimeout(() => {
|
| 262 |
+
element.classList.remove('active');
|
| 263 |
+
setTimeout(() => {
|
| 264 |
+
element.textContent = '';
|
| 265 |
+
element.className = 'message';
|
| 266 |
+
}, 300);
|
| 267 |
}, 3000);
|
| 268 |
}
|
| 269 |
|
| 270 |
async function login() {
|
| 271 |
+
const button = event.currentTarget;
|
| 272 |
+
const originalText = button.innerHTML;
|
| 273 |
+
button.innerHTML = '<i class="fas fa-spinner fa-spin"></i>';
|
| 274 |
+
button.disabled = true;
|
| 275 |
+
|
| 276 |
const username = document.getElementById('loginUsername').value;
|
| 277 |
const password = document.getElementById('loginPassword').value;
|
| 278 |
|
|
|
|
| 297 |
}
|
| 298 |
} catch (error) {
|
| 299 |
showMessage('loginMessage', 'حدث خطأ في الاتصال', true);
|
| 300 |
+
} finally {
|
| 301 |
+
button.innerHTML = originalText;
|
| 302 |
+
button.disabled = false;
|
| 303 |
}
|
| 304 |
}
|
| 305 |
|
| 306 |
async function register() {
|
| 307 |
+
const button = event.currentTarget;
|
| 308 |
+
const originalText = button.innerHTML;
|
| 309 |
+
button.innerHTML = '<i class="fas fa-spinner fa-spin"></i>';
|
| 310 |
+
button.disabled = true;
|
| 311 |
+
|
| 312 |
const username = document.getElementById('registerUsername').value;
|
| 313 |
const password = document.getElementById('registerPassword').value;
|
| 314 |
|
|
|
|
| 332 |
}
|
| 333 |
} catch (error) {
|
| 334 |
showMessage('registerMessage', 'حدث خطأ في الاتصال', true);
|
| 335 |
+
} finally {
|
| 336 |
+
button.innerHTML = originalText;
|
| 337 |
+
button.disabled = false;
|
| 338 |
}
|
| 339 |
}
|
| 340 |
</script>
|