Skip to content

Commit 4c8f202

Browse files
johannespartyclaude
andcommitted
fix: improve form submission UX and error handling (v1.0.4)
- Increase Airtable API timeout from 5s to 15s - Add timing logs for Airtable API calls (success and error) - Fix email send failures to trigger error state (was silent) - Add loading spinner and "Sending..." text on submit button - Add "Failed!" error state with red button and highlighted error message - Bump version to 1.0.4 for cache busting Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3571958 commit 4c8f202

10 files changed

Lines changed: 185 additions & 27 deletions

File tree

wp-content/plugins/bd4d/assets/css/main.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-content/plugins/bd4d/assets/css/main.src.css

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,51 @@ div.form-fields div.signup-input .signup:hover {
9999
.newsletter-subscribe input[type=submit][disabled=disabled] {
100100
opacity: 0.5;
101101
}
102+
.newsletter-subscribe input[type=submit].is-loading {
103+
position: relative;
104+
padding-left: 2.5em;
105+
cursor: wait;
106+
}
107+
.newsletter-subscribe input[type=submit].is-loading::before {
108+
content: "";
109+
position: absolute;
110+
left: 1em;
111+
top: 50%;
112+
width: 1em;
113+
height: 1em;
114+
margin-top: -0.5em;
115+
border: 2px solid transparent;
116+
border-top-color: currentcolor;
117+
border-radius: 50%;
118+
animation: bd4d-spin 0.8s linear infinite;
119+
}
120+
.newsletter-subscribe input[type=submit].is-error {
121+
background-color: #dc3545;
122+
color: white;
123+
border-color: #dc3545;
124+
}
125+
.newsletter-subscribe .error-message.is-visible {
126+
background-color: rgba(220, 53, 69, 0.15);
127+
border: 1px solid #dc3545;
128+
border-radius: 4px;
129+
padding: 0.75em 1em;
130+
margin-top: 1em;
131+
animation: bd4d-pulse 0.5s ease-in-out;
132+
}
102133

134+
@keyframes bd4d-spin {
135+
to {
136+
transform: rotate(360deg);
137+
}
138+
}
139+
@keyframes bd4d-pulse {
140+
0%, 100% {
141+
opacity: 1;
142+
}
143+
50% {
144+
opacity: 0.6;
145+
}
146+
}
103147
/* override divi styles */
104148
html body.single .et_pb_post {
105149
margin-bottom: 0;

wp-content/plugins/bd4d/assets/css/main.src.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-content/plugins/bd4d/assets/css/src/main.scss

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,54 @@ div.form-fields {
110110
&[disabled="disabled"] {
111111
opacity: 0.5;
112112
}
113+
114+
// Loading state
115+
&.is-loading {
116+
position: relative;
117+
padding-left: 2.5em;
118+
cursor: wait;
119+
120+
&::before {
121+
content: '';
122+
position: absolute;
123+
left: 1em;
124+
top: 50%;
125+
width: 1em;
126+
height: 1em;
127+
margin-top: -0.5em;
128+
border: 2px solid transparent;
129+
border-top-color: currentcolor;
130+
border-radius: 50%;
131+
animation: bd4d-spin 0.8s linear infinite;
132+
}
133+
}
134+
135+
// Error state
136+
&.is-error {
137+
background-color: #dc3545;
138+
color: white;
139+
border-color: #dc3545;
140+
}
113141
}
142+
143+
// Error message highlight
144+
.error-message.is-visible {
145+
background-color: rgb(220, 53, 69, 15%);
146+
border: 1px solid #dc3545;
147+
border-radius: 4px;
148+
padding: 0.75em 1em;
149+
margin-top: 1em;
150+
animation: bd4d-pulse 0.5s ease-in-out;
151+
}
152+
}
153+
154+
@keyframes bd4d-spin {
155+
to { transform: rotate(360deg); }
156+
}
157+
158+
@keyframes bd4d-pulse {
159+
0%, 100% { opacity: 1; }
160+
50% { opacity: 0.6; }
114161
}
115162

116163
/* override divi styles */

wp-content/plugins/bd4d/assets/js/main.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-content/plugins/bd4d/assets/js/main.src.js

Lines changed: 35 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)