Spaces:
Sleeping
Sleeping
Update templates/password-strength.html
Browse files- templates/password-strength.html +35 -60
templates/password-strength.html
CHANGED
|
@@ -9,10 +9,10 @@
|
|
| 9 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 10 |
|
| 11 |
<style>
|
| 12 |
-
/* الأنماط ال
|
| 13 |
body {
|
| 14 |
font-family: 'Cairo', sans-serif;
|
| 15 |
-
background-color: #0b132b;
|
| 16 |
color: #ffffff;
|
| 17 |
line-height: 1.6;
|
| 18 |
display: flex;
|
|
@@ -23,21 +23,19 @@
|
|
| 23 |
direction: rtl;
|
| 24 |
}
|
| 25 |
|
| 26 |
-
/* تنسيق الحاوية (مطابق لبطاقات موقعك) */
|
| 27 |
.container {
|
| 28 |
-
background-color: #111a30;
|
| 29 |
padding: 30px;
|
| 30 |
border-radius: 10px;
|
| 31 |
-
box-shadow: 0 5px 20px rgba(0, 170, 255, 0.1);
|
| 32 |
width: 100%;
|
| 33 |
max-width: 500px;
|
| 34 |
border: 1px solid #2a3a5a;
|
| 35 |
}
|
| 36 |
|
| 37 |
-
/* تنسيق العنوان (مطابق لـ section-title) */
|
| 38 |
h1 {
|
| 39 |
font-size: 28px;
|
| 40 |
-
color: #00aaff;
|
| 41 |
border-bottom: 2px solid #00aaff;
|
| 42 |
padding-bottom: 10px;
|
| 43 |
margin-bottom: 30px;
|
|
@@ -45,20 +43,15 @@
|
|
| 45 |
display: block;
|
| 46 |
}
|
| 47 |
|
| 48 |
-
/* تنسيق الـ Label */
|
| 49 |
label {
|
| 50 |
font-weight: 700;
|
| 51 |
color: #e6f7ff;
|
| 52 |
display: block;
|
| 53 |
margin-bottom: 8px;
|
| 54 |
-
font-size: 16px;
|
| 55 |
}
|
| 56 |
|
| 57 |
-
/*
|
| 58 |
-
.password-input-wrapper {
|
| 59 |
-
position: relative;
|
| 60 |
-
margin-bottom: 25px;
|
| 61 |
-
}
|
| 62 |
input[type="password"], input[type="text"] {
|
| 63 |
width: 100%;
|
| 64 |
padding: 15px;
|
|
@@ -69,15 +62,13 @@
|
|
| 69 |
direction: ltr;
|
| 70 |
text-align: left;
|
| 71 |
padding-left: 50px;
|
| 72 |
-
background-color: #0b132b;
|
| 73 |
-
color: #ffffff;
|
| 74 |
-
transition: border-color 0.3s ease;
|
| 75 |
}
|
| 76 |
input[type="password"]:focus, input[type="text"]:focus {
|
| 77 |
-
border-color: #00aaff;
|
| 78 |
}
|
| 79 |
|
| 80 |
-
/* زر الإظهار/الإخفاء (باستخدام أيقونات Font Awesome) */
|
| 81 |
.toggle-btn {
|
| 82 |
position: absolute;
|
| 83 |
left: 10px;
|
|
@@ -87,41 +78,19 @@
|
|
| 87 |
border: none;
|
| 88 |
cursor: pointer;
|
| 89 |
font-size: 1.2em;
|
| 90 |
-
color: #c0d0f0;
|
| 91 |
-
|
| 92 |
-
}
|
| 93 |
-
.toggle-btn:hover {
|
| 94 |
-
color: #00aaff; /* لون أزرق عند التحويم */
|
| 95 |
}
|
|
|
|
| 96 |
|
| 97 |
-
/* تنسيق صندوق النتائج */
|
| 98 |
-
.result {
|
| 99 |
-
padding: 18px;
|
| 100 |
-
border-radius: 8px;
|
| 101 |
-
margin-top: 25px;
|
| 102 |
-
font-size: 1.1em;
|
| 103 |
-
font-weight: bold;
|
| 104 |
-
display: none;
|
| 105 |
-
}
|
| 106 |
.result p { margin-bottom: 5px; }
|
| 107 |
-
|
| 108 |
-
/* الألوان التنبيهية (محدثة لتتوافق مع خلفية الموقع الداكنة) */
|
| 109 |
.red { background-color: #2a0f12; color: #ff6b6b; border: 1px solid #a33232; } /* ضعيفة جداً */
|
| 110 |
.orange { background-color: #3b2a0f; color: #ffc36b; border: 1px solid #a37232; } /* جيدة (متوسطة) */
|
| 111 |
.green { background-color: #122a0f; color: #6bff6b; border: 1px solid #32a332; } /* آمنة */
|
| 112 |
|
| 113 |
-
/* تنسيق قائمة النصائح */
|
| 114 |
-
.feedback-list {
|
| 115 |
-
padding-right: 20px;
|
| 116 |
-
list-style-type: none;
|
| 117 |
-
margin-top: 10px;
|
| 118 |
-
font-weight: normal;
|
| 119 |
-
}
|
| 120 |
-
.feedback-list li {
|
| 121 |
-
margin-bottom: 5px;
|
| 122 |
-
font-size: 0.95em;
|
| 123 |
-
}
|
| 124 |
-
|
| 125 |
/* شريط التقدم */
|
| 126 |
.progress-bar-container {
|
| 127 |
width: 100%;
|
|
@@ -134,8 +103,7 @@
|
|
| 134 |
|
| 135 |
.progress-bar {
|
| 136 |
height: 100%;
|
| 137 |
-
width: 0%;
|
| 138 |
-
background-color: #00aaff; /* اللون الأساسي للتقدم */
|
| 139 |
transition: width 0.4s ease-in-out, background-color 0.4s ease;
|
| 140 |
text-align: center;
|
| 141 |
color: #111a30;
|
|
@@ -146,14 +114,21 @@
|
|
| 146 |
.progress-bar.red-bar { background-color: #ff6b6b; }
|
| 147 |
.progress-bar.orange-bar { background-color: #ffc36b; }
|
| 148 |
.progress-bar.green-bar { background-color: #6bff6b; }
|
| 149 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
</style>
|
| 151 |
</head>
|
| 152 |
<body>
|
| 153 |
<div class="container">
|
| 154 |
-
<h1><i class="fas fa-key" style="margin-left: 10px;"></i> فحص قوة كلمة السر</h1>
|
| 155 |
|
| 156 |
-
<label for="password_input">أدخل كلمة المرور للفحص
|
| 157 |
|
| 158 |
<div class="password-input-wrapper">
|
| 159 |
<input type="password" id="password_input" onkeyup="checkPassword()">
|
|
@@ -169,23 +144,23 @@
|
|
| 169 |
<div id="progress_bar" class="progress-bar"></div>
|
| 170 |
</div>
|
| 171 |
|
| 172 |
-
<p style="margin-top: 15px;"><strong>نسبة الحماية:</strong> <span id="protection_percentage">0%</span></p>
|
| 173 |
<ul id="feedback_details" class="feedback-list"></ul>
|
| 174 |
</div>
|
| 175 |
</div>
|
| 176 |
|
| 177 |
<script>
|
| 178 |
-
// دالة تبديل الإظهار/الإخفاء
|
| 179 |
function togglePasswordVisibility() {
|
| 180 |
const passwordInput = document.getElementById('password_input');
|
| 181 |
const toggleIcon = document.getElementById('toggle_btn').querySelector('i');
|
| 182 |
|
| 183 |
if (passwordInput.type === 'password') {
|
| 184 |
passwordInput.type = 'text';
|
| 185 |
-
toggleIcon.className = 'fas fa-eye-slash'; //
|
| 186 |
} else {
|
| 187 |
passwordInput.type = 'password';
|
| 188 |
-
toggleIcon.className = 'fas fa-eye'; //
|
| 189 |
}
|
| 190 |
}
|
| 191 |
|
|
@@ -203,7 +178,7 @@
|
|
| 203 |
progressBar.classList.add('green-bar');
|
| 204 |
}
|
| 205 |
|
| 206 |
-
// عرض النسبة داخل الشريط
|
| 207 |
progressBar.textContent = percentage > 20 ? `${percentage}%` : '';
|
| 208 |
}
|
| 209 |
|
|
@@ -213,7 +188,7 @@
|
|
| 213 |
|
| 214 |
if (password.length === 0) {
|
| 215 |
resultBox.style.display = 'none';
|
| 216 |
-
updateProgressBar(0, 'red');
|
| 217 |
return;
|
| 218 |
}
|
| 219 |
|
|
@@ -236,12 +211,12 @@
|
|
| 236 |
// تحديث شريط التقدم
|
| 237 |
updateProgressBar(percentage, data.color);
|
| 238 |
|
| 239 |
-
// تحديث النصائح
|
| 240 |
const feedbackDetails = document.getElementById('feedback_details');
|
| 241 |
feedbackDetails.innerHTML = '';
|
| 242 |
data.feedback.forEach(item => {
|
| 243 |
const li = document.createElement('li');
|
| 244 |
-
li.
|
| 245 |
feedbackDetails.appendChild(li);
|
| 246 |
});
|
| 247 |
});
|
|
|
|
| 9 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 10 |
|
| 11 |
<style>
|
| 12 |
+
/* ========== الأنماط المطابقة لتصميم SkyData الداكن ========== */
|
| 13 |
body {
|
| 14 |
font-family: 'Cairo', sans-serif;
|
| 15 |
+
background-color: #0b132b; /* خلفية داكنة */
|
| 16 |
color: #ffffff;
|
| 17 |
line-height: 1.6;
|
| 18 |
display: flex;
|
|
|
|
| 23 |
direction: rtl;
|
| 24 |
}
|
| 25 |
|
|
|
|
| 26 |
.container {
|
| 27 |
+
background-color: #111a30;
|
| 28 |
padding: 30px;
|
| 29 |
border-radius: 10px;
|
| 30 |
+
box-shadow: 0 5px 20px rgba(0, 170, 255, 0.1);
|
| 31 |
width: 100%;
|
| 32 |
max-width: 500px;
|
| 33 |
border: 1px solid #2a3a5a;
|
| 34 |
}
|
| 35 |
|
|
|
|
| 36 |
h1 {
|
| 37 |
font-size: 28px;
|
| 38 |
+
color: #00aaff; /* لون أزرق SkyData */
|
| 39 |
border-bottom: 2px solid #00aaff;
|
| 40 |
padding-bottom: 10px;
|
| 41 |
margin-bottom: 30px;
|
|
|
|
| 43 |
display: block;
|
| 44 |
}
|
| 45 |
|
|
|
|
| 46 |
label {
|
| 47 |
font-weight: 700;
|
| 48 |
color: #e6f7ff;
|
| 49 |
display: block;
|
| 50 |
margin-bottom: 8px;
|
|
|
|
| 51 |
}
|
| 52 |
|
| 53 |
+
/* حقل الإدخال وزر الإظهار/الإخفاء */
|
| 54 |
+
.password-input-wrapper { position: relative; margin-bottom: 25px; }
|
|
|
|
|
|
|
|
|
|
| 55 |
input[type="password"], input[type="text"] {
|
| 56 |
width: 100%;
|
| 57 |
padding: 15px;
|
|
|
|
| 62 |
direction: ltr;
|
| 63 |
text-align: left;
|
| 64 |
padding-left: 50px;
|
| 65 |
+
background-color: #0b132b;
|
| 66 |
+
color: #ffffff;
|
|
|
|
| 67 |
}
|
| 68 |
input[type="password"]:focus, input[type="text"]:focus {
|
| 69 |
+
border-color: #00aaff;
|
| 70 |
}
|
| 71 |
|
|
|
|
| 72 |
.toggle-btn {
|
| 73 |
position: absolute;
|
| 74 |
left: 10px;
|
|
|
|
| 78 |
border: none;
|
| 79 |
cursor: pointer;
|
| 80 |
font-size: 1.2em;
|
| 81 |
+
color: #c0d0f0;
|
| 82 |
+
padding: 0;
|
|
|
|
|
|
|
|
|
|
| 83 |
}
|
| 84 |
+
.toggle-btn:hover { color: #00aaff; }
|
| 85 |
|
| 86 |
+
/* تنسيق صندوق النتائج والألوان التنبيهية */
|
| 87 |
+
.result { padding: 18px; border-radius: 8px; margin-top: 25px; font-size: 1.1em; font-weight: bold; display: none; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
.result p { margin-bottom: 5px; }
|
| 89 |
+
|
|
|
|
| 90 |
.red { background-color: #2a0f12; color: #ff6b6b; border: 1px solid #a33232; } /* ضعيفة جداً */
|
| 91 |
.orange { background-color: #3b2a0f; color: #ffc36b; border: 1px solid #a37232; } /* جيدة (متوسطة) */
|
| 92 |
.green { background-color: #122a0f; color: #6bff6b; border: 1px solid #32a332; } /* آمنة */
|
| 93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
/* شريط التقدم */
|
| 95 |
.progress-bar-container {
|
| 96 |
width: 100%;
|
|
|
|
| 103 |
|
| 104 |
.progress-bar {
|
| 105 |
height: 100%;
|
| 106 |
+
width: 0%;
|
|
|
|
| 107 |
transition: width 0.4s ease-in-out, background-color 0.4s ease;
|
| 108 |
text-align: center;
|
| 109 |
color: #111a30;
|
|
|
|
| 114 |
.progress-bar.red-bar { background-color: #ff6b6b; }
|
| 115 |
.progress-bar.orange-bar { background-color: #ffc36b; }
|
| 116 |
.progress-bar.green-bar { background-color: #6bff6b; }
|
| 117 |
+
|
| 118 |
+
/* قائمة النصائح */
|
| 119 |
+
.feedback-list {
|
| 120 |
+
padding-right: 20px;
|
| 121 |
+
list-style-type: none;
|
| 122 |
+
margin-top: 10px;
|
| 123 |
+
font-weight: normal;
|
| 124 |
+
}
|
| 125 |
</style>
|
| 126 |
</head>
|
| 127 |
<body>
|
| 128 |
<div class="container">
|
| 129 |
+
<h1><i class="fas fa-key" style="margin-left: 10px;"></i> فحص قوة كلمة السر الذكي</h1>
|
| 130 |
|
| 131 |
+
<label for="password_input">أدخل كلمة المرور للفحص:</label>
|
| 132 |
|
| 133 |
<div class="password-input-wrapper">
|
| 134 |
<input type="password" id="password_input" onkeyup="checkPassword()">
|
|
|
|
| 144 |
<div id="progress_bar" class="progress-bar"></div>
|
| 145 |
</div>
|
| 146 |
|
| 147 |
+
<p style="margin-top: 15px;"><strong>نسبة الحماية المُقدَّرة:</strong> <span id="protection_percentage">0%</span></p>
|
| 148 |
<ul id="feedback_details" class="feedback-list"></ul>
|
| 149 |
</div>
|
| 150 |
</div>
|
| 151 |
|
| 152 |
<script>
|
| 153 |
+
// دالة تبديل الإظهار/الإخفاء (باستخدام الأيقونات الحقيقية)
|
| 154 |
function togglePasswordVisibility() {
|
| 155 |
const passwordInput = document.getElementById('password_input');
|
| 156 |
const toggleIcon = document.getElementById('toggle_btn').querySelector('i');
|
| 157 |
|
| 158 |
if (passwordInput.type === 'password') {
|
| 159 |
passwordInput.type = 'text';
|
| 160 |
+
toggleIcon.className = 'fas fa-eye-slash'; // إخفاء
|
| 161 |
} else {
|
| 162 |
passwordInput.type = 'password';
|
| 163 |
+
toggleIcon.className = 'fas fa-eye'; // إظهار
|
| 164 |
}
|
| 165 |
}
|
| 166 |
|
|
|
|
| 178 |
progressBar.classList.add('green-bar');
|
| 179 |
}
|
| 180 |
|
| 181 |
+
// عرض النسبة داخل الشريط
|
| 182 |
progressBar.textContent = percentage > 20 ? `${percentage}%` : '';
|
| 183 |
}
|
| 184 |
|
|
|
|
| 188 |
|
| 189 |
if (password.length === 0) {
|
| 190 |
resultBox.style.display = 'none';
|
| 191 |
+
updateProgressBar(0, 'red');
|
| 192 |
return;
|
| 193 |
}
|
| 194 |
|
|
|
|
| 211 |
// تحديث شريط التقدم
|
| 212 |
updateProgressBar(percentage, data.color);
|
| 213 |
|
| 214 |
+
// تحديث النصائح (باستخدام innerHTML للتعامل مع تنسيقات zxcvbn)
|
| 215 |
const feedbackDetails = document.getElementById('feedback_details');
|
| 216 |
feedbackDetails.innerHTML = '';
|
| 217 |
data.feedback.forEach(item => {
|
| 218 |
const li = document.createElement('li');
|
| 219 |
+
li.innerHTML = item;
|
| 220 |
feedbackDetails.appendChild(li);
|
| 221 |
});
|
| 222 |
});
|