vlcsolutions commited on
Commit
a8fcb92
·
verified ·
1 Parent(s): dd74356

Alert Messages is not looking proper give me proper code

Browse files
Files changed (2) hide show
  1. index.html +45 -46
  2. style.css +28 -64
index.html CHANGED
@@ -11,28 +11,34 @@
11
 
12
  <main id="main" class="w-full">
13
  <!-- Alert Messages -->
14
- <div id="fail_email" class="hidden fixed top-4 right-4 max-w-md bg-red-100 border-l-4 border-red-500 text-red-700 p-4 rounded shadow-lg z-50">
15
- <div class="flex items-center">
16
- <i data-feather="alert-triangle" class="w-5 h-5 mr-2"></i>
17
- <div class="flex-1">
18
- Could not send an email! Please try again later.
19
  </div>
20
- <button onclick="removeQuery()" class="ml-4 text-red-700 hover:text-red-900">
21
- <i data-feather="x" class="w-5 h-5"></i>
22
  </button>
23
  </div>
 
 
 
24
  </div>
25
 
26
- <div id="success_email" class="hidden fixed top-4 right-4 max-w-md bg-green-100 border-l-4 border-green-500 text-green-700 p-4 rounded shadow-lg z-50">
27
- <div class="flex items-center">
28
- <i data-feather="check-circle" class="w-5 h-5 mr-2"></i>
29
- <div class="flex-1">
30
- We have sent you an email. Please check your inbox. If you cannot view it in your primary inbox, please check your Spam or Junk folder.
31
  </div>
32
- <button onclick="removeQuery()" class="ml-4 text-green-700 hover:text-green-900">
33
- <i data-feather="x" class="w-5 h-5"></i>
34
  </button>
35
  </div>
 
 
 
36
  </div>
37
  <!---Twitter Card data -->
38
  <meta name="twitter:card" content="summary_large_image">
@@ -477,40 +483,33 @@
477
 
478
  $('#fail_email').hide();
479
  $('#success_email').hide();
 
480
 
481
- let result = getUrlVars()["result"];
482
-
483
- if(typeof(result) != 'undefined'){
484
-
485
- if(result.includes('success'))
486
- {
487
- $('#success_email').show();
488
- $('#fail_email').hide();
489
- }
490
- else
491
- {
492
- $('#fail_email').show();
493
- $('#success_email').hide();
494
- }
495
-
496
- }
497
-
498
-
499
- });
500
-
501
- function removeQuery() {
502
-
503
- let url = window.location.href;
504
-
505
- let a = url.indexOf("?");
506
- let b = url.substring(a);
507
- let c = url.replace(b,"");
508
- window.location.href = c;
509
-
510
  }
511
-
512
-
513
- </script>
 
 
 
 
 
 
 
 
514
 
515
  <script src="https://www.google.com/recaptcha/api.js?render=6LfWu2YcAAAAAPooSewjuw82sSxhAdh657M4VvzT"></script>
516
 
 
11
 
12
  <main id="main" class="w-full">
13
  <!-- Alert Messages -->
14
+ <div id="fail_email" class="hidden fixed top-6 right-6 max-w-md w-full bg-white border border-red-200 rounded-lg shadow-xl z-50 overflow-hidden">
15
+ <div class="flex bg-red-50 px-4 py-2">
16
+ <div class="flex items-center">
17
+ <i data-feather="alert-triangle" class="w-5 h-5 text-red-600 mr-2"></i>
18
+ <span class="font-medium text-red-800">Error</span>
19
  </div>
20
+ <button onclick="removeQuery()" class="ml-auto text-red-500 hover:text-red-700 focus:outline-none">
21
+ <i data-feather="x" class="w-4 h-4"></i>
22
  </button>
23
  </div>
24
+ <div class="p-4 text-red-700">
25
+ <p>Could not send an email! Please try again later.</p>
26
+ </div>
27
  </div>
28
 
29
+ <div id="success_email" class="hidden fixed top-6 right-6 max-w-md w-full bg-white border border-green-200 rounded-lg shadow-xl z-50 overflow-hidden">
30
+ <div class="flex bg-green-50 px-4 py-2">
31
+ <div class="flex items-center">
32
+ <i data-feather="check-circle" class="w-5 h-5 text-green-600 mr-2"></i>
33
+ <span class="font-medium text-green-800">Success</span>
34
  </div>
35
+ <button onclick="removeQuery()" class="ml-auto text-green-500 hover:text-green-700 focus:outline-none">
36
+ <i data-feather="x" class="w-4 h-4"></i>
37
  </button>
