DatPro commited on
Commit
f5269df
·
verified ·
1 Parent(s): a4a1e94

Add 2 files

Browse files
Files changed (2) hide show
  1. index.html +235 -2
  2. prompts.txt +2 -1
index.html CHANGED
@@ -76,6 +76,10 @@
76
  font-size: 18px;
77
  margin: 0 5px;
78
  }
 
 
 
 
79
  </style>
80
  </head>
81
  <body class="bg-gray-100 font-sans">
@@ -169,7 +173,7 @@
169
  <div class="mt-6 text-center">
170
  <p class="text-sm text-white opacity-80">
171
  Chưa có tài khoản?
172
- <a href="#" class="font-medium text-white hover:underline">
173
  Đăng ký ngay
174
  </a>
175
  </p>
@@ -177,6 +181,110 @@
177
  </div>
178
  </div>
179
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  <!-- Forgot Password Screen (hidden by default) -->
181
  <div id="forgotPasswordScreen" class="hidden min-h-screen flex items-center justify-center login-container p-4">
182
  <div class="login-card rounded-2xl shadow-xl overflow-hidden w-full max-w-md p-8">
@@ -319,7 +427,7 @@
319
  <i class="fas fa-check text-4xl text-green-600"></i>
320
  </div>
321
  <h1 class="text-3xl font-bold text-white">Thành công!</h1>
322
- <p class="text-white opacity-80 mt-2">Mật khẩu của bạn đã được cập nhật thành công</p>
323
  </div>
324
 
325
  <a href="#" id="backToLoginFromSuccess"
@@ -737,6 +845,9 @@
737
 
738
  // Initialize OTP input fields
739
  initOtpInputs();
 
 
 
740
  });
741
 
742
  // Login Form Submission
@@ -770,6 +881,59 @@
770
  showDashboard(user);
771
  });
772
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
773
  // Forgot Password Link
774
  document.getElementById('forgotPasswordLink').addEventListener('click', function(e) {
775
  e.preventDefault();
@@ -850,6 +1014,14 @@
850
  });
851
  });
852
 
 
 
 
 
 
 
 
 
853
  // New Password Form Submission
854
  document.getElementById('newPasswordForm').addEventListener('submit', function(e) {
855
  e.preventDefault();
@@ -925,6 +1097,67 @@
925
  });
926
  }
927
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
928
  // Start Countdown Timer
929
  function startCountdown() {
930
  let timeLeft = 180; // 3 minutes in seconds
 
76
  font-size: 18px;
77
  margin: 0 5px;
78
  }
79
+ .password-strength {
80
+ height: 4px;
81
+ transition: all 0.3s ease;
82
+ }
83
  </style>
84
  </head>
85
  <body class="bg-gray-100 font-sans">
 
173
  <div class="mt-6 text-center">
174
  <p class="text-sm text-white opacity-80">
175
  Chưa có tài khoản?
176
+ <a href="#" id="registerLink" class="font-medium text-white hover:underline">
177
  Đăng ký ngay
178
  </a>
179
  </p>
 
181
  </div>
182
  </div>
183
 
