Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions site/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
"@tailwindcss/vite": "^4.0.0",
"astro": "^6.0.4",
"tailwindcss": "^4.0.0"
},
"devDependencies": {
"@types/grecaptcha": "^3.0.9"
}
}
2 changes: 2 additions & 0 deletions site/public/robots.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
User-agent: *
Allow: /
Disallow: /_assets/

Sitemap: https://synthorg.io/sitemap-index.xml
Sitemap: https://synthorg.io/docs/sitemap.xml
24 changes: 24 additions & 0 deletions site/src/components/ContactForm.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
---
const recaptchaSiteKey = import.meta.env.PUBLIC_RECAPTCHA_SITE_KEY || "6LdQkossAAAAADwxZo5bt8p6az7P3M6I_8k4_ypu";
---

<form
id="contact-form"
action="https://formcarry.com/s/z2vjjRnmz_7"
method="POST"
class="bg-[#1a1f2e] rounded-xl p-8 border border-white/10"
data-recaptcha-key={recaptchaSiteKey}
>
<!-- Honeypot -->
<input type="text" name="_gotcha" style="display:none" tabindex="-1" autocomplete="off" />
Expand Down Expand Up @@ -60,6 +65,8 @@
></textarea>
</div>

<input type="hidden" id="captchaResponse" name="g-recaptcha-response" />

<button
type="submit"
id="contact-submit"
Expand Down Expand Up @@ -106,6 +113,23 @@
errorMsg.classList.add("hidden");

try {
// Get fresh reCAPTCHA v3 token before submission
const siteKey = form.dataset.recaptchaKey;
const captchaInput = form.querySelector<HTMLInputElement>("#captchaResponse");
if (typeof grecaptcha === "undefined" || !siteKey || !captchaInput) {
errorMsg.textContent = "Security verification unavailable. Please disable ad-blockers or try a different browser.";
errorMsg.classList.remove("hidden");
errorMsg.focus();
return;
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
let timer: ReturnType<typeof setTimeout>;
await Promise.race([
new Promise<void>((resolve) => grecaptcha.ready(() => { clearTimeout(timer); resolve(); })),
new Promise<void>((_, reject) => { timer = setTimeout(() => reject(new Error("reCAPTCHA timeout")), 5000); }),
]);
Comment thread
coderabbitai[bot] marked this conversation as resolved.
const token = await grecaptcha.execute(siteKey, { action: "contact" });
captchaInput.value = token;

const res = await fetch(form.action, {
method: "POST",
body: new FormData(form),
Expand Down
13 changes: 12 additions & 1 deletion site/src/layouts/Base.astro
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
---
import "../styles/global.css";
import Footer from "../components/Footer.astro";

interface Props {
title: string;
description?: string;
image?: string;
type?: string;
enableRecaptcha?: boolean;
}

const {
title,
description = "Framework for building synthetic organizations — autonomous AI agents orchestrated as a virtual company",
image = "/og-image.png",
type = "website",
enableRecaptcha = false,
} = Astro.props;

const ogImageUrl = new URL(image, Astro.site);
const canonicalUrl = Astro.url;
const recaptchaSiteKey = import.meta.env.PUBLIC_RECAPTCHA_SITE_KEY || "6LdQkossAAAAADwxZo5bt8p6az7P3M6I_8k4_ypu";
---

<!doctype html>
Expand Down Expand Up @@ -64,8 +68,15 @@ const canonicalUrl = Astro.url;
</noscript>
</head>
<body class="bg-[#0F1219] text-white font-['Inter',sans-serif] antialiased">
<slot />
<main>
<slot />
</main>
Comment thread
coderabbitai[bot] marked this conversation as resolved.
<Footer />
<!-- GitHub buttons (https://buttons.github.io/) -->
<script async defer src="https://buttons.github.io/buttons.js"></script>
{enableRecaptcha && (
<!-- Google reCAPTCHA v3 (contact form spam protection) -->
<script async defer src={`https://www.google.com/recaptcha/api.js?render=${recaptchaSiteKey}`}></script>
)}
</body>
</html>
6 changes: 0 additions & 6 deletions site/src/pages/get/index.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
import Base from "../../layouts/Base.astro";
import Footer from "../../components/Footer.astro";
---

<Base title="Get SynthOrg — Install the CLI">
Expand Down Expand Up @@ -220,11 +219,6 @@ import Footer from "../../components/Footer.astro";
</div>
</section>

<!-- ============================================================ -->
<!-- FOOTER -->
<!-- ============================================================ -->
<Footer />

<!-- Screen-reader live region for copy status -->
<span id="copy-status" class="sr-only" role="status" aria-live="polite"></span>

Expand Down
8 changes: 1 addition & 7 deletions site/src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---
import Base from "../layouts/Base.astro";
import Footer from "../components/Footer.astro";
import ContactForm from "../components/ContactForm.astro";

const description = "Framework for building synthetic organizations — autonomous AI agents orchestrated as a virtual company";
---

<Base title="SynthOrg — Build Synthetic Organizations" description={description}>
<Base title="SynthOrg — Build Synthetic Organizations" description={description} enableRecaptcha={true}>
<!-- ============================================================ -->
<!-- HERO (Dark) -->
<!-- ============================================================ -->
Expand Down Expand Up @@ -432,11 +431,6 @@ const description = "Framework for building synthetic organizations — autonomo
</div>
</section>

<!-- ============================================================ -->
<!-- FOOTER -->
<!-- ============================================================ -->
<Footer />

<!-- JSON-LD Structured Data -->
<script type="application/ld+json" set:html={JSON.stringify({
"@context": "https://schema.org",
Expand Down
Loading