diff --git a/public/admin/config.yml b/public/admin/config.yml index a7117b3..90e6033 100644 --- a/public/admin/config.yml +++ b/public/admin/config.yml @@ -77,20 +77,27 @@ 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: Price questions (founders page, optional) - name: price_groups + - { label: Pricing model question (founders page), name: price_model_question, widget: string, required: false } + - label: Pricing models (each carries its own price ranges) + name: price_models widget: list required: false - hint: Rendered as radio buttons, one question revealed at a time in list order fields: - - { label: Question key (lowercase_with_underscores), name: key, widget: string } - - { label: Question shown to the visitor, name: heading, widget: string } - - label: Price options + - { label: Model key (lowercase_with_underscores), name: key, widget: string } + - { label: Label shown to the visitor, name: label, widget: string } + - label: Price options for this model name: options widget: list fields: - - { label: Option key (e.g. eur25 — also the analytics event name), name: key, widget: string } + - { label: Option key (e.g. eur25), name: key, widget: string } - { label: Label (e.g. €25), name: label, widget: string } + - label: Price questions (founders page, optional — shown one at a time after a model is picked) + name: price_groups + widget: list + required: false + fields: + - { label: Question key (lowercase_with_underscores), name: key, widget: string } + - { label: Question shown to the visitor, name: heading, widget: string } - { label: Price checklist heading, name: price_title, widget: string, required: false } - { label: Price checklist note, name: price_note, widget: text, required: false } - label: Tracked checklist (hubs roadmap, founders what-matters — optional) diff --git a/public/admin/preview.js b/public/admin/preview.js index 9c7a064..d48165e 100644 --- a/public/admin/preview.js +++ b/public/admin/preview.js @@ -37,6 +37,8 @@ const css = ` .pv-price strong { font-size:0.95rem; } fieldset.pv-pricegroup, .pv-pricegroup { border:0; margin:1.1rem 0 0; padding:0; } .pv-pricegroup legend { font-weight:600; font-size:1rem; margin-bottom:0.4rem; color:var(--ink); } + .pv-modelq { font-weight:600; margin:1.4rem 0 0.4rem; } + .pv-models { display:flex; gap:0.5rem; flex-wrap:wrap; } .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); } @@ -62,6 +64,7 @@ const PagePreview = ({ entry, widgetFor, widgetsFor }) => { const journey = items(widgetsFor("journey")); const caps = items(widgetsFor("capabilities")); const priceGroups = items(widgetsFor("price_groups")); + const priceModels = items(widgetsFor("price_models")); const hasHero = d("hero_headline") || d("hero_sub"); return html` @@ -120,18 +123,28 @@ const PagePreview = ({ entry, widgetFor, widgetsFor }) => { `} - ${priceGroups.length > 0 && + ${(priceGroups.length > 0 && priceModels.length > 0) && html`

${d("price_title")}

${d("price_note") && html`

${d("price_note")}

`} +

${d("price_model_question")}

+
+ ${priceModels.map((m, i) => + html` + + ${m.get("label")} + `, + )} +
${priceGroups.map((g, i) => { - const opts = Array.from(g.get("options") || []); - return html`
+ const firstModel = priceModels[0]; + const opts = firstModel ? Array.from(firstModel.get("options") || []) : []; + return html`
${g.get("heading")} ${opts.map((o, j) => - html` + html` ${o.get("label")} `, @@ -178,7 +191,7 @@ const PagePreview = ({ entry, widgetFor, widgetsFor }) => { valueProps.length === 0 && journey.length === 0 && caps.length === 0 && - priceGroups.length === 0 && + priceGroups.length === 0 && priceModels.length === 0 && !d("pilot_text")) && html`

No structured sections — the preview shows the body only.

`} diff --git a/src/components/LeadForm.astro b/src/components/LeadForm.astro index 4ddba92..0751925 100644 --- a/src/components/LeadForm.astro +++ b/src/components/LeadForm.astro @@ -131,6 +131,9 @@ 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 + // the pricing-model picker lives outside the
element + const modelPick = document.querySelector('input[name="price_model"]:checked'); + if (modelPick) payload.price_model = modelPick.value; button.disabled = true; button.textContent = STRINGS.sending || "Sending…"; try { diff --git a/src/layouts/Site.astro b/src/layouts/Site.astro index 06986d5..69c8dff 100644 --- a/src/layouts/Site.astro +++ b/src/layouts/Site.astro @@ -273,29 +273,46 @@ const hasForm = isAudiencePage; { + Array.isArray(fm.price_models) && fm.price_models.length > 0 && Array.isArray(fm.price_groups) && fm.price_groups.length > 0 && (

{fm.price_title}

{fm.price_note &&

{fm.price_note}

} - {fm.price_groups.map((g, i) => ( -
@@ -358,19 +375,40 @@ const hasForm = isAudiencePage; window.umami && window.umami.track(el.dataset.umamiEvent, { selected: !!el.checked }); } catch {} }); - // Progressive price questions: answering one reveals the next - // (fieldsets after the first ship hidden; radios answer each). - document.addEventListener("change", (event) => { - const el = event.target; - if (!el || !el.matches || !el.matches("[data-price]")) return; - const group = el.closest("fieldset.price-group"); - if (!group) return; - const next = group.nextElementSibling; - if (next && next.matches("fieldset.price-group")) { - next.hidden = false; - try { next.scrollIntoView({ behavior: "smooth", block: "nearest" }); } catch {} - } - }); + // Pricing flow: pick a model first, then the four questions appear + // one at a time, each showing only the selected model's price + // ranges. Switching model clears previous answers. + const pricing = document.querySelector("section.pricing"); + if (pricing) { + const sets = pricing.querySelectorAll(".model-set"); + const groups = [...pricing.querySelectorAll("fieldset.price-group:not(.model-picker)")]; + pricing.addEventListener("change", (event) => { + const el = event.target; + if (!el || !el.matches) return; + if (el.matches("[data-model-pick]")) { + const model = el.dataset.modelPick; + sets.forEach((s) => s.classList.toggle("active", s.dataset.modelSet === model)); + pricing.querySelectorAll("[data-price]").forEach((r) => { r.checked = false; }); + groups.forEach((g) => { g.hidden = true; }); + if (groups[0]) { + groups[0].hidden = false; + try { groups[0].scrollIntoView({ behavior: "smooth", block: "nearest" }); } catch {} + } + try { window.umami && window.umami.track("price-model-" + model); } catch {} + } else if (el.matches("[data-price]")) { + try { + window.umami && + window.umami.track(`price-${el.dataset.priceModel}-${el.dataset.priceGroup}-${el.dataset.price}`); + } catch {} + const group = el.closest("fieldset.price-group"); + const next = group && group.nextElementSibling; + if (next && next.matches("fieldset.price-group")) { + next.hidden = false; + try { next.scrollIntoView({ behavior: "smooth", block: "nearest" }); } catch {} + } + } + }); + } })(); @@ -526,6 +564,8 @@ const hasForm = isAudiencePage; .price-list { grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); } fieldset.price-group { border: 0; margin: 1.4rem 0 0; padding: 0; } fieldset.price-group[hidden] { display: none; } + .price-group .model-set { display: none; } + .price-group .model-set.active { display: grid; } fieldset.price-group legend { font-weight: 600; font-size: 1rem; diff --git a/src/pages/for-founders.md b/src/pages/for-founders.md index 787dd6a..3d40e71 100644 --- a/src/pages/for-founders.md +++ b/src/pages/for-founders.md @@ -25,61 +25,39 @@ value_props_title: What you get journey: [] journey_title: '' journey_note: '' +price_model_question: Which pricing model would you prefer? +price_models: + - key: monthly + label: Monthly subscription + options: + - { key: eur0, label: "€0" } + - { key: eur10, label: "€10" } + - { key: eur25, label: "€25" } + - { key: eur50, label: "€50" } + - { key: eur100plus, label: "€100+" } + - key: annual + label: Annual + options: + - { key: eur0, label: "€0" } + - { key: eur50, label: "€50" } + - { key: eur150, label: "€150" } + - { key: eur300, label: "€300" } + - { key: eur500, label: "€500" } + - key: per_project + label: Per project + options: + - { key: eur0, label: "€0" } + - { key: eur10, label: "€10" } + - { key: eur25, label: "€25" } + - { key: eur50, label: "€50" } + - { key: eur100plus, label: "€100+" } price_groups: - - key: too_expensive - heading: At what monthly price would the journey feel too expensive? - options: - - key: eur0 - label: €0 - - key: eur10 - label: €10 - - key: eur25 - label: €25 - - key: eur50 - label: €50 - - key: eur100plus - label: €100+ - - key: bargain - heading: At what monthly price would it be a bargain you'd sign up straight away? - options: - - key: eur0 - label: €0 - - key: eur10 - label: €10 - - key: eur25 - label: €25 - - key: eur50 - label: €50 - - key: eur100plus - label: €100+ - - key: too_cheap - heading: At what monthly price is it so cheap you'd doubt it's any good? - options: - - key: eur0 - label: €0 - - key: eur10 - label: €10 - - key: eur25 - label: €25 - - key: eur50 - label: €50 - - key: eur100plus - label: €100+ - - key: worth_considering - heading: At what monthly price would it feel expensive, but worth considering? - options: - - key: eur0 - label: €0 - - key: eur10 - label: €10 - - key: eur25 - label: €25 - - key: eur50 - label: €50 - - key: eur100plus - label: €100+ + - { key: too_expensive, heading: "At what price would the journey feel too expensive?" } + - { key: bargain, heading: "At what price would it be a bargain you'd sign up straight away?" } + - { key: too_cheap, heading: "At what price is it so cheap you'd doubt it's any good?" } + - { key: worth_considering, heading: "At what price would it feel expensive, but worth considering?" } price_title: Help us get it right -price_note: Four quick questions on the monthly price, one at a time. Your answers are anonymous in our analytics (if you've allowed them) and arrive with your invitation request below. +price_note: First tell us which pricing model you'd prefer, then answer four quick questions about price - one at a time. Anonymous in our analytics (if you've allowed them), and the answers arrive with your invitation request below. capabilities: - key: team_collaboration heading: Team collaboration