Spaces:
Sleeping
Sleeping
Create templates/index.html
Browse files- templates/index.html +65 -0
templates/index.html
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="ar" dir="rtl">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<title>مدقق قوة وسلامة كلمة المرور</title>
|
| 6 |
+
<style>
|
| 7 |
+
/* كود CSS لتجميل الواجهة (تم اختصاره هنا لتجنب التكرار) */
|
| 8 |
+
body { font-family: Tahoma, Geneva, Verdana, sans-serif; background-color: #f4f7f6; direction: rtl; text-align: right; display: flex; justify-content: center; align-items: center; min-height: 100vh; }
|
| 9 |
+
.container { background-color: #ffffff; padding: 30px; border-radius: 12px; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1); width: 100%; max-width: 500px; }
|
| 10 |
+
h1 { color: #2c3e50; border-bottom: 3px solid #3498db; padding-bottom: 10px; margin-bottom: 25px; text-align: center; }
|
| 11 |
+
input[type="password"] { width: 100%; padding: 15px; margin-bottom: 20px; border: 2px solid #ccc; border-radius: 8px; box-sizing: border-box; font-size: 18px; direction: ltr; text-align: left; }
|
| 12 |
+
.result { padding: 15px; border-radius: 8px; margin-top: 20px; font-weight: bold; display: none; }
|
| 13 |
+
.red { background-color: #f8d7da; color: #721c24; }
|
| 14 |
+
.orange { background-color: #ffe8b7; color: #856404; }
|
| 15 |
+
.green { background-color: #d4edda; color: #155724; }
|
| 16 |
+
</style>
|
| 17 |
+
</head>
|
| 18 |
+
<body>
|
| 19 |
+
<div class="container">
|
| 20 |
+
<h1>مدقق قوة وسلامة كلمة المرور 🔒</h1>
|
| 21 |
+
|
| 22 |
+
<label for="password_input">أدخل كلمة المرور للفحص (عربي/إنجليزي/رموز):</label>
|
| 23 |
+
<input type="password" id="password_input" onkeyup="checkPassword()">
|
| 24 |
+
|
| 25 |
+
<div id="result_box" class="result">
|
| 26 |
+
<p><strong>حالة كلمة المرور:</strong> <span id="password_status"></span></p>
|
| 27 |
+
<ul id="feedback_details"></ul>
|
| 28 |
+
</div>
|
| 29 |
+
</div>
|
| 30 |
+
|
| 31 |
+
<script>
|
| 32 |
+
function checkPassword() {
|
| 33 |
+
const password = document.getElementById('password_input').value;
|
| 34 |
+
const resultBox = document.getElementById('result_box');
|
| 35 |
+
|
| 36 |
+
if (password.length === 0) {
|
| 37 |
+
resultBox.style.display = 'none';
|
| 38 |
+
return;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
// إرسال طلب POST إلى الخادم (app.py)
|
| 42 |
+
fetch('/check', {
|
| 43 |
+
method: 'POST',
|
| 44 |
+
headers: { 'Content-Type': 'application/json' },
|
| 45 |
+
body: JSON.stringify({ 'password': password })
|
| 46 |
+
})
|
| 47 |
+
.then(response => response.json())
|
| 48 |
+
.then(data => {
|
| 49 |
+
// تحديث الواجهة بالنتائج المستلمة
|
| 50 |
+
resultBox.style.display = 'block';
|
| 51 |
+
resultBox.className = `result ${data.color}`;
|
| 52 |
+
document.getElementById('password_status').textContent = data.status;
|
| 53 |
+
|
| 54 |
+
const feedbackDetails = document.getElementById('feedback_details');
|
| 55 |
+
feedbackDetails.innerHTML = '';
|
| 56 |
+
data.feedback.forEach(item => {
|
| 57 |
+
const li = document.createElement('li');
|
| 58 |
+
li.textContent = item;
|
| 59 |
+
feedbackDetails.appendChild(li);
|
| 60 |
+
});
|
| 61 |
+
});
|
| 62 |
+
}
|
| 63 |
+
</script>
|
| 64 |
+
</body>
|
| 65 |
+
</html>
|