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

This commit is contained in:
Keith committed 2026-11-21 21:52:54 +01:00
1 parent 28e4f78e2a
commit 06a46c37b3
7 files changed
+325 -43

No files matched your search

+142 -27
View File
@@ -87,6 +87,7 @@ const hasForm = pageId === "for-founders" || pageId === "for-innovation-hubs";
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<title>{fm.title}</title>
<meta name="description" content={description} />
<link rel="canonical" href={canonical} />
@@ -106,9 +107,10 @@ const hasForm = pageId === "for-founders" || pageId === "for-innovation-hubs";
is:inline
set:html={`(() => {
// Cookie-gated analytics: nothing loads until the visitor opts in,
// and the choice is remembered in localStorage.
const banner = document.getElementById("cookie-consent");
if (!banner) return;
// and the choice is remembered in localStorage. The banner lives at
// the END of <body> while this script runs in <head> — attach on
// DOMContentLoaded, not at parse time (found live 2026-11-21: the
// banner never dismissed because it did not exist yet on lookup).
const KEY = "vl-consent";
const STATS_URL = ${JSON.stringify(site.stats_script_url)};
const STATS_ID = ${JSON.stringify(site.stats_website_id)};
@@ -123,19 +125,28 @@ const hasForm = pageId === "for-founders" || pageId === "for-innovation-hubs";
};
const decide = (allow) => {
try { localStorage.setItem(KEY, allow ? "granted" : "denied"); } catch {}
banner.remove();
document.getElementById("cookie-consent")?.remove();
if (allow) injectStats();
};
banner.addEventListener("click", (event) => {
const b = event.target.closest("button");
if (!b) return;
decide(b.dataset.answer === "yes");
});
let stored = null;
try { stored = localStorage.getItem(KEY); } catch {}
if (stored) {
banner.remove();
if (stored === "granted") injectStats();
const init = () => {
const banner = document.getElementById("cookie-consent");
if (!banner) return;
banner.addEventListener("click", (event) => {
const b = event.target.closest("button");
if (!b) return;
decide(b.dataset.answer === "yes");
});
let stored = null;
try { stored = localStorage.getItem(KEY); } catch {}
if (stored) {
banner.remove();
if (stored === "granted") injectStats();
}
};
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", init);
} else {
init();
}
})();`}
/>
@@ -143,7 +154,25 @@ const hasForm = pageId === "for-founders" || pageId === "for-innovation-hubs";
<body>
<header class="site-header">
<nav>
<a class="brand" href={`${localePrefix(locale)}/`}>{site.brand}</a>
<a class="brand" href={`${localePrefix(locale)}/`}>
<svg class="brand-mark" viewBox="0 0 32 32" aria-hidden="true">
<defs>
<linearGradient id="vl-mark" x1="0" y1="0" x2="1" y2="1">
<stop offset="0" stop-color="#3a55d9" />
<stop offset="1" stop-color="#8757d8" />
</linearGradient>
</defs>
<rect width="32" height="32" rx="8" fill="url(#vl-mark)" />
<path
d="M8.5 20.5c1.4-9.6 6.6-10.7 7-10.7 2.3 0-1.6 8.6 1.2 8.6 1.7 0 3.9-4.5 6.8-6.9"
fill="none"
stroke="#fff"
stroke-width="2.4"
stroke-linecap="round"
/>
</svg>
<span>{site.brand}</span>
</a>
{navEntries.map((p) => (
<a href={p.href} aria-current={Astro.url.pathname === p.href ? "page" : undefined}>{p.label}</a>
))}
@@ -167,6 +196,27 @@ const hasForm = pageId === "for-founders" || pageId === "for-innovation-hubs";
{
fm.hero_headline && (
<section class="hero">
<svg class="hero-deco" viewBox="0 0 320 240" aria-hidden="true">
<defs>
<linearGradient id="vl-hero" x1="0" y1="0" x2="1" y2="1">
<stop offset="0" stop-color="#3a55d9" stop-opacity="0.9" />
<stop offset="1" stop-color="#8757d8" stop-opacity="0.7" />
</linearGradient>
</defs>
<g fill="none" stroke="url(#vl-hero)" stroke-linecap="round">
<path d="M40 200 A110 110 0 0 1 240 40" stroke-width="2" />
<path d="M70 210 A140 140 0 0 1 270 60" stroke-width="2" stroke-opacity="0.5" />
<path d="M100 220 A160 160 0 0 1 300 100" stroke-width="2" stroke-opacity="0.25" />
</g>
<g fill="url(#vl-hero)">
<circle cx="240" cy="40" r="7" />
<circle cx="270" cy="60" r="4" fill-opacity="0.5" />
<circle cx="300" cy="100" r="3" fill-opacity="0.3" />
</g>
<g stroke-width="3" stroke-linecap="round">
<path d="M235 40 l4 4 l7 -8" fill="none" stroke="#fff" />
</g>
</svg>
<h1>{fm.hero_headline}</h1>
{fm.hero_sub && <p class="hero-sub">{fm.hero_sub}</p>}
{
@@ -213,20 +263,27 @@ const hasForm = pageId === "for-founders" || pageId === "for-innovation-hubs";
<section class="capabilities">
<h2>{fm.capabilities_title}</h2>
{fm.capabilities_note && <p class="capabilities-note">{fm.capabilities_note}</p>}
<div class="cards">
<div class="cards cap-list">
{fm.capabilities.map((c) => (
<article class="card">
<h3>{c.heading}</h3>
<p>{c.text}</p>
<a
class="button button-secondary"
data-umami-event={`capability-${c.key}`}
<label class="card cap" data-umami-event={`capability-${c.key}`}>
<input
id={`cap-${c.key}`}
type="checkbox"
data-cap={c.key}
href={`${localePrefix(locale)}/for-innovation-hubs/#lead-form`}
>{c.cta}</a>
</article>
data-cap-label={c.heading}
/>
<span class="cap-body">
<strong>{c.heading}</strong>
<small>{c.text}</small>
</span>
</label>
))}
</div>
<p class="cta-row">
<a class="button" href="#lead-form">
{fm.capabilities_cta ?? "Request Access"}
</a>
</p>
</section>
)
}
@@ -295,6 +352,14 @@ const hasForm = pageId === "for-founders" || pageId === "for-innovation-hubs";
margin-inline-end: auto;
color: var(--ink);
text-decoration: none;
display: inline-flex;
gap: 0.5rem;
align-items: center;
}
.brand-mark {
width: 1.65rem;
height: 1.65rem;
flex: none;
}
.site-header nav a:not(.brand) {
color: var(--muted);
@@ -320,10 +385,24 @@ const hasForm = pageId === "for-founders" || pageId === "for-innovation-hubs";
padding: 2.5rem 1.25rem 4rem;
}
.hero {
position: relative;
overflow: hidden;
margin-inline: -1.25rem;
margin-top: -2.5rem;
padding: 3.2rem 1.25rem 2.6rem;
background: linear-gradient(180deg, var(--accent-soft), var(--bg));
padding: 3.2rem 1.25rem 2.8rem;
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);
}
.hero h1 { max-width: 30rem; }
.hero .hero-deco {
position: absolute;
inset-inline-end: -2.5rem;
top: 0;
height: 100%;
max-width: 60%;
pointer-events: none;
}
.hero-sub { font-size: 1.15rem; color: var(--muted); max-width: 38rem; }
.cta-row { margin-top: 1.6rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }
@@ -356,6 +435,33 @@ const hasForm = pageId === "for-founders" || pageId === "for-innovation-hubs";
.card p { color: var(--muted); font-size: 0.95rem; margin: 0; }
.card h2, .card h3 { margin: 0 0 0.5rem; }
.cap-list { grid-template-columns: 1fr; gap: 0.6rem; }
.card.cap {
display: flex;
gap: 0.8rem;
align-items: flex-start;
padding: 0.9rem 1.1rem;
cursor: pointer;
transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.card.cap:hover { border-color: var(--accent); }
.card.cap:has(input:checked) {
border-color: var(--accent);
box-shadow: 0 0 0 1px var(--accent) inset;
background: var(--accent-soft);
}
.card.cap input {
width: 1.15rem;
height: 1.15rem;
margin-top: 0.2rem;
accent-color: var(--accent);
flex: none;
}
.cap-body { display: flex; flex-direction: column; gap: 0.2rem; }
.cap-body strong { color: var(--ink); }
.cap-body small { color: var(--muted); font-size: 0.93rem; line-height: 1.5; }
.capabilities .cta-row { margin-top: 1.2rem; }
.journey ol { padding: 0; margin: 0; list-style: none; counter-reset: none; display: grid; gap: 0.55rem; }
.journey li {
padding: 0.55rem 0.9rem;
@@ -399,6 +505,15 @@ const hasForm = pageId === "for-founders" || pageId === "for-innovation-hubs";
form.lead textarea { min-height: 6rem; resize: vertical; }
form.lead label.consent { display: flex; gap: 0.5rem; align-items: start; }
form.lead .hp { position: absolute; inset-inline-start: -9999px; }
form.lead .cap-selection {
margin: 0 0 1rem;
padding: 0.45rem 0.7rem;
background: var(--accent-soft);
border-inline-start: 3px solid var(--accent);
border-radius: 0.4rem;
color: var(--ink);
font-size: 0.9rem;
}
footer {
border-top: 1px solid var(--line);