Talk to us
Tell us what you are building. We will tell you if we can help.
Tell us what you are building. We will tell you if we can help.
----
var params = new URLSearchParams(window.location.search);
var sent = params.get('sent') === '1';
var errCd = params.get('error');
if (!sent && !errCd) return;
var msg;
if (sent) {
msg = { kind: 'success', text: 'Thanks. Your message is on its way and we will reply shortly.' };
} else if (errCd === 'captcha') {
msg = { kind: 'error', text: 'Captcha failed. Please try again.' };
} else if (errCd === 'fields') {
msg = { kind: 'error', text: 'Please fill in name, email, and message.' };
} else if (errCd === 'rate') {
msg = { kind: 'error', text: 'Too many submissions from your address. Please try again in a few minutes.' };
} else {
msg = { kind: 'error', text: 'Something went wrong. Please try again or email [email protected] directly.' };
}
document.addEventListener('DOMContentLoaded', function () {
var form = document.querySelector('.c-form');
if (!form) return;
var b = document.createElement('div');
b.className = 'c-form__banner c-form__banner--' + msg.kind;
b.setAttribute('role', msg.kind === 'error' ? 'alert' : 'status');
b.textContent = msg.text;
form.insertBefore(b, form.firstChild);
b.scrollIntoView({ behavior: 'smooth', block: 'center' });
if (window.history && window.history.replaceState) {
window.history.replaceState({}, '', '/contact/');
}
});
})();