From d7c0419e0f9918e23a461a108f3ecebff1018851 Mon Sep 17 00:00:00 2001 From: Bentley Hensel Date: Thu, 24 Oct 2024 11:49:51 -0400 Subject: [PATCH] =?UTF-8?q?Cloudflare=20turnstyle=E2=80=A6maybe=E2=80=A6?= =?UTF-8?q?=20&=20gitignores?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bentley Hensel --- .gitignore | 3 +++ js/app.js | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index e69de29..7e5f885 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,3 @@ +.env +.DS_Store +.nova diff --git a/js/app.js b/js/app.js index b7df652..0d26f57 100644 --- a/js/app.js +++ b/js/app.js @@ -1,10 +1,8 @@ - // Scroll to contact form document.getElementById('scrollToContact').addEventListener('click', function() { document.querySelector('.contact').scrollIntoView({ behavior: 'smooth' }); }); - document.getElementById('year').textContent = new Date().getFullYear(); document.addEventListener("DOMContentLoaded", function() { @@ -17,17 +15,21 @@ document.addEventListener("DOMContentLoaded", function() { const organization = document.getElementById("organization").value; const message = document.getElementById("message").value; + // Gather Turnstile response + const turnstileResponse = document.querySelector('.cf-turnstile input[name="cf-turnstile-response"]').value; + // Create payload const payload = { name: name, email: email, company: organization, - message: message + message: message, + "cf-turnstile-response": turnstileResponse }; try { // Send POST request to Cloudflare worker - const response = await fetch("https://contact-forms.workermcworkface.workers.dev/api/contact", { + const response = await fetch("https://contact-forms.getdkan.org/api/contact", { method: "POST", headers: { "Content-Type": "application/json",