184
+ <!-- Register Screen (hidden by default) -->
185
+ <div id="registerScreen" class="hidden min-h-screen flex items-center justify-center login-container p-4">
186
+ <div class="login-card rounded-2xl shadow-xl overflow-hidden w-full max-w-md p-8">
187
+ <div class="text-center mb-8">
188
+ <i class="fas fa-user-plus text-5xl text-white mb-4"></i>
189
+ <h1 class="text-3xl font-bold text-white">Đăng ký tài khoản</h1>
190
+ <p class="text-white opacity-80 mt-2">Tạo tài khoản để bắt đầu sử dụng SalesHub</p>
191
+ </div>
192
+
193
+ <form id="registerForm" class="space-y-4">
194
+ <div>
195
+ <label for="fullName" class="block text-sm font-medium text-white mb-1">Họ và tên</label>
196
+ <div class="relative">
197
+ <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
198
+ <i class="fas fa-user text-white opacity-70"></i>
199
+ </div>
200
+ <input type="text" id="fullName" name="fullName" required
201
+ class="input-field w-full pl-10 pr-3 py-3 rounded-lg text-white placeholder-white opacity-80 focus:outline-none focus:ring-2 focus:ring-white">
202
+ </div>
203
+ </div>
204
+
205
+ <div>
206
+ <label for="registerEmail" class="block text-sm font-medium text-white mb-1">Email</label>
207
+ <div class="relative">
208
+ <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
209
+ <i class="fas fa-envelope text-white opacity-70"></i>
210
+ </div>
211
+ <input type="email" id="registerEmail" name="registerEmail" required
212
+ class="input-field w-full pl-10 pr-3 py-3 rounded-lg text-white placeholder-white opacity-80 focus:outline-none focus:ring-2 focus:ring-white">
213
+ </div>
214
+ </div>
215
+
216
+ <div>
217
+ <label for="registerUsername" class="block text-sm font-medium text-white mb-1">Tên đăng nhập</label>
218
+ <div class="relative">
219
+ <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
220
+ <i class="fas fa-at text-white opacity-70"></i>
221
+ </div>
222
+ <input type="text" id="registerUsername" name="registerUsername" required
223
+ class="input-field w-full pl-10 pr-3 py-3 rounded-lg text-white placeholder-white opacity-80 focus:outline-none focus:ring-2 focus:ring-white">
224
+ </div>
225
+ </div>
226
+
227
+ <div>
228
+ <label for="registerPassword" class="block text-sm font-medium text-white mb-1">Mật khẩu</label>
229
+ <div class="relative">
230
+ <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
231
+ <i class="fas fa-lock text-white opacity-70"></i>
232
+ </div>
233
+ <input type="password" id="registerPassword" name="registerPassword" required
234
+ class="input-field w-full pl-10 pr-3 py-3 rounded-lg text-white placeholder-white opacity-80 focus:outline-none focus:ring-2 focus:ring-white">
235
+ </div>
236
+ <div class="mt-2 grid grid-cols-4 gap-1">
237
+ <div id="passwordStrength1" class="password-strength bg-gray-300 rounded"></div>
238
+ <div id="passwordStrength2" class="password-strength bg-gray-300 rounded"></div>
239
+ <div id="passwordStrength3" class="password-strength bg-gray-300 rounded"></div>
240
+ <div id="passwordStrength4" class="password-strength bg-gray-300 rounded"></div>
241
+ </div>
242
+ <p id="passwordStrengthText" class="text-xs text-white opacity-60 mt-1">Mật khẩu phải có ít nhất 8 ký tự</p>
243
+ </div>
244
+
245
+ <div>
246
+ <label for="confirmRegisterPassword" class="block text-sm font-medium text-white mb-1">Xác nhận mật khẩu</label>
247
+ <div class="relative">
248
+ <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
249
+ <i class="fas fa-lock text-white opacity-70"></i>
250
+ </div>
251
+ <input type="password" id="confirmRegisterPassword" name="confirmRegisterPassword" required
252
+ class="input-field w-full pl-10 pr-3 py-3 rounded-lg text-white placeholder-white opacity-80 focus:outline-none focus:ring-2 focus:ring-white">
253
+ </div>
254
+ </div>
255
+
256
+ <div class="flex items-center">
257
+ <input id="showRegisterPassword" name="showRegisterPassword" type="checkbox"
258
+ class="h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded">
259
+ <label for="showRegisterPassword" class="ml-2 block text-sm text-white opacity-80">
260
+ Hiển thị mật khẩu
261
+ </label>
262
+ </div>
263
+
264
+ <div class="flex items-center">
265
+ <input id="agreeTerms" name="agreeTerms" type="checkbox" required
266
+ class="h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded">
267
+ <label for="agreeTerms" class="ml-2 block text-sm text-white opacity-80">
268
+ Tôi đồng ý với <a href="#" class="text-white font-medium hover:underline">Điều khoản dịch vụ</a> và <a href="#" class="text-white font-medium hover:underline">Chính sách bảo mật</a>
269
+ </label>
270
+ </div>
271
+
272
+ <div class="pt-2">
273
+ <button type="submit"
274
+ class="w-full flex justify-center py-3 px-4 border border-transparent rounded-lg shadow-sm text-sm font-medium text-indigo-700 bg-white hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-white transition duration-150">
275
+ Đăng ký
276
+ </button>
277
+ </div>
278
+ </form>
279
+
280
+ <div class="mt-6 text-center">
281
+ <a href="#" id="backToLoginFromRegister" class="text-sm font-medium text-white hover:underline">
282
+ <i class="fas fa-arrow-left mr-1"></i> Đã có tài khoản? Đăng nhập
283
+ </a>
284
+ </div>
285
+ </div>
286
+ </div>
287
+
288
  <!-- Forgot Password Screen (hidden by default) -->
