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",