From 06a46c37b3b9c149ffebc4570cdf38210ae011d0 Mon Sep 17 00:00:00 2001 From: Keith Date: Sat, 21 Nov 2026 21:52:54 +0100 Subject: [PATCH] =?UTF-8?q?Site=20UX=20round:=20fix=20the=20consent=20bann?= =?UTF-8?q?er=20(script=20ran=20in=20=20before=20the=20banner=20exis?= =?UTF-8?q?ted=20=E2=80=94=20attach=20on=20DOMContentLoaded);=20hubs=20cap?= =?UTF-8?q?abilities=20become=20a=20multi-select=20checklist=20+=20one=20R?= =?UTF-8?q?equest=20Access=20CTA=20(selection=20rides=20the=20lead=20paylo?= =?UTF-8?q?ad,=20echoed=20in=20the=20form];=20logo=20mark=20(nav=20+=20fav?= =?UTF-8?q?icon)=20+=20decorative=20hero=20banner;=20Sveltia=20custom=20pr?= =?UTF-8?q?eview=20template=20mirroring=20the=20layout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/admin/config.yml | 4 +- public/admin/index.html | 1 + public/admin/preview.js | 149 +++++++++++++++++++++++++++ public/favicon.svg | 11 ++ src/components/LeadForm.astro | 27 +++-- src/layouts/Site.astro | 169 ++++++++++++++++++++++++++----- src/pages/for-innovation-hubs.md | 7 +- 7 files changed, 325 insertions(+), 43 deletions(-) create mode 100644 public/admin/preview.js create mode 100644 public/favicon.svg diff --git a/public/admin/config.yml b/public/admin/config.yml index 911c1b5..7870b47 100644 --- a/public/admin/config.yml +++ b/public/admin/config.yml @@ -70,7 +70,7 @@ collections: - { label: Step text (optional), name: text, widget: string, required: false } - { label: Journey heading, name: journey_title, widget: string, required: false } - { label: Journey note, name: journey_note, widget: text, required: false } - - label: Capability blocks (hubs page, optional) + - label: Capability checklist (hubs page, optional) name: capabilities widget: list required: false @@ -78,9 +78,9 @@ collections: - { label: Key (lowercase_with_underscores), name: key, widget: string } - { label: Heading, name: heading, widget: string } - { label: Text, name: text, widget: text } - - { label: CTA label, name: cta, widget: string } - { label: Capabilities heading, name: capabilities_title, widget: string, required: false } - { label: Capabilities note, name: capabilities_note, widget: text, required: false } + - { label: Request Access button label, name: capabilities_cta, widget: string, required: false, default: Request Access } - { label: Pricing note, name: pricing_note, widget: text, required: false } - label: Body name: body diff --git a/public/admin/index.html b/public/admin/index.html index b244291..ba3913b 100644 --- a/public/admin/index.html +++ b/public/admin/index.html @@ -7,5 +7,6 @@ + diff --git a/public/admin/preview.js b/public/admin/preview.js new file mode 100644 index 0000000..56949fd --- /dev/null +++ b/public/admin/preview.js @@ -0,0 +1,149 @@ +// Custom preview template for Sveltia CMS: mirrors the site's +// Site.astro layout so the preview pane shows what the published page +// will look like (hero banner, cards, journey, capability checklist), +// instead of Sveltia's generic field dump. +// +// Runs in the browser as-is: the CMS bundle exposes the globals `CMS` +// and `html` (HTM, bound to the CMS's React copy). Markup elements can +// carry data-key-path so click-to-highlight keeps working — clicking +// a section in the preview focuses that field in the edit pane. + +const css = ` + :root { --ink:#16213a; --muted:#5b6478; --accent:#3a55d9; --accent-soft:#eef1fd; --line:#e3e7f2; --bg:#fbfcfe; } + * { box-sizing:border-box; } + body { margin:0; font-family:ui-sans-serif,system-ui,-apple-system,'Segoe UI',sans-serif; color:var(--ink); background:var(--bg); line-height:1.65; } + .pv-nav { display:flex; gap:0.75rem; align-items:center; padding:0.9rem 1.5rem; border-bottom:1px solid var(--line); background:#fff; color:var(--muted); font-size:0.85rem; } + .pv-nav strong { color:var(--ink); display:flex; gap:0.45rem; align-items:center; } + main { max-width:46rem; margin:0 auto; padding:0 1.25rem 3rem; } + .pv-hero { position:relative; overflow:hidden; margin:0 -1.25rem; padding:3rem 1.25rem 2.6rem; + background:radial-gradient(42rem 20rem at 85% -10%, rgba(135,87,216,0.12), transparent 60%), + linear-gradient(180deg, var(--accent-soft), var(--bg)); border-bottom:1px solid var(--line); } + .pv-hero h1 { font-size:2.2rem; line-height:1.15; margin:0 0 1rem; letter-spacing:-0.02em; max-width:26rem; } + .pv-hero p { font-size:1.1rem; color:var(--muted); max-width:34rem; margin:0; } + .pv-cta { margin-top:1.4rem; display:flex; gap:0.6rem; flex-wrap:wrap; } + .pv-cta span { background:var(--accent); color:#fff; border-radius:0.5rem; padding:0.55rem 1rem; font-weight:600; font-size:0.95rem; } + .pv-cta span.sec { background:#fff; color:var(--accent); border:1px solid var(--accent); } + h2 { font-size:1.35rem; margin:2.2rem 0 0.8rem; letter-spacing:-0.01em; } + .pv-cards { margin-top:1rem; display:grid; gap:1rem; grid-template-columns:repeat(auto-fit,minmax(14rem,1fr)); } + .pv-card { background:#fff; border:1px solid var(--line); border-radius:0.7rem; padding:1rem 1.1rem; } + .pv-card strong { display:block; margin-bottom:0.4rem; } + .pv-card small { color:var(--muted); font-size:0.93rem; line-height:1.5; } + .pv-journey ol { list-style:none; padding:0; margin:0.5rem 0 0; display:grid; gap:0.55rem; } + .pv-journey li { padding:0.55rem 0.9rem; background:#fff; border:1px solid var(--line); border-inline-start:3px solid var(--accent); border-radius:0.45rem; color:var(--muted); font-size:0.95rem; } + .pv-journey li b { color:var(--ink); } + .pv-cap { display:flex; gap:0.8rem; align-items:flex-start; background:var(--accent-soft); border:1px solid var(--line); border-radius:0.7rem; padding:0.85rem 1rem; margin-bottom:0.6rem; } + .pv-cap .tick { width:1.05rem; height:1.05rem; border:2px solid var(--accent); border-radius:0.3rem; flex:none; margin-top:0.2rem; } + .pv-cap strong { display:block; } + .pv-cap small { color:var(--muted); } + .pv-request { display:inline-block; background:var(--accent); color:#fff; border-radius:0.5rem; padding:0.55rem 1rem; font-weight:600; font-size:0.95rem; margin-top:0.6rem; } + .pv-body { margin-top:1.6rem; } + .pv-body h1, .pv-body h2, .pv-body h3 { margin-top:1.5rem; } + .pv-body img { max-width:100%; height:auto; border-radius:0.5rem; } + .pv-body ul { padding-inline-start:1.5rem; } + .pv-body blockquote { margin:1.2rem 0; padding:0.4rem 1rem; border-inline-start:3px solid var(--accent); color:var(--muted); } + .pv-empty { color:var(--muted); font-size:0.9rem; padding:1rem; text-align:center; } +`; + +const items = (widgets) => + (Array.isArray(widgets) ? widgets : []).map((w) => w.getIn(["data"])); + +const PagePreview = ({ entry, widgetFor, widgetsFor }) => { + const d = (key) => entry.getIn(["data", key]); + const valueProps = items(widgetsFor("value_props")); + const journey = items(widgetsFor("journey")); + const caps = items(widgetsFor("capabilities")); + const hasHero = d("hero_headline") || d("hero_sub"); + + return html` +
+
+ + + Validation Lab — preview + +
+
+ ${hasHero && + html` +
+

${d("hero_headline")}

+ ${d("hero_sub") && + html`

${d("hero_sub")}

`} + ${(d("cta_founders") || d("cta_hubs")) && + html` +

+ ${d("cta_founders") && html`${d("cta_founders")}`} + ${d("cta_hubs") && html`${d("cta_hubs")}`} +

+ `} +
+ `} + ${valueProps.length > 0 && + html` +
+

${d("value_props_title") || "Cards"}

+
+ ${valueProps.map((v, i) => + html`
+ ${v.get("heading")} + ${v.get("text")} +
`, + )} +
+
+ `} + ${journey.length > 0 && + html` +
+

${d("journey_title") || "The journey"}

+ ${d("journey_note") && + html`

${d("journey_note")}

`} +
    + ${journey.map((s, i) => + html`
  1. + ${s.get("title")}${s.get("text") ? html` — ${s.get("text")}` : null} +
  2. `, + )} +
+
+ `} + ${caps.length > 0 && + html` +
+

${d("capabilities_title")}

+ ${d("capabilities_note") && + html`

${d("capabilities_note")}

`} + ${caps.map((c, i) => + html`
+ + + ${c.get("heading")} + ${c.get("text")} + +
`, + )} + ${d("capabilities_cta") || "Request Access"} +
+ `} +
${widgetFor("body")}
+ ${!hasHero && valueProps.length === 0 && journey.length === 0 && caps.length === 0 && + html`

No structured sections — the preview shows the body only.

`} +
+
+ `; +}; + +CMS.registerPreviewStyle(css, { raw: true }); +CMS.registerPreviewTemplate("pages", PagePreview); diff --git a/public/favicon.svg b/public/favicon.svg new file mode 100644 index 0000000..31747b6 --- /dev/null +++ b/public/favicon.svg @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/src/components/LeadForm.astro b/src/components/LeadForm.astro index 28c64f5..4ae2173 100644 --- a/src/components/LeadForm.astro +++ b/src/components/LeadForm.astro @@ -61,6 +61,7 @@ const note = type === "founders" ? strings.form_founders_note : strings.form_hub >

{title}

{note}

+ {fields.map((f) => (