-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpassword.html
More file actions
352 lines (314 loc) · 15 KB
/
Copy pathpassword.html
File metadata and controls
352 lines (314 loc) · 15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>تغيير كلمة المرور | El Jasus</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="icon" type="image/png" href="ElJasus.png">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"/>
<link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;700;900&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<link rel="stylesheet" href="mobile.css">
<script src="sound-system.js" defer></script>
<script src="qr-notifications.js" defer></script>
<script src="dialogs.js"></script>
<script src="moderation.js"></script>
<style>
:root {
--bg-color: #0a0e1a;
--primary-color: #00f2ff;
--secondary-color: #7c30ff;
}
body {
font-family: 'Cairo', sans-serif;
background: linear-gradient(135deg, #0a0e1a 0%, #1a1535 50%, #0f0c1d 100%);
background-attachment: fixed;
color: #ffffff;
min-height: 100vh;
position: relative;
overflow-x: hidden;
}
body::before {
content: '';
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image:
linear-gradient(rgba(0, 242, 255, 0.03) 1px, transparent 1px),
linear-gradient(90deg, rgba(0, 242, 255, 0.03) 1px, transparent 1px);
background-size: 50px 50px;
animation: gridMove 20s linear infinite;
pointer-events: none;
z-index: 0;
}
@keyframes gridMove {
0% { transform: translateY(0); }
100% { transform: translateY(50px); }
}
.glass {
background: linear-gradient(135deg, rgba(15, 20, 35, 0.9), rgba(25, 30, 50, 0.8));
backdrop-filter: blur(20px);
border: 2px solid;
border-image: linear-gradient(135deg, rgba(0, 242, 255, 0.3), rgba(124, 48, 255, 0.3)) 1;
box-shadow:
0 8px 32px rgba(0, 0, 0, 0.4),
inset 0 1px 0 rgba(255, 255, 255, 0.1),
0 0 30px rgba(0, 242, 255, 0.1);
position: relative;
overflow: hidden;
}
.glass::before {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: linear-gradient(
45deg,
transparent,
rgba(0, 242, 255, 0.05),
transparent
);
animation: shimmer 3s infinite;
pointer-events: none;
}
@keyframes shimmer {
0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}
.neon-text {
font-family: 'Orbitron', sans-serif;
text-shadow:
0 0 10px rgba(0, 242, 255, 0.8),
0 0 20px rgba(0, 242, 255, 0.6);
}
.btn-primary {
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
border: 2px solid rgba(0, 242, 255, 0.5);
box-shadow: 0 0 20px rgba(0, 242, 255, 0.4);
transition: all 0.3s ease;
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 0 30px rgba(0, 242, 255, 0.6);
}
input {
background: rgba(0, 242, 255, 0.05);
border: 2px solid rgba(0, 242, 255, 0.2);
transition: all 0.3s ease;
}
input:focus {
background: rgba(0, 242, 255, 0.1);
border-color: var(--primary-color);
box-shadow: 0 0 20px rgba(0, 242, 255, 0.2);
}
/* Show password checkbox */
#showPasswordToggle:checked ~ #pwCheckbox,
.pw-checked {
background: linear-gradient(135deg, #00f2ff, #7c30ff) !important;
border-color: #00f2ff !important;
}
#pwCheckbox::after {
content: '';
position: absolute;
left: 5px; top: 1px;
width: 6px; height: 11px;
border: solid white;
border-width: 0 2px 2px 0;
transform: rotate(45deg);
opacity: 0;
transition: opacity 0.3s ease;
}
.pw-checked::after { opacity: 1 !important; }
</style>
</head>
<body class="p-4">
<div class="max-w-xl mx-auto relative z-10 mt-10">
<!-- Header -->
<div class="flex items-center justify-between mb-6">
<a href="account.html" class="flex items-center gap-2 text-gray-400 hover:text-cyan-400 transition-all hover:translate-x-1">
<i class="fas fa-arrow-right text-xl"></i>
<span class="text-sm font-bold">رجوع</span>
</a>
<div class="text-center flex-1">
<h1 class="text-3xl font-black uppercase tracking-tight neon-text">تغيير كلمة المرور</h1>
<p class="text-[10px] text-gray-500 font-bold uppercase tracking-wider mt-1" style="font-family: 'Orbitron', sans-serif;">CHANGE PASSWORD</p>
</div>
<div class="w-20"></div>
</div>
<!-- Password Change Form -->
<div class="glass rounded-3xl p-8 animate__animated animate__fadeIn">
<div class="flex items-center gap-3 mb-6">
<div class="w-12 h-12 rounded-lg bg-purple-500/20 border-2 border-purple-500/30 flex items-center justify-center">
<i class="fas fa-key text-purple-400 text-xl"></i>
</div>
<div>
<h2 class="text-xl font-black neon-text">تغيير كلمة المرور</h2>
<p class="text-xs text-gray-400">قم بتحديث كلمة المرور الخاصة بك</p>
</div>
</div>
<form id="passwordForm" class="space-y-4">
<div>
<label class="block text-sm font-bold text-gray-400 mb-2">كلمة المرور الحالية</label>
<input
type="password"
id="currentPassword"
placeholder="أدخل كلمة المرور الحالية"
class="w-full p-4 rounded-xl outline-none text-sm font-bold text-white"
required
>
</div>
<div>
<label class="block text-sm font-bold text-gray-400 mb-2">كلمة المرور الجديدة</label>
<input
type="password"
id="newPassword"
placeholder="أدخل كلمة المرور الجديدة"
class="w-full p-4 rounded-xl outline-none text-sm font-bold text-white"
required
>
<p class="text-xs text-gray-500 mt-2">يجب أن تكون 6 أحرف على الأقل</p>
</div>
<div>
<label class="block text-sm font-bold text-gray-400 mb-2">تأكيد كلمة المرور الجديدة</label>
<input
type="password"
id="confirmPassword"
placeholder="أعد إدخال كلمة المرور الجديدة"
class="w-full p-4 rounded-xl outline-none text-sm font-bold text-white"
required
>
</div>
<!-- Show Password Toggle -->
<label style="
display:flex;align-items:center;gap:12px;
cursor:pointer;user-select:none;padding:4px 0;
">
<input type="checkbox" id="showPasswordToggle" style="display:none;" onchange="
var t=this.checked?'text':'password';
['currentPassword','newPassword','confirmPassword'].forEach(function(id){
document.getElementById(id).type=t;
});
document.getElementById('eyeIconPassword').className=this.checked?'fas fa-eye-slash':'fas fa-eye';
document.getElementById('pwCheckbox').classList.toggle('pw-checked', this.checked);
">
<span id="pwCheckbox" style="
width:22px;height:22px;flex-shrink:0;
background:rgba(0,242,255,0.1);
border:2px solid rgba(0,242,255,0.3);
border-radius:6px;position:relative;
transition:all .3s ease;
display:flex;align-items:center;justify-content:center;
"></span>
<span style="display:flex;align-items:center;gap:7px;color:#fff;font-size:.9rem;font-weight:600;">
<i id="eyeIconPassword" class="fas fa-eye" style="color:#00f2ff;font-size:14px;"></i>
إظهار كلمة المرور
</span>
</label>
<div class="pt-4">
<button type="submit" class="w-full btn-primary py-4 rounded-xl font-black text-sm uppercase tracking-wider">
<i class="fas fa-check ml-2"></i>
تحديث كلمة المرور
</button>
</div>
</form>
</div>
<!-- Info Card -->
<div class="glass rounded-2xl p-4 mt-4 animate__animated animate__fadeIn border-2 border-yellow-500/30">
<div class="flex items-start gap-3">
<i class="fas fa-info-circle text-yellow-400 text-xl mt-1"></i>
<div>
<h3 class="font-bold text-yellow-400 mb-1">نصيحة أمنية</h3>
<p class="text-xs text-gray-400">
استخدم كلمة مرور قوية تحتوي على أحرف كبيرة وصغيرة وأرقام ورموز خاصة لحماية حسابك.
</p>
</div>
</div>
</div>
</div>
<script type="module">
import { initializeApp } from "https://www.gstatic.com/firebasejs/12.7.0/firebase-app.js";
import { getAuth, onAuthStateChanged, updatePassword, reauthenticateWithCredential, EmailAuthProvider } from "https://www.gstatic.com/firebasejs/12.7.0/firebase-auth.js";
const firebaseConfig = {
apiKey: "AIzaSyDnd-pmKEatI3DaFz6xHWB5ucurtHXt9tk",
authDomain: "el-jasus.firebaseapp.com",
databaseURL: "https://el-jasus-default-rtdb.asia-southeast1.firebasedatabase.app",
projectId: "el-jasus",
storageBucket: "el-jasus.firebasestorage.app",
messagingSenderId: "415659587906",
appId: "1:415659587906:web:782f7940176ea4097eb0db",
measurementId: "G-N4K79FP56N"
};
const app = initializeApp(firebaseConfig);
const auth = getAuth(app);
let currentUser = null;
zxzxzz
// Check Authentication
onAuthStateChanged(auth, async (user) => {
if (user) {
currentUser = user;
} else {
alert('يجب تسجيل الدخول أولاً');
window.location.href = 'login.html';
}
await MOD.init(db, user);
if (document.getElementById('_ej_ban')) return;
});
// Handle Password Change
document.getElementById('passwordForm').addEventListener('submit', async (e) => {
e.preventDefault();
const currentPassword = document.getElementById('currentPassword').value;
const newPassword = document.getElementById('newPassword').value;
const confirmPassword = document.getElementById('confirmPassword').value;
if (!currentPassword || !newPassword || !confirmPassword) {
alert('الرجاء ملء جميع الحقول');
return;
}
if (newPassword !== confirmPassword) {
alert('كلمة المرور الجديدة وتأكيدها غير متطابقين');
return;
}
if (newPassword.length < 6) {
alert('كلمة المرور يجب أن تكون 6 أحرف على الأقل');
return;
}
try {
// Check if user is using Google sign-in
const isGoogleUser = currentUser.providerData.some(
provider => provider.providerId === 'google.com'
);
if (isGoogleUser) {
alert('لا يمكن تغيير كلمة المرور لحسابات Google. يرجى إدارة كلمة المرور من خلال Google.');
return;
}
// Reauthenticate with current password
const credential = EmailAuthProvider.credential(currentUser.email, currentPassword);
await reauthenticateWithCredential(currentUser, credential);
// Update password
await updatePassword(currentUser, newPassword);
alert('تم تحديث كلمة المرور بنجاح!');
window.location.href = 'account.html';
} catch (error) {
console.error(error);
if (error.code === 'auth/wrong-password') {
alert('كلمة المرور الحالية غير صحيحة');
} else if (error.code === 'auth/invalid-credential') {
alert('بيانات الاعتماد غير صالحة. تأكد من أنك تستخدم كلمة المرور الصحيحة.');
} else {
alert('فشل تحديث كلمة المرور: ' + error.message);
}
}
});
</script>
<script>
window.alert = (msg) => UIAlert(msg);
window.confirm = (msg) => UIConfirm(msg);
window.prompt = (msg, defaultVal) => UIPrompt(msg, { defaultValue: defaultVal });
</script>
</body>
</html>