This commit is contained in:
eddiesoehnel committed 2026-06-06 06:37:41 -06:00
commit 38ae828d82
85 files changed
+11990

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

@@ -0,0 +1,46 @@
(function () {
const form = document.querySelector(".contact-form");
if (!form) {
return;
}
const status = form.querySelector(".form-status");
const button = form.querySelector('button[type="submit"]');
function setStatus(message) {
if (status) {
status.textContent = message;
}
}
form.addEventListener("submit", async function (event) {
event.preventDefault();
setStatus("Sending...");
if (button) {
button.disabled = true;
}
try {
const response = await fetch(form.action, {
method: "POST",
body: new FormData(form),
headers: {
Accept: "application/json",
},
});
if (!response.ok) {
throw new Error("Contact request failed");
}
form.reset();
setStatus("Thanks. Your message was sent.");
} catch (error) {
setStatus("Message could not be sent. Please try again later.");
} finally {
if (button) {
button.disabled = false;
}
}
});
})();