289
  <div id="forgotPasswordScreen" class="hidden min-h-screen flex items-center justify-center login-container p-4">
290
  <div class="login-card rounded-2xl shadow-xl overflow-hidden w-full max-w-md p-8">
 
427
  <i class="fas fa-check text-4xl text-green-600"></i>
428
  </div>
429
  <h1 class="text-3xl font-bold text-white">Thành công!</h1>
430
+ <p class="text-white opacity-80 mt-2" id="successMessage">Mật khẩu của bạn đã được cập nhật thành công</p>
431
  </div>
432
 
433
  <a href="#" id="backToLoginFromSuccess"
 
845
 
846
  // Initialize OTP input fields
847
  initOtpInputs();
848
+
849
+ // Initialize password strength checker
850
+ initPasswordStrengthChecker();
851
  });
852
 
853
  // Login Form Submission
 
881
  showDashboard(user);
882
  });
883
 
884
+ // Register Link
885
+ document.getElementById('registerLink').addEventListener('click', function(e) {
886
+ e.preventDefault();
887
+ document.getElementById('loginScreen').classList.add('hidden');
888
+ document.getElementById('registerScreen').classList.remove('hidden');
889
+ });
890
+
891
+ // Back to Login from Register
892
+ document.getElementById('backToLoginFromRegister').addEventListener('click', function(e) {
893
+ e.preventDefault();
894
+ document.getElementById('registerScreen').classList.add('hidden');
895
+ document.getElementById('loginScreen').classList.remove('hidden');
896
+ });
897
+
898
+ // Register Form Submission
899
+ document.getElementById('registerForm').addEventListener('submit', function(e) {
900
+ e.preventDefault();
901
+
902
+ const fullName = document.getElementById('fullName').value;
903
+ const email = document.getElementById('registerEmail').value;
904
+ const username = document.getElementById('registerUsername').value;
905
+ const password = document.getElementById('registerPassword').value;
906
+ const confirmPassword = document.getElementById('confirmRegisterPassword').value;
907
+ const agreeTerms = document.getElementById('agreeTerms').checked;
908
+
909
+ // Validation
910
+ if (!fullName || !email || !username || !password || !confirmPassword) {
911
+ alert('Vui lòng điền đầy đủ thông tin');
912
+ return;
913
+ }
914
+
915
+ if (password.length < 8) {
916
+ alert('Mật khẩu phải có ít nhất 8 ký tự');
917
+ return;
918
+ }
919
+
920
+ if (password !== confirmPassword) {
921
+ alert('Mật khẩu xác nhận không khớp');
922
+ return;
923
+ }
924
+
925
+ if (!agreeTerms) {
926
+ alert('Vui lòng đồng ý với Điều khoản dịch vụ và Chính sách bảo mật');
927
+ return;
928
+ }
929
+
930
+ // In a real app, you would send this to a server to create account
931
+ // For demo, we'll just show success message
932
+ document.getElementById('successMessage').textContent = 'Tài khoản của bạn đã được tạo thành công!';
933
+ document.getElementById('registerScreen').classList.add('hidden');
934
+ document.getElementById('successScreen').classList.remove('hidden');
935
+ });
936
+
937
  // Forgot Password Link
938
  document.getElementById('forgotPasswordLink').addEventListener('click', function(e) {
939
  e.preventDefault();
 
1014
  });
1015
  });
1016
 
1017
+ // Show Register Password Toggle
1018
+ document.getElementById('showRegisterPassword').addEventListener('change', function(e) {
1019
+ const passwordInputs = document.querySelectorAll('#registerScreen input[type="password"]');
1020
+ passwordInputs.forEach(input => {
1021
+ input.type = e.target.checked ? 'text' : 'password';
1022
+ });
1023
+ });
1024
+
1025
  // New Password Form Submission
