Skydata001 commited on
Commit
60be266
·
verified ·
1 Parent(s): 5939ec4

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +172 -24
templates/index.html CHANGED
@@ -3,48 +3,173 @@
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
- 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; padding: 20px;}
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
- label { font-weight: bold; color: #34495e; display: block; margin-bottom: 8px;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
  /* تنسيق حقل الإدخال مع زر الإظهار/الإخفاء */
14
- .password-input-wrapper { position: relative; margin-bottom: 20px; }
 
 
 
15
  input[type="password"], input[type="text"] {
16
- width: 100%; padding: 15px; border: 2px solid #ccc; border-radius: 8px;
17
- box-sizing: border-box; font-size: 18px; direction: ltr; text-align: left;
18
- padding-left: 50px; /* مسافة للزر */
 
 
 
 
 
 
 
 
 
19
  }
 
 
 
 
 
20
  .toggle-btn {
21
- position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
22
- background: none; border: none; cursor: pointer; font-size: 1.2em;
23
- color: #7f8c8d;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  }
25
 
26
- .result { padding: 15px; border-radius: 8px; margin-top: 20px; font-size: 1.1em; font-weight: bold; display: none; }
27
- .feedback-list { padding-right: 20px; list-style-type: none; }
28
- .red { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
29
- .orange { background-color: #ffe8b7; color: #856404; border: 1px solid #ffda90; }
30
- .green { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
 
 
 
 
 
 
 
 
 
 
31
  </style>
32
  </head>
33
  <body>
34
  <div class="container">
35
- <h1>مدقق قوة وسلامة كلمة المرور 🔒</h1>
36
 
37
  <label for="password_input">أدخل كلمة المرور للفحص (عربي/إنجليزي/رموز):</label>
 
38
  <div class="password-input-wrapper">
39
  <input type="password" id="password_input" onkeyup="checkPassword()">
40
  <button type="button" class="toggle-btn" onclick="togglePasswordVisibility()" id="toggle_btn">
41
- 👁️
42
  </button>
43
  </div>
44
 
45
  <div id="result_box" class="result">
46
  <p><strong>حالة كلمة المرور:</strong> <span id="password_status"></span></p>
47
- <p><strong>نسبة الحماية:</strong> <span id="protection_percentage"></span></p>
 
 
 
 
 
48
  <ul id="feedback_details" class="feedback-list"></ul>
49
  </div>
50
  </div>
@@ -53,23 +178,42 @@
53
  // دالة تبديل الإظهار/الإخفاء
54
  function togglePasswordVisibility() {
55
  const passwordInput = document.getElementById('password_input');
56
- const toggleBtn = document.getElementById('toggle_btn');
57
 
58
  if (passwordInput.type === 'password') {
59
  passwordInput.type = 'text';
60
- toggleBtn.textContent = '🙈'; // أيقونة إخفاء
61
  } else {
62
  passwordInput.type = 'password';
63
- toggleBtn.textContent = '👁️'; // أيقونة إظهار
64
  }
65
  }
66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  function checkPassword() {
68
  const password = document.getElementById('password_input').value;
69
  const resultBox = document.getElementById('result_box');
70
 
71
  if (password.length === 0) {
72
  resultBox.style.display = 'none';
 
73
  return;
74
  }
75
 
@@ -86,7 +230,11 @@
86
  document.getElementById('password_status').textContent = data.status;
87
 
88
  // تحديث النسبة المئوية
89
- document.getElementById('protection_percentage').textContent = `${data.percentage}%`;
 
 
 
 
90
 
91
  // تحديث النصائح
92
  const feedbackDetails = document.getElementById('feedback_details');
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>فحص قوة كلمة السر - SkyData</title>
7
+
8
+ <link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;700&display=swap" rel="stylesheet">
9
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
10
+
11
  <style>
12
+ /* الأنماط الأساسية المأخوذة من body في style.css */
13
+ body {
14
+ font-family: 'Cairo', sans-serif;
15
+ background-color: #0b132b;
16
+ color: #ffffff;
17
+ line-height: 1.6;
18
+ display: flex;
19
+ justify-content: center;
20
+ align-items: center;
21
+ min-height: 100vh;
22
+ padding: 50px 20px;
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;
44
+ text-align: center;
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;
65
+ border: 2px solid #2a3a5a;
66
+ border-radius: 8px;
67
+ box-sizing: border-box;
68
+ font-size: 18px;
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;
84
+ top: 50%;
85
+ transform: translateY(-50%);
86
+ background: none;
87
+ border: none;
88
+ cursor: pointer;
89
+ font-size: 1.2em;
90
+ color: #c0d0f0; /* لون الأيقونة */
91
+ transition: color 0.3s ease;
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%;
128
+ background-color: #2a3a5a;
129
+ border-radius: 10px;
130
+ margin-top: 15px;
131
+ overflow: hidden;
132
+ height: 15px;
133
  }
134
 
135
+ .progress-bar {
136
+ height: 100%;
137
+ width: 0%; /* سيبدأ من 0 ويتم تحديثه بـ JS */
138
+ background-color: #00aaff; /* اللون الأساسي للتقدم */
139
+ transition: width 0.4s ease-in-out, background-color 0.4s ease;
140
+ text-align: center;
141
+ color: #111a30;
142
+ font-size: 10px;
143
+ line-height: 15px;
144
+ font-weight: 700;
145
+ }
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">أدخل كلمة المرور للفحص (عربي/إنجليزي/رموز):</label>
157
+
158
  <div class="password-input-wrapper">
159
  <input type="password" id="password_input" onkeyup="checkPassword()">
160
  <button type="button" class="toggle-btn" onclick="togglePasswordVisibility()" id="toggle_btn">
161
+ <i class="fas fa-eye"></i>
162
  </button>
163
  </div>
164
 
165
  <div id="result_box" class="result">
166
  <p><strong>حالة كلمة المرور:</strong> <span id="password_status"></span></p>
167
+
168
+ <div class="progress-bar-container">
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>
 
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
 
192
+ function updateProgressBar(percentage, color) {
193
+ const progressBar = document.getElementById('progress_bar');
194
+ progressBar.style.width = `${percentage}%`;
195
+
196
+ // تحديث لون الشريط
197
+ progressBar.className = 'progress-bar';
198
+ if (color === 'red') {
199
+ progressBar.classList.add('red-bar');
200
+ } else if (color === 'orange') {
201
+ progressBar.classList.add('orange-bar');
202
+ } else if (color === 'green') {
203
+ progressBar.classList.add('green-bar');
204
+ }
205
+
206
+ // عرض النسبة داخل الشريط إذا كان واسعاً بما يكفي
207
+ progressBar.textContent = percentage > 20 ? `${percentage}%` : '';
208
+ }
209
+
210
  function checkPassword() {
211
  const password = document.getElementById('password_input').value;
212
  const resultBox = document.getElementById('result_box');
213
 
214
  if (password.length === 0) {
215
  resultBox.style.display = 'none';
216
+ updateProgressBar(0, 'red'); // إعادة تعيين الشريط
217
  return;
218
  }
219
 
 
230
  document.getElementById('password_status').textContent = data.status;
231
 
232
  // تحديث النسبة المئوية
233
+ const percentage = data.percentage || 0;
234
+ document.getElementById('protection_percentage').textContent = `${percentage}%`;
235
+
236
+ // تحديث شريط التقدم
237
+ updateProgressBar(percentage, data.color);
238
 
239
  // تحديث النصائح
240
  const feedbackDetails = document.getElementById('feedback_details');