Dooratre commited on
Commit
88a5357
·
verified ·
1 Parent(s): d1dd303

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +236 -21
index.html CHANGED
@@ -1,5 +1,5 @@
1
  <!DOCTYPE html>
2
- <html lang="en">
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -7,6 +7,7 @@
7
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
8
  <style>
9
  :root {
 
10
  --primary: #4361ee;
11
  --primary-dark: #3a56d4;
12
  --secondary: #7209b7;
@@ -14,10 +15,36 @@
14
  --danger: #e74c3c;
15
  --dark: #2d3748;
16
  --light: #f8f9fa;
 
 
 
 
 
 
 
17
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
18
  --transition: all 0.3s ease;
19
  }
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  * {
22
  margin: 0;
23
  padding: 0;
@@ -26,26 +53,28 @@
26
 
27
  body {
28
  font-family: 'Poppins', sans-serif;
29
- background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
30
  min-height: 100vh;
31
  display: flex;
32
  justify-content: center;
33
  align-items: center;
34
  padding: 20px;
35
- color: var(--dark);
36
  line-height: 1.6;
 
37
  }
38
 
39
  .container {
40
  width: 100%;
41
  max-width: 550px;
42
- background: rgba(255, 255, 255, 0.95);
43
  padding: 40px;
44
  border-radius: 16px;
45
  box-shadow: var(--card-shadow);
46
  position: relative;
47
  overflow: hidden;
48
  z-index: 1;
 
49
  }
50
 
51
  .container::before {
@@ -102,7 +131,7 @@
102
  .subtitle {
103
  text-align: center;
104
  font-size: 14px;
105
- color: #718096;
106
  margin-bottom: 30px;
107
  }
108
 
@@ -116,17 +145,19 @@
116
  font-size: 14px;
117
  font-weight: 600;
118
  margin-bottom: 8px;
119
- color: #4a5568;
 
120
  }
121
 
122
  input[type="email"],
123
  input[type="text"] {
124
  width: 100%;
125
  padding: 14px 16px 14px 45px;
126
- border: 1px solid #e2e8f0;
127
  border-radius: 8px;
128
  font-size: 15px;
129
- background-color: #f8fafc;
 
130
  transition: var(--transition);
131
  }
132
 
@@ -135,14 +166,14 @@
135
  outline: none;
136
  border-color: var(--primary);
137
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
138
- background-color: #fff;
139
  }
140
 
141
  .input-icon {
142
  position: absolute;
143
  left: 16px;
144
  top: 40px;
145
- color: #a0aec0;
 
146
  }
147
 
