Site UX round: fix the consent banner (script ran in <head> before the banner existed — attach on DOMContentLoaded); hubs capabilities become a multi-select checklist + one Request Access CTA (selection rides the lead payload, echoed in the form]; logo mark (nav + favicon) + decorative hero banner; Sveltia custom preview template mirroring the layout
deploy / build-and-publish (push) Successful in 40s
deploy / build-and-publish (push) Successful in 40s
This commit is contained in:
1 parent
28e4f78e2a
commit
06a46c37b3
7 files changed
+325
-43
No files matched your search
@@ -61,6 +61,7 @@ const note = type === "founders" ? strings.form_founders_note : strings.form_hub
|
||||
>
|
||||
<h2 id="lead-form">{title}</h2>
|
||||
<p class="lead-note">{note}</p>
|
||||
<p class="cap-selection" id="cap-selection" hidden></p>
|
||||
{fields.map((f) => (
|
||||
<label>
|
||||
{f.label}{f.required ? " *" : ""}
|
||||
@@ -104,16 +105,24 @@ const note = type === "founders" ? strings.form_founders_note : strings.form_hub
|
||||
sending: form.dataset.sendingLabel,
|
||||
};
|
||||
|
||||
// capability blocks tag the form (analyst clicks are separate, via
|
||||
// data-umami-event attributes on the block links)
|
||||
// capability CHECKLIST (the multi-select above the form): collect the
|
||||
// checked boxes at submit time so the selection rides the payload —
|
||||
// both as machine keys and as a human-readable line in the message.
|
||||
const capField = form.querySelector('input[name="capabilities"]');
|
||||
const capsHover = document.getElementById("cap-selection");
|
||||
const refreshCaps = () => {
|
||||
const checked = [...document.querySelectorAll("[data-cap]:checked")];
|
||||
if (!capsHover) return;
|
||||
capsHover.textContent = checked.length
|
||||
? checked.map((c) => c.dataset.capLabel || c.dataset.cap).join(", ")
|
||||
: "";
|
||||
capsHover.hidden = !checked.length;
|
||||
};
|
||||
document.querySelectorAll("[data-cap]").forEach((el) => {
|
||||
el.addEventListener("click", () => {
|
||||
if (!capField.value.split(",").includes(el.dataset.cap)) {
|
||||
capField.value = capField.value
|
||||
? capField.value + "," + el.dataset.cap
|
||||
: el.dataset.cap;
|
||||
}
|
||||
el.addEventListener("change", () => {
|
||||
const boxes = [...document.querySelectorAll("[data-cap]:checked")];
|
||||
if (capField) capField.value = boxes.map((c) => c.dataset.cap).join(",");
|
||||
refreshCaps();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -127,7 +136,7 @@ const note = type === "founders" ? strings.form_founders_note : strings.form_hub
|
||||
// not the checkbox's literal "on"; an unchecked box never arrives)
|
||||
payload.consent = data.get("consent") === "on";
|
||||
if (payload.website) return; // honeypot: pretend success, send nothing
|
||||
if (capField && !payload.capabilities) payload.capabilities = capField.value;
|
||||
if (capField) payload.capabilities = capField.value;
|
||||
button.disabled = true;
|
||||
button.textContent = STRINGS.sending || "Sending…";
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user