38
  </div>
39
+ <div class="p-4 text-green-700">
40
+ <p>We have sent you an email. Please check your inbox. If you can't find it in your primary inbox, please check your Spam or Junk folder.</p>
41
+ </div>
42
  </div>
43
  <!---Twitter Card data -->
44
  <meta name="twitter:card" content="summary_large_image">
 
483
 
484
  $('#fail_email').hide();
485
  $('#success_email').hide();
486
+ let result = getUrlVars()["result"];
487
 
488
+ if(typeof(result) != 'undefined'){
489
+ if(result.includes('success')) {
490
+ $('#success_email').show().fadeIn(300);
491
+ $('#fail_email').hide();
492
+ setTimeout(() => {
493
+ $('#success_email').fadeOut(500, () => removeQuery());
494
+ }, 5000);
495
+ } else {
496
+ $('#fail_email').show().fadeIn(300);
497
+ $('#success_email').hide();
498
+ setTimeout(() => {
499
+ $('#fail_email').fadeOut(500, () => removeQuery());
500
+ }, 5000);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
501
  }
502
+ }
503
+ });
504
+ function removeQuery() {
505
+ let url = window.location.href;
506
+ if (url.includes('?')) {
507
+ url = url.split('?')[0];
508
+ history.replaceState(null, '', url);
509
+ $('#success_email, #fail_email').fadeOut(300);
510
+ }
511
+ }
512
+ </script>
513
 
514
  <script src="https://www.google.com/recaptcha/api.js?render=6LfWu2YcAAAAAPooSewjuw82sSxhAdh657M4VvzT"></script>
515
 
style.css CHANGED
@@ -35,71 +35,35 @@ body {
35
  color: var(--vlc-ink);
36
  line-height: 1.6;
37
  }
 
 
 
 
 
 
38
 
39
- /* Notification alerts */
40
- .notification {
41
- position: fixed;
42
- top: 1rem;
43
- right: 1rem;
44
- max-width: 24rem;
45
- width: 90%;
46
- padding: 1rem;
47
- border-radius: 0.5rem;
48
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
49
- z-index: 9999;
50
- display: flex;
51
- align-items: center;
52
- opacity: 0;
53
- transform: translateY(-20px);
54
- transition: opacity 0.3s ease, transform 0.3s ease;
55
- }
56
-
57
- .notification.show {
58
- opacity: 1;
59
- transform: translateY(0);
60
- }
61
- .notification.success {
62
- background-color: #f0fdf4;
63
- border-left: 4px solid #10b981;
64
- color: #065f46;
65
- box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
66
- }
67
-
68
- .notification.error {
69
- background-color: #fef2f2;
70
- border-left: 4px solid #ef4444;
71
- color: #991b1b;
72
- box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
73
- }
74
-
75
- .notification.warning {
76
- background-color: #fffbeb;
77
- border-left: 4px solid #f59e0b;
78
- color: #92400e;
79
- box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
80
- }
81
-
82
- .notification.info {
83
- background-color: #eff6ff;
84
- border-left: 4px solid #3b82f6;
85
- color: #1e40af;
86
- box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
87
- }
88
- .notification i {
89
- margin-right: 0.75rem;
90
- flex-shrink: 0;
91
- }
92
-
93
- .notification-content {
94
- flex-grow: 1;
95
- }
96
-
97
- .notification-close {
98
- margin-left: 0.75rem;
99
- cursor: pointer;
100
- background: none;
101
- border: none;
102
- padding: 0;
103
  }
104
  h1, h2, h3, h4 {
105
  color: var(--vlc-navy);
 
35
  color: var(--vlc-ink);
36
  line-height: 1.6;
37
  }
38
+ /* Alert Messages */
39
+ #fail_email,
40
+ #success_email {
41
+ transition: all 0.3s ease;
42
+ box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
43
+ }
44
 
45
+ #fail_email {
46
+ border: 1px solid #fecaca;
47
+ }
48
+
49
+ #success_email {
50
+ border: 1px solid #bbf7d0;
51
+ }
52
+
53
+ #fail_email .bg-red-50 {
54
+ background-color: #fef2f2;
55
+ }
56
+
57
+ #success_email .bg-green-50 {
58
+ background-color: #f0fdf4;
59
+ }
60
+
61
+ #fail_email button:hover {
62
+ color: #dc2626;
63
+ }
64
+
65
+ #success_email button:hover {
66
+ color: #16a34a;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  }
68
  h1, h2, h3, h4 {
69
  color: var(--vlc-navy);