148
  button {
@@ -191,7 +222,7 @@
191
  .response-box {
192
  margin-top: 30px;
193
  padding: 20px;
194
- background-color: #f8fafc;
195
  border-left: 4px solid var(--primary);
196
  border-radius: 8px;
197
  white-space: pre-wrap;
@@ -202,6 +233,8 @@
202
  max-height: 300px;
203
  overflow-y: auto;
204
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
 
 
205
  }
206
 
207
  .confirmation-form {
@@ -260,8 +293,9 @@
260
  right: -40%;
261
  width: 80%;
262
  height: 2px;
263
- background-color: #e2e8f0;
264
  z-index: 0;
 
265
  }
266
 
267
  .step.active:not(:last-child)::after {
@@ -272,11 +306,11 @@
272
  width: 30px;
273
  height: 30px;
274
  border-radius: 50%;
275
- background-color: #e2e8f0;
276
  display: flex;
277
  align-items: center;
278
  justify-content: center;
279
- color: #718096;
280
  font-weight: 600;
281
  margin-bottom: 8px;
282
  position: relative;
@@ -292,8 +326,9 @@
292
 
293
  .step-title {
294
  font-size: 12px;
295
- color: #718096;
296
  font-weight: 500;
 
297
  }
298
 
299
  .step.active .step-title {
@@ -316,13 +351,75 @@
316
  .success-title {
317
  font-size: 24px;
318
  font-weight: 700;
319
- color: var(--dark);
320
  margin-bottom: 10px;
 
321
  }
322
 
323
  .success-subtitle {
324
- color: #718096;
325
  margin-bottom: 30px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
326
  }
327
 
328
  /* Responsive adjustments */
@@ -351,11 +448,25 @@
351
  h1 {
352
  font-size: 24px;
353
  }
 
 
 
 
 
 
 
 
 
 
354
  }
355
  </style>
356
  </head>
357
  <body>
358
  <div class="container">
 
 
 
 
359
  <div class="logo">
360
  <i class="fas fa-user-shield logo-icon"></i>
361
  <h1>Auto Account System</h1>
@@ -395,8 +506,15 @@
395
  <div class="confirmation-form" id="confirmationForm">
396
  <div class="form-group">
397
  <label for="confirmationCode">Confirmation Code</label>
398
- <i class="fas fa-key input-icon"></i>
399
- <input type="text" id="confirmationCode" name="confirmationCode" required placeholder="Enter the code sent to your email">
 
 
 
 
 
 
 
400
  </div>
401
  <button type="button" id="confirmButton">
402
  Verify Email <i class="fas fa-check" style="margin-left: 8px;"></i>
@@ -418,6 +536,98 @@
418
  </div>
419
 
420
  <script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
421
  // Function to generate a random username (7-15 letters and numbers)
422
  function generateUsername() {
423
  const length = Math.floor(Math.random() * (15 - 7 + 1)) + 7;
@@ -517,6 +727,10 @@
517
  document.getElementById('confirmationForm').style.display = 'block';
518
  document.getElementById('step1').classList.remove('active');
519
  document.getElementById('step2').classList.add('active');
 
 
 
 
520
  loadingIndicator.style.display = 'none';
521
  } catch (error) {
522
  responseBox.textContent += `❌ Error: ${error.message}`;
@@ -531,8 +745,8 @@
531
  const responseBox = document.getElementById('responseBox');
532
  const loadingIndicator = document.getElementById('loadingIndicator');
533
 
534
- if (!confirmCode) {
535
- responseBox.textContent += "❌ Error: Confirmation code is required.\n\n";
536
  return;
537
  }
538
 
@@ -608,6 +822,7 @@
608
  document.getElementById('newRequestBtn').addEventListener('click', function() {
609
  document.getElementById('email').value = '';
610
  document.getElementById('confirmationCode').value = '';
 
611
  document.getElementById('responseBox').textContent = '';
612
 
613
  document.getElementById('successMessage').style.display = 'none';
 
1
  <!DOCTYPE html>
2
+ <html lang="en" data-theme="light">
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
 
7
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
8
  <style>
9
  :root {
10
+ /* Light theme variables */
11
  --primary: #4361ee;
12
  --primary-dark: #3a56d4;
13
  --secondary: #7209b7;
 
15
  --danger: #e74c3c;
16
  --dark: #2d3748;
17
  --light: #f8f9fa;
18
+ --bg-color: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
19
+ --card-bg: rgba(255, 255, 255, 0.95);
20
+ --text-color: #2d3748;
21
+ --text-muted: #718096;
22
+ --input-bg: #f8fafc;
23
+ --input-border: #e2e8f0;
24
+ --response-bg: #f8fafc;
25
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
26
  --transition: all 0.3s ease;
27
  }
28
 
29
+ [data-theme="dark"] {
30
+ /* Dark theme variables */
31
+ --primary: #4361ee;
32
+ --primary-dark: #3a56d4;
33
+ --secondary: #7209b7;
34
+ --success: #2ecc71;
35
+ --danger: #e74c3c;
36
+ --dark: #f8f9fa;
37
+ --light: #2d3748;
38
+ --bg-color: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
39
+ --card-bg: rgba(26, 32, 44, 0.95);
40
+ --text-color: #f8f9fa;
41
+ --text-muted: #a0aec0;
42
+ --input-bg: #2d3748;
43
+ --input-border: #4a5568;
44
+ --response-bg: #2d3748;
45
+ --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
46
+ }
47
+
48
  * {
49
  margin: 0;
50
  padding: 0;
 
53
 
54
  body {
55
  font-family: 'Poppins', sans-serif;
56
+ background: var(--bg-color);
57
  min-height: 100vh;
58
  display: flex;
59
  justify-content: center;
60
  align-items: center;
61
  padding: 20px;
62
+ color: var(--text-color);
63
  line-height: 1.6;
64
+ transition: background 0.3s ease;
65
  }
66
 
67
  .container {
68
  width: 100%;
69
  max-width: 550px;
70
+ background: var(--card-bg);
71
  padding: 40px;
72
  border-radius: 16px;
73
  box-shadow: var(--card-shadow);
74
  position: relative;
75
  overflow: hidden;
76
  z-index: 1;
77
+ transition: background 0.3s ease, box-shadow 0.3s ease;
78
  }
79
 
80
  .container::before {
 
131
  .subtitle {
132
  text-align: center;
133
  font-size: 14px;
134
+ color: var(--text-muted);
135
  margin-bottom: 30px;
136
  }
137
 
 
145
  font-size: 14px;
146
  font-weight: 600;
147
  margin-bottom: 8px;
148
+ color: var(--text-color);
149
+ transition: color 0.3s ease;
150
  }
151
 
152
  input[type="email"],
153
  input[type="text"] {
154
  width: 100%;
155
  padding: 14px 16px 14px 45px;
156
+ border: 1px solid var(--input-border);
157
  border-radius: 8px;
158
  font-size: 15px;
159
+ background-color: var(--input-bg);
160
+ color: var(--text-color);
161
  transition: var(--transition);
162
  }
163
 
 
166
  outline: none;
167
  border-color: var(--primary);
168
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
 
169
  }
170
 
171
  .input-icon {
172
  position: absolute;
173
  left: 16px;
174
  top: 40px;
175
+ color: var(--text-muted);
176
+ transition: color 0.3s ease;
177
  }
178
 
179
  button {
 
222
  .response-box {
223
  margin-top: 30px;
224
  padding: 20px;
225
+ background-color: var(--response-bg);
226
  border-left: 4px solid var(--primary);
227
  border-radius: 8px;
228
  white-space: pre-wrap;
 
233
  max-height: 300px;
234
  overflow-y: auto;
235
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
236
+ color: var(--text-color);
237
+ transition: background-color 0.3s ease, color 0.3s ease;
238
  }
239
 
240
  .confirmation-form {
 
293
  right: -40%;
294
  width: 80%;
295
  height: 2px;
296
+ background-color: var(--input-border);
297
  z-index: 0;
298
+ transition: background-color 0.3s ease;
299
  }
300
 
301
  .step.active:not(:last-child)::after {
 
306
  width: 30px;
307
  height: 30px;
308
  border-radius: 50%;
309
+ background-color: var(--input-border);
310
  display: flex;
311
  align-items: center;
312
  justify-content: center;
313
+ color: var(--text-muted);
314
  font-weight: 600;
315
  margin-bottom: 8px;
316
  position: relative;
 
326
 
327
  .step-title {
328
  font-size: 12px;
329
+ color: var(--text-muted);
330
  font-weight: 500;
331
+ transition: color 0.3s ease;
332
  }
333
 
334
  .step.active .step-title {
 
351
  .success-title {
352
  font-size: 24px;
353
  font-weight: 700;
354
+ color: var(--text-color);
355
  margin-bottom: 10px;
356
+ transition: color 0.3s ease;
357
  }
358
 
359
  .success-subtitle {
360
+ color: var(--text-muted);
361
  margin-bottom: 30px;
362
+ transition: color 0.3s ease;
363
+ }
364
+
365
+ /* Theme toggle */
366
+ .theme-toggle {
367
+ position: absolute;
368
+ top: 20px;
369
+ right: 20px;
370
+ background: none;
371
+ border: none;
372
+ color: var(--text-color);
373
+ font-size: 20px;
374
+ cursor: pointer;
375
+ width: auto;
376
+ padding: 5px;
377
+ display: flex;
378
+ align-items: center;
379
+ justify-content: center;
380
+ z-index: 10;
381
+ transition: color 0.3s ease;
382
+ }
383
+
384
+ .theme-toggle:hover {
385
+ transform: scale(1.1);
386
+ box-shadow: none;
387
+ }
388
+
389
+ .theme-toggle:active {
390
+ transform: scale(0.95);
391
+ }
392
+
393
+ .theme-toggle::after {
394
+ display: none;
395
+ }
396
+
397
+ /* Code input boxes style */
398
+ .code-input-container {
399
+ display: flex;
400
+ gap: 10px;
401
+ justify-content: center;
402
+ margin-top: 10px;
403
+ }
404
+
405
+ .code-input {
406
+ width: 50px;
407
+ height: 60px;
408
+ text-align: center;
409
+ font-size: 24px;
410
+ font-weight: 600;
411
+ border: 1px solid var(--input-border);
412
+ border-radius: 8px;
413
+ background-color: var(--input-bg);
414
+ color: var(--text-color);
415
+ transition: var(--transition);
416
+ padding: 0;
417
+ }
418
+
419
+ .code-input:focus {
420
+ outline: none;
421
+ border-color: var(--primary);
422
+ box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
423
  }
424
 
425
  /* Responsive adjustments */
 
448
  h1 {
449
  font-size: 24px;
450
  }
451
+
452
+ .code-input-container {
453
+ gap: 5px;
454
+ }
455
+
456
+ .code-input {
457
+ width: 40px;
458
+ height: 50px;
459
+ font-size: 20px;
460
+ }
461
  }
462
  </style>
463
  </head>
464
  <body>
465
  <div class="container">
466
+ <button class="theme-toggle" id="themeToggle">
467
+ <i class="fas fa-moon"></i>
468
+ </button>
469
+
470
  <div class="logo">
471
  <i class="fas fa-user-shield logo-icon"></i>
472
  <h1>Auto Account System</h1>
 
506
  <div class="confirmation-form" id="confirmationForm">
507
  <div class="form-group">
508
  <label for="confirmationCode">Confirmation Code</label>
509
+ <div class="code-input-container">
510
+ <input type="text" class="code-input" maxlength="1" data-index="0">
511
+ <input type="text" class="code-input" maxlength="1" data-index="1">
512
+ <input type="text" class="code-input" maxlength="1" data-index="2">
513
+ <input type="text" class="code-input" maxlength="1" data-index="3">
514
+ <input type="text" class="code-input" maxlength="1" data-index="4">
515
+ <input type="text" class="code-input" maxlength="1" data-index="5">
516
+ </div>
517
+ <input type="hidden" id="confirmationCode" name="confirmationCode">
518
  </div>
519
  <button type="button" id="confirmButton">
520
  Verify Email <i class="fas fa-check" style="margin-left: 8px;"></i>
 
536
  </div>
537
 
538
  <script>
539
+ // Theme toggle functionality
540
+ const themeToggle = document.getElementById('themeToggle');
541
+ const htmlElement = document.documentElement;
542
+ const toggleIcon = themeToggle.querySelector('i');
543
+
544
+ // Check for saved theme preference or use preferred color scheme
545
+ const savedTheme = localStorage.getItem('theme');
546
+ if (savedTheme) {
547
+ htmlElement.setAttribute('data-theme', savedTheme);
548
+ updateThemeToggleIcon(savedTheme);
549
+ } else {
550
+ // Check if user prefers dark mode
551
+ const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
552
+ if (prefersDark) {
553
+ htmlElement.setAttribute('data-theme', 'dark');
554
+ updateThemeToggleIcon('dark');
555
+ }
556
+ }
557
+
558
+ function updateThemeToggleIcon(theme) {
559
+ if (theme === 'dark') {
560
+ toggleIcon.classList.remove('fa-moon');
561
+ toggleIcon.classList.add('fa-sun');
562
+ } else {
563
+ toggleIcon.classList.remove('fa-sun');
564
+ toggleIcon.classList.add('fa-moon');
565
+ }
566
+ }
567
+
568
+ themeToggle.addEventListener('click', function() {
569
+ const currentTheme = htmlElement.getAttribute('data-theme');
570
+ const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
571
+
572
+ htmlElement.setAttribute('data-theme', newTheme);
573
+ localStorage.setItem('theme', newTheme);
574
+ updateThemeToggleIcon(newTheme);
575
+ });
576
+
577
+ // Confirmation code input handling
578
+ const codeInputs = document.querySelectorAll('.code-input');
579
+ const hiddenInput = document.getElementById('confirmationCode');
580
+
581
+ codeInputs.forEach((input, index) => {
582
+ // Handle input
583
+ input.addEventListener('input', function(e) {
584
+ // Only allow numeric input
585
+ this.value = this.value.replace(/[^0-9]/g, '');
586
+
587
+ // Auto-focus to next input
588
+ if (this.value && index < codeInputs.length - 1) {
589
+ codeInputs[index + 1].focus();
590
+ }
591
+
592
+ // Update hidden input with combined value
593
+ updateHiddenInput();
594
+ });
595
+
596
+ // Handle keydown for backspace
597
+ input.addEventListener('keydown', function(e) {
598
+ if (e.key === 'Backspace' && !this.value && index > 0) {
599
+ codeInputs[index - 1].focus();
600
+ codeInputs[index - 1].value = '';
601
+ updateHiddenInput();
602
+ }
603
+ });
604
+
605
+ // Handle paste event
606
+ input.addEventListener('paste', function(e) {
607
+ e.preventDefault();
608
+ const pastedData = e.clipboardData.getData('text');
609
+ const numericData = pastedData.replace(/[^0-9]/g, '');
610
+
611
+ // Fill inputs with pasted data
612
+ for (let i = 0; i < numericData.length && i + index < codeInputs.length; i++) {
613
+ codeInputs[i + index].value = numericData[i];
614
+ }
615
+
616
+ // Focus the next empty input or the last one
617
+ let nextEmptyIndex = index + numericData.length;
618
+ if (nextEmptyIndex >= codeInputs.length) {
619
+ nextEmptyIndex = codeInputs.length - 1;
620
+ }
621
+ codeInputs[nextEmptyIndex].focus();
622
+
623
+ updateHiddenInput();
624
+ });
625
+ });
626
+
627
+ function updateHiddenInput() {
628
+ hiddenInput.value = Array.from(codeInputs).map(input => input.value).join('');
629
+ }
630
+
631
  // Function to generate a random username (7-15 letters and numbers)
632
  function generateUsername() {
633
  const length = Math.floor(Math.random() * (15 - 7 + 1)) + 7;
 
727
  document.getElementById('confirmationForm').style.display = 'block';
728
  document.getElementById('step1').classList.remove('active');
729
  document.getElementById('step2').classList.add('active');
730
+
731
+ // Focus the first code input
732
+ codeInputs[0].focus();
733
+
734
  loadingIndicator.style.display = 'none';
735
  } catch (error) {
736
  responseBox.textContent += `❌ Error: ${error.message}`;
 
745
  const responseBox = document.getElementById('responseBox');
746
  const loadingIndicator = document.getElementById('loadingIndicator');
747
 
748
+ if (confirmCode.length !== 6) {
749
+ responseBox.textContent += "❌ Error: Please enter all 6 digits of the confirmation code.\n\n";
750
  return;
751
  }
752
 
 
822
  document.getElementById('newRequestBtn').addEventListener('click', function() {
823
  document.getElementById('email').value = '';
824
  document.getElementById('confirmationCode').value = '';
825
+ codeInputs.forEach(input => input.value = '');
826
  document.getElementById('responseBox').textContent = '';
827
 
828
  document.getElementById('successMessage').style.display = 'none';