Browse Source

clear code for success message

am
farhan 4 months ago
parent
commit
246ffea426

+ 0
- 1
resources/views/digital-card.blade.php View File

144
                 });
144
                 });
145
             });
145
             });
146
         </script>
146
         </script>
147
-        <div id="alert-success"></div>
148
         <div class="parent absolute h-screen w-full">
147
         <div class="parent absolute h-screen w-full">
149
             {{-- <audio src="{{asset('assets/paper-ripping.mp3')}}"></audio> --}}
148
             {{-- <audio src="{{asset('assets/paper-ripping.mp3')}}"></audio> --}}
150
             @include('components.front-cover')
149
             @include('components.front-cover')

+ 2
- 21
resources/views/modals/guestbook-modal.blade.php View File

42
             data: formData,
42
             data: formData,
43
             success: function(response) {
43
             success: function(response) {
44
               $('#closeSpeechForm').submit();
44
               $('#closeSpeechForm').submit();
45
-              var alertContainer = $('.alert-success');
45
+              var alertContainer = $('.alert-info');
46
               alertContainer.find('span').text(response.message); // Set message text
46
               alertContainer.find('span').text(response.message); // Set message text
47
               alertContainer.fadeIn().removeClass('hidden'); // Show the alert
47
               alertContainer.fadeIn().removeClass('hidden'); // Show the alert
48
               setTimeout(function() {
48
               setTimeout(function() {
54
             }
54
             }
55
           });
55
           });
56
         });
56
         });
57
-      })
58
-
59
-      function showSuccessMessage(message) {
60
-          // Create a dynamic success message element
61
-          var successAlert = $('<div class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded relative" role="alert">' +
62
-              '<span class="block sm:inline">' + message + '</span>' +
63
-              '</div>');
64
-
65
-          // Append the message to a suitable container in your HTML (e.g., modal, form, or body)
66
-          $('#alert-success').append(successAlert);
67
-
68
-          // Automatically remove the message after 3 seconds
69
-          setTimeout(function() {
70
-              successAlert.fadeOut('slow', function() {
71
-                  $(this).remove();
72
-              });
73
-          }, 3000); // 3 seconds
74
-
75
-          // session()->forget('success');
76
-      }
57
+      });
77
     </script>
58
     </script>
78
 @endpush
59
 @endpush

+ 1
- 18
resources/views/modals/rsvp-modal.blade.php View File

48
           data: formData,
48
           data: formData,
49
           success: function(response) {
49
           success: function(response) {
50
             $('#closeRsvpForm').submit();
50
             $('#closeRsvpForm').submit();
51
-            var alertContainer = $('.alert-success');
51
+            var alertContainer = $('.alert-info');
52
             alertContainer.find('span').text(response.message); // Set message text
52
             alertContainer.find('span').text(response.message); // Set message text
53
             alertContainer.fadeIn().removeClass('hidden'); // Show the alert
53
             alertContainer.fadeIn().removeClass('hidden'); // Show the alert
54
             setTimeout(function() {
54
             setTimeout(function() {
61
         });
61
         });
62
       });
62
       });
63
     });
63
     });
64
-
65
-    function showSuccessMessage(message) {
66
-        // Create a dynamic success message element
67
-        var successAlert = $('<div class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded relative" role="alert">' +
68
-            '<span class="block sm:inline">' + message + '</span>' +
69
-            '</div>');
70
-
71
-        // Append the message to a suitable container in your HTML (e.g., modal, form, or body)
72
-        $('#alert-success').append(successAlert);
73
-
74
-        // Automatically remove the message after 3 seconds
75
-        setTimeout(function() {
76
-            successAlert.fadeOut('slow', function() {
77
-                $(this).remove();
78
-            });
79
-        }, 3000); // 3 seconds
80
-    }
81
   </script>
64
   </script>
82
 @endpush
65
 @endpush

+ 1
- 1
resources/views/rsvp-digital-card.blade.php View File

81
               data: formData,
81
               data: formData,
82
               success: function(response) {
82
               success: function(response) {
83
                 $('#RSVPForm')[0].reset();
83
                 $('#RSVPForm')[0].reset();
84
-                var alertContainer = $('.alert-success');
84
+                var alertContainer = $('.alert-info');
85
                 alertContainer.find('span').text(response.message); // Set message text
85
                 alertContainer.find('span').text(response.message); // Set message text
86
                 alertContainer.fadeIn().removeClass('hidden'); // Show the alert
86
                 alertContainer.fadeIn().removeClass('hidden'); // Show the alert
87
                 setTimeout(function() {
87
                 setTimeout(function() {

Loading…
Cancel
Save