Skip to content

Commit

Permalink
Cloudflare turnstyle…maybe… & gitignores
Browse files Browse the repository at this point in the history
Signed-off-by: Bentley Hensel <[email protected]>
  • Loading branch information
TheBoatyMcBoatFace committed Oct 24, 2024
1 parent d370a3e commit d7c0419
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.env
.DS_Store
.nova
10 changes: 6 additions & 4 deletions js/app.js
Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -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",
Expand Down

0 comments on commit d7c0419

Please sign in to comment.