1026
  document.getElementById('newPasswordForm').addEventListener('submit', function(e) {
1027
  e.preventDefault();
 
1097
  });
1098
  }
1099
 
1100
+ // Initialize Password Strength Checker
1101
+ function initPasswordStrengthChecker() {
1102
+ const passwordInput = document.getElementById('registerPassword');
1103
+ const strengthBars = [
1104
+ document.getElementById('passwordStrength1'),
1105
+ document.getElementById('passwordStrength2'),
1106
+ document.getElementById('passwordStrength3'),
1107
+ document.getElementById('passwordStrength4')
1108
+ ];
1109
+ const strengthText = document.getElementById('passwordStrengthText');
1110
+
1111
+ passwordInput.addEventListener('input', function() {
1112
+ const password = this.value;
1113
+ let strength = 0;
1114
+
1115
+ // Length check
1116
+ if (password.length >= 8) strength++;
1117
+ if (password.length >= 12) strength++;
1118
+
1119
+ // Complexity checks
1120
+ if (/[A-Z]/.test(password)) strength++; // Uppercase letter
1121
+ if (/[0-9]/.test(password)) strength++; // Number
1122
+ if (/[^A-Za-z0-9]/.test(password)) strength++; // Special char
1123
+
1124
+ // Cap at 4
1125
+ strength = Math.min(strength, 4);
1126
+
1127
+ // Update UI
1128
+ strengthBars.forEach((bar, index) => {
1129
+ if (index < strength) {
1130
+ let color;
1131
+ if (strength <= 2) color = 'bg-red-500';
1132
+ else if (strength === 3) color = 'bg-yellow-500';
1133
+ else color = 'bg-green-500';
1134
+
1135
+ bar.className = `password-strength ${color} rounded`;
1136
+ } else {
1137
+ bar.className = 'password-strength bg-gray-300 rounded';
1138
+ }
1139
+ });
1140
+
1141
+ // Update text
1142
+ if (password.length === 0) {
1143
+ strengthText.textContent = 'Mật khẩu phải có ít nhất 8 ký tự';
1144
+ strengthText.className = 'text-xs text-white opacity-60 mt-1';
1145
+ } else if (strength <= 1) {
1146
+ strengthText.textContent = 'Mật khẩu yếu';
1147
+ strengthText.className = 'text-xs text-red-500 mt-1';
1148
+ } else if (strength <= 2) {
1149
+ strengthText.textContent = 'Mật khẩu trung bình';
1150
+ strengthText.className = 'text-xs text-yellow-500 mt-1';
1151
+ } else if (strength <= 3) {
1152
+ strengthText.textContent = 'Mật khẩu mạnh';
1153
+ strengthText.className = 'text-xs text-green-500 mt-1';
1154
+ } else {
1155
+ strengthText.textContent = 'Mật khẩu rất mạnh';
1156
+ strengthText.className = 'text-xs text-green-500 font-medium mt-1';
1157
+ }
1158
+ });
1159
+ }
1160
+
1161
  // Start Countdown Timer
1162
  function startCountdown() {
1163
  let timeLeft = 180; // 3 minutes in seconds
prompts.txt CHANGED
@@ -1,3 +1,4 @@
1
  tạo cho tôi một trang web quản lý bán hàng đa nền tảng
2
  Thêm tính năng đăng nhập
3
- khi nhấn vào phần quên mật khẩu sẽ hiện ra các mục là gmail đăng ký, sau đó sẽ hiện thông tin là đã gửi mã xác thực vào email để đăng nhập vào vào ô Mã OTP để cập nhập lại mật khẩu
 
 
1
  tạo cho tôi một trang web quản lý bán hàng đa nền tảng
2
  Thêm tính năng đăng nhập
3
+ khi nhấn vào phần quên mật khẩu sẽ hiện ra các mục là gmail đăng ký, sau đó sẽ hiện thông tin là đã gửi mã xác thực vào email để đăng nhập vào vào ô Mã OTP để cập nhập lại mật khẩu
4
+ thêm phần đăng ký ngay