File tree Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,7 @@ btn.addEventListener("click", () => {
37
37
//unfilled form pop
38
38
function fillForm ( ) {
39
39
let div = document . createElement ( "div" ) ;
40
- div . classList . add ( "msgSent" ) ;
41
- div . style . color = "red" ;
40
+ div . classList . add ( "msg-not-sent" ) ;
42
41
toastNotification . appendChild ( div ) ;
43
42
div . innerHTML = `<span class="material-symbols-outlined"> check_circle </span> Please fill the form` ;
44
43
removeToast ( div ) ;
@@ -53,6 +52,7 @@ bookForm.addEventListener("submit", function (event) {
53
52
emailjs . sendForm ( serviceID , templateID , this ) . then (
54
53
( ) => {
55
54
toast ( ) ;
55
+ this . reset ( ) ;
56
56
} ,
57
57
( err ) => {
58
58
alert ( JSON . stringify ( err ) ) ;
Original file line number Diff line number Diff line change @@ -81,30 +81,43 @@ form button:active {
81
81
flex-direction : column;
82
82
gap : 20px ;
83
83
}
84
- .msgSent {
84
+ .msgSent ,
85
+ .msg-not-sent {
85
86
display : flex;
86
87
height : 8vmin ;
87
88
justify-content : center;
88
89
align-items : center;
89
90
gap : 5px ;
90
- color : green;
91
91
font-weight : 900 ;
92
92
border-radius : 20px ;
93
93
background-color : # e6e8e6 ;
94
94
box-shadow : 0 0 5px ;
95
95
position : relative;
96
96
overflow : hidden;
97
97
}
98
- .msgSent : after {
98
+ .msgSent {
99
+ color : green;
100
+ }
101
+ .msg-not-sent {
102
+ color : red;
103
+ }
104
+
105
+ .msgSent : after ,
106
+ .msg-not-sent : after {
99
107
content : "" ;
100
108
position : absolute;
101
109
bottom : 0 ;
102
110
left : 0 ;
103
- background-color : black;
104
111
width : 100% ;
105
112
height : 5px ;
106
113
animation : width 5s linear forwards;
107
114
}
115
+ .msg-not-sent : after {
116
+ background-color : red;
117
+ }
118
+ .msgSent : after {
119
+ background-color : green;
120
+ }
108
121
@keyframes width {
109
122
to {
110
123
width : 0 ;
You can’t perform that action at this time.
0 commit comments