Epc Calculator 2
Commission staircase for JV pages: the partner sets the front-end sales they expect and watches each funnel step
Use it in a prompt
Use jv/epc-calculator-2 from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/jv/epc-calculator-2.tsx. - Import it and pass your copy and images (Props tab):
import { EpcCalculator2 } from "@/components/funneldna/jv/epc-calculator-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/jv/epc-calculator-2/component.tsx 547 lines
// layout: price-staircase
// Commission staircase for JV pages: the partner sets the front-end sales they expect and watches each funnel step
// add its commission, stair by stair, up to an estimated total. Then they take the one action: join the launch.
import * as React from "react"
import { AlertCircle, Info, Minus, Plus } from "lucide-react"
import { FX_HOST, Pattern } from "../fx/fx"
export type FunnelStep = {
/** Step name shown on the stair, e.g. "Order bump". */
name: string
/** Price of this step in currency units, e.g. 27. */
price: number
/** Percent of front-end buyers who take this step, as supplied by the offer owner (100 for the front end). */
takeRate: number
/** Percent of this step's price paid to the partner, as supplied by the offer owner. */
commission: number
}
export type CommissionEstimate = {
sales: number
steps: { name: string; buyers: number; amount: number }[]
total: number
perSale: number
}
const COPY = {
/** {price} is replaced with the front-end price. */
priceLine: "Just {price}",
stepperLabel: "Front-end sales you expect",
stepperSuffix: "sales",
stepperPlaceholder: "40",
/** {step} is replaced. */
decrease: "Decrease expected sales by {step}",
/** {step} is replaced. */
increase: "Increase expected sales by {step}",
errorEmpty: "Enter how many front-end sales you expect, like 40.",
/** {max} is replaced. */
errorInvalid: "Use a whole number from 0 to {max}.",
staleNote: "Fix the number above to update the staircase.",
chartTitle: "Watch every step add to your pay",
estimateChip: "Estimate",
/** {buyers}, {commission} and {price} are replaced. */
frontEndMath: "{buyers} sales × {commission} of {price}",
/** {take}, {commission} and {price} are replaced. */
stepMath: "{take} take × {commission} of {price}",
/** {amount} is replaced. */
stepAmount: "+{amount}",
totalLabel: "Estimated total",
/** {amount} is replaced. */
perSale: "≈ {amount} per front-end sale",
totalName: "Your whole funnel",
/** {count} is replaced. */
totalMath: "{count} steps added together",
disclaimer: "Estimate only, not a promise of earnings. Take rates and commissions are the offer owner's figures; your results depend on your audience and how you promote.",
salutation: "Dear partner,",
signoff: "Talk soon,",
question: "Ready to promote the whole funnel?",
/** {sales} and {total} are replaced. */
recap: "At {sales} front-end sales, that's about {total} in estimated commission.",
actionLabel: "I'm in, send my partner link",
}
export type EpcCalculator2Copy = typeof COPY
const LETTER: React.ReactNode[] = [
"Most launch pages show you one number: the front-end commission. It's the smallest step on the staircase.",
"Your buyers also see the order bump, the upsell and the downsell. You earn on every one they take, so each front-end sale is worth more than its price.",
"Set your expected sales above, look at the whole staircase, then grab your link.",
]
export type EpcCalculator2Props = {
/** Product the partner promotes, shown beside the front-end price. */
productName: string
/** Funnel steps in order, front end first. Every rate comes from the offer owner. */
steps: FunnelStep[]
/** The front-end price said in words, beside "Just $47". */
priceNote?: React.ReactNode
/** ISO currency code for every money figure. */
currency?: string
locale?: string
/** Starting front-end sales in the stepper. */
defaultSales?: number
/** How far each stepper press moves. */
salesStep?: number
maxSales?: number
/** Sales count at which the stairs reach full height; above it they stay full while the numbers grow. */
chartScaleSales?: number
headline?: string
/** Phrase inside the headline that gets the marker stroke. */
highlight?: string
lead?: React.ReactNode
/** product slot: transparent cut-out of the offer. */
productImage?: string
productImageAlt?: string
/** Short letter paragraphs from the offer owner. */
letter?: React.ReactNode[]
ownerName?: string
ownerRole?: string
/** presenter slot: the offer owner's portrait. */
presenterImage?: string
presenterImageAlt?: string
/** One short line under the button. */
actionNote?: string
href?: string
/** Called with the current estimate when the action is clicked. */
onAction?: (estimate: CommissionEstimate) => void
copy?: Partial<EpcCalculator2Copy>
state?: "default" | "hover" | "active" | "disabled" | "error"
className?: string
}
type Parsed = { ok: true; n: number } | { ok: false; reason: "empty" | "invalid" }
export function EpcCalculator2(props: EpcCalculator2Props) {
const {
productName,
steps,
priceNote,
currency = "USD",
locale = "en-US",
defaultSales = 40,
salesStep = 5,
maxSales = 2000,
chartScaleSales = 100,
headline = "Your pay doesn't stop at the front end",
highlight = "doesn't stop",
lead = "Set the front-end sales you expect. Every step of the funnel adds its commission, right up to your total.",
productImage,
productImageAlt = "",
letter = LETTER,
ownerName,
ownerRole,
presenterImage,
presenterImageAlt = "",
actionNote,
href,
onAction,
copy,
state = "default",
className,
} = props
const c: EpcCalculator2Copy = { ...COPY, ...copy }
const uid = React.useId()
const ids = { h: `${uid}-h`, label: `${uid}-label`, input: `${uid}-input`, err: `${uid}-err` }
const max = Math.max(1, Math.floor(Number.isFinite(maxSales) ? maxSales : 2000))
const step = Math.max(1, Math.floor(Number.isFinite(salesStep) ? salesStep : 5))
const start = state === "disabled" ? 0 : clamp(Math.round(Number.isFinite(defaultSales) ? defaultSales : 0), 0, max)
const [sales, setSales] = React.useState(start)
const [raw, setRaw] = React.useState(state === "error" ? "" : String(start))
const [blurred, setBlurred] = React.useState(state === "error")
const fmtInt = (n: number) => new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }).format(n)
const fmtPct = (n: number) => `${new Intl.NumberFormat(locale, { maximumFractionDigits: 2 }).format(n)}%`
const money = (n: number, digits: number) =>
new Intl.NumberFormat(locale, { style: "currency", currency, minimumFractionDigits: digits, maximumFractionDigits: digits }).format(n)
const fmtPrice = (n: number) => money(n, Number.isInteger(n) ? 0 : 2)
const parsed = parseSales(raw, max)
const invalid = !parsed.ok
const showError = !parsed.ok && (parsed.reason === "invalid" || blurred)
const errorText = !parsed.ok && parsed.reason === "empty" ? c.errorEmpty : fill(c.errorInvalid, { max: fmtInt(max) })
const perSale = steps.reduce((sum, s) => sum + unit(s), 0)
const ceiling = perSale * Math.max(sales, Math.max(1, chartScaleSales))
let running = 0
const rows = steps.map((s, i) => {
const buyers = (sales * pct(s.takeRate)) / 100
const amount = sales * unit(s)
running += amount
const math =
i === 0
? fill(c.frontEndMath, { buyers: fmtInt(Math.round(buyers)), commission: fmtPct(pct(s.commission)), price: fmtPrice(s.price) })
: fill(c.stepMath, { take: fmtPct(pct(s.takeRate)), commission: fmtPct(pct(s.commission)), price: fmtPrice(s.price) })
return {
name: s.name,
buyers,
amount,
math,
h: ceiling > 0 ? Math.min(1, running / ceiling) : 0,
g: running > 0 ? amount / running : 0,
}
})
const total = running
const estimate: CommissionEstimate = {
sales,
steps: rows.map((r) => ({ name: r.name, buyers: r.buyers, amount: r.amount })),
total,
perSale,
}
const frontPrice = steps.length ? steps[0].price : undefined
const nudge = (d: number) => {
const next = clamp(sales + d, 0, max)
setSales(next)
setRaw(String(next))
setBlurred(false)
}
const onChange = (value: string) => {
setRaw(value)
const p = parseSales(value, max)
if (p.ok) setSales(p.n)
}
const onBlur = () => {
setBlurred(true)
if (parsed.ok) setRaw(String(parsed.n))
}
const act = () => onAction?.(estimate)
const ctaClass = ["ec-cta", state === "hover" && "is-hover", state === "active" && "is-active"].filter(Boolean).join(" ")
return (
<section
className={["cf-epc-calculator-2", className].filter(Boolean).join(" ")}
style={FX_HOST}
aria-labelledby={ids.h}
>
<style>{CSS}</style>
<Pattern name="grid" fade="edges" />
<div className="ec-wrap">
<header className="ec-head">
<h2 id={ids.h} className="ec-h2">{withMark(headline, highlight)}</h2>
{lead ? <p className="ec-lead">{lead}</p> : null}
</header>
<div className="ec-calc">
<div className="ec-controls">
<div className="ec-offer">
{productImage ? (
<img className="ec-product" src={productImage} alt={productImageAlt} width={192} height={192} />
) : null}
<div className="ec-offer-text">
<h3 className="ec-offer-name">{productName}</h3>
{frontPrice !== undefined ? (
<p className="ec-price">
<strong className="ec-just">{fill(c.priceLine, { price: fmtPrice(frontPrice) })}</strong>
{priceNote ? <span className="ec-price-note">{priceNote}</span> : null}
</p>
) : null}
</div>
</div>
<div className="ec-field">
<label id={ids.label} htmlFor={ids.input} className="ec-label">{c.stepperLabel}</label>
<div className="ec-stepper" role="group" aria-labelledby={ids.label}>
<button
type="button"
className="ec-step"
onClick={() => nudge(-step)}
disabled={sales <= 0}
aria-label={fill(c.decrease, { step: fmtInt(step) })}
>
<Minus size={20} strokeWidth={2.5} aria-hidden="true" />
</button>
<div className="ec-count">
<input
id={ids.input}
className="ec-input"
type="text"
inputMode="numeric"
autoComplete="off"
placeholder={c.stepperPlaceholder}
value={raw}
onChange={(e) => onChange(e.target.value)}
onBlur={onBlur}
onKeyDown={(e) => {
if (e.key === "ArrowUp") {
e.preventDefault()
nudge(1)
} else if (e.key === "ArrowDown") {
e.preventDefault()
nudge(-1)
}
}}
aria-invalid={showError ? true : undefined}
aria-describedby={showError ? ids.err : undefined}
/>
<span className="ec-suffix" aria-hidden="true">{c.stepperSuffix}</span>
</div>
<button
type="button"
className="ec-step"
onClick={() => nudge(step)}
disabled={sales >= max}
aria-label={fill(c.increase, { step: fmtInt(step) })}
>
<Plus size={20} strokeWidth={2.5} aria-hidden="true" />
</button>
</div>
{showError ? (
<p id={ids.err} className="ec-error">
<AlertCircle className="ec-inline" size={16} strokeWidth={2.5} aria-hidden="true" />
{errorText}
</p>
) : null}
</div>
</div>
<div className="ec-stage">
<div className="ec-stage-head">
<h3 className="ec-stage-title">{c.chartTitle}</h3>
<span className="ec-chip">{c.estimateChip}</span>
</div>
{invalid ? <p className="ec-stale">{c.staleNote}</p> : null}
<ol
className="ec-stairs"
style={{ ["--n" as string]: String(Math.max(1, rows.length)) } as React.CSSProperties}
aria-label={c.chartTitle}
>
{rows.map((r, i) => (
<li
key={`${r.name}-${i}`}
className="ec-stair"
style={{
["--h" as string]: r.h.toFixed(4),
["--g" as string]: r.g.toFixed(4),
["--i" as string]: String(i),
} as React.CSSProperties}
>
<div className="ec-plot">
<span className="ec-amt">{fill(c.stepAmount, { amount: money(r.amount, 0) })}</span>
<span className="ec-riser" aria-hidden="true">
<span className="ec-gain" />
</span>
</div>
<div className="ec-meta">
<span className="ec-name">{r.name}</span>
<span className="ec-math">{r.math}</span>
</div>
</li>
))}
<li className="ec-stair is-total" style={{ ["--i" as string]: String(rows.length) } as React.CSSProperties}>
<div className="ec-plot">
<div className="ec-tower">
<span className="ec-tower-label">{c.totalLabel}</span>
<span className="ec-total" aria-live="polite">{money(total, 0)}</span>
<span className="ec-per">{fill(c.perSale, { amount: money(perSale, perSale < 100 ? 2 : 0) })}</span>
</div>
</div>
<div className="ec-meta">
<span className="ec-name">{c.totalName}</span>
<span className="ec-math">{fill(c.totalMath, { count: fmtInt(rows.length) })}</span>
</div>
</li>
</ol>
<p className="ec-fine">
<Info className="ec-inline" size={16} strokeWidth={2.5} aria-hidden="true" />
{c.disclaimer}
</p>
</div>
</div>
<div className="ec-close">
<div className="ec-letter">
<p className="ec-salute">{c.salutation}</p>
{letter.map((p, i) => (
<p key={i}>{p}</p>
))}
<p className="ec-signoff">{c.signoff}</p>
{ownerName || presenterImage ? (
<div className="ec-sign">
{presenterImage ? (
<img className="ec-portrait" src={presenterImage} alt={presenterImageAlt} width={128} height={128} loading="lazy" />
) : null}
<div>
{ownerName ? <p className="ec-owner">{ownerName}</p> : null}
{ownerRole ? <p className="ec-role">{ownerRole}</p> : null}
</div>
</div>
) : null}
</div>
<div className="ec-act">
<h3 className="ec-q">{c.question}</h3>
<p className="ec-recap">
{fillRich(c.recap, { sales: fmtInt(sales), total: <strong>{money(total, 0)}</strong> })}
</p>
<div className="ec-cta-wrap">
{href ? (
<a className={ctaClass} href={href} onClick={act}>{c.actionLabel}</a>
) : (
<button type="button" className={ctaClass} onClick={act}>{c.actionLabel}</button>
)}
{actionNote ? <p className="ec-note">{actionNote}</p> : null}
</div>
</div>
</div>
</div>
</section>
)
}
export default EpcCalculator2
function clamp(n: number, lo: number, hi: number) {
return Math.min(hi, Math.max(lo, n))
}
function pct(n: number) {
return Number.isFinite(n) ? clamp(n, 0, 100) : 0
}
function unit(s: FunnelStep) {
const price = Number.isFinite(s.price) ? Math.max(0, s.price) : 0
return (pct(s.takeRate) / 100) * price * (pct(s.commission) / 100)
}
function parseSales(raw: string, max: number): Parsed {
const t = raw.replace(/[\s,]/g, "")
if (!t) return { ok: false, reason: "empty" }
if (!/^\d+$/.test(t)) return { ok: false, reason: "invalid" }
const n = Number(t)
if (!Number.isFinite(n) || n > max) return { ok: false, reason: "invalid" }
return { ok: true, n }
}
function fill(t: string, vars: Record<string, string>): string {
return t.replace(/\{(\w+)\}/g, (all, k: string) => (k in vars ? vars[k] : all))
}
function fillRich(t: string, vars: Record<string, React.ReactNode>): React.ReactNode {
return t.split(/(\{\w+\})/g).map((part, i) => {
const m = /^\{(\w+)\}$/.exec(part)
return <React.Fragment key={i}>{m && m[1] in vars ? vars[m[1]] : part}</React.Fragment>
})
}
function withMark(text: string, phrase?: string): React.ReactNode {
const i = phrase ? text.indexOf(phrase) : -1
if (!phrase || i < 0) return text
return (
<>
{text.slice(0, i)}
<span className="ec-mark">{phrase}</span>
{text.slice(i + phrase.length)}
</>
)
}
const R = ".cf-epc-calculator-2"
const SH = "var(--shadow, oklch(0.22 0.03 260))"
const BG = "var(--button-bg, var(--cta))"
const BG2 = "var(--button-bg-2, var(--cta-2))"
const B2 = "var(--button-2-bg, var(--secondary))"
const FOCUS = "var(--field-focus, var(--accent))"
const FILL = "var(--accent-fill, var(--accent))"
const SOFT = "color-mix(in oklch, var(--band-ink) 82%, var(--band))"
const EASE = "cubic-bezier(.2,.7,.2,1)"
const CSS = `
${R}{--ec-marker:color-mix(in oklch,var(--marker,#fae37c) 88%,transparent);position:relative;isolation:isolate;overflow:hidden;background:var(--surface);color:var(--ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px)}
${R} *,${R} *::before,${R} *::after{box-sizing:border-box}
${R} .ec-wrap{position:relative;z-index:1;max-width:1120px;margin:0 auto}
${R} .ec-head{max-width:46rem;margin:0 auto;text-align:center}
${R} .ec-h2{margin:0;font-family:var(--font-display);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);color:var(--ink);text-wrap:balance}
${R} .ec-mark{color:var(--ink);padding:0 .1em;margin:0 -.04em;border-radius:.14em;background:linear-gradient(to bottom,transparent 42%,var(--ec-marker) 42%,var(--ec-marker) 94%,transparent 94%);-webkit-box-decoration-break:clone;box-decoration-break:clone}
${R} .ec-lead{margin:16px auto 0;max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
${R} .ec-calc{margin-top:clamp(32px,4vw,48px);background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(from ${SH} l c h / .22),0 12px 24px -8px oklch(from ${SH} l c h / .32)));overflow:hidden}
${R} .ec-controls{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:24px 32px;padding:clamp(20px,3vw,32px)}
${R} .ec-offer{display:flex;align-items:center;gap:16px;min-width:0;flex:1 1 320px}
${R} .ec-product{width:96px;height:96px;flex:none;object-fit:contain;filter:drop-shadow(0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / .3)) drop-shadow(0 10px 12px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / .2))}
${R} .ec-offer-text{min-width:0}
${R} .ec-offer-name{margin:0;font-family:var(--font-display);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:var(--display-weight,800);letter-spacing:-.01em;text-transform:var(--display-case,none);color:var(--ink);text-wrap:balance}
${R} .ec-price{margin:8px 0 0;display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 10px}
${R} .ec-just{font-family:var(--font-display);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:800;color:var(--accent);font-variant-numeric:tabular-nums;white-space:nowrap}
${R} .ec-price-note{font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
${R} .ec-field{display:grid;gap:8px;flex:0 1 auto;min-width:0}
${R} .ec-label{font-size:1rem;line-height:1.2;font-weight:700;color:var(--label-ink,var(--ink))}
${R} .ec-stepper{display:flex;align-items:stretch;gap:8px}
${R} .ec-step{display:inline-flex;align-items:center;justify-content:center;width:56px;height:56px;flex:none;padding:0;border:1px solid var(--button-2-border,transparent);border-radius:var(--button-radius,var(--radius,12px));background:${B2};color:var(--button-2-ink,var(--secondary-ink));box-shadow:var(--button-2-shadow,var(--shadow-sm));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
${R} .ec-step:hover:not(:disabled){background:oklch(from ${B2} calc(l - .05) c h)}
${R} .ec-step:active:not(:disabled){transform:translateY(1px);box-shadow:none;background:oklch(from ${B2} calc(l - .08) c h)}
${R} .ec-step:disabled{cursor:not-allowed;box-shadow:none;color:color-mix(in oklch,var(--button-2-ink,var(--secondary-ink)) 40%,${B2})}
${R} .ec-step:focus-visible,${R} .ec-cta:focus-visible{outline:3px solid ${FOCUS};outline-offset:3px}
${R} .ec-count{position:relative;display:flex;flex:1 1 auto;min-width:0}
${R} .ec-input{width:9.5rem;flex:1 1 auto;min-width:0;height:56px;padding:0 64px 0 16px;border:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));background:var(--field);color:var(--field-ink);font-family:var(--font-display);font-size:1.375rem;line-height:1;font-weight:800;text-align:right;font-variant-numeric:tabular-nums;outline:none;transition:border-color .16s ease,box-shadow .16s ease}
${R} .ec-input::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
${R} .ec-input:hover:not(:focus-visible):not([aria-invalid="true"]){border-color:color-mix(in oklch,var(--field-ink) 42%,var(--field))}
${R} .ec-input:focus-visible{border-color:var(--field-focus, var(--accent));box-shadow:0 0 0 3px oklch(from var(--field-focus, var(--accent)) l c h / .35)}
${R} .ec-input[aria-invalid="true"]{border-color:var(--danger)}
${R} .ec-input[aria-invalid="true"]:focus-visible{box-shadow:0 0 0 3px oklch(from var(--danger) l c h / .3)}
${R} .ec-suffix{position:absolute;right:16px;top:50%;transform:translateY(-50%);font-size:1rem;line-height:1;font-weight:600;color:color-mix(in oklch,var(--field-ink) 75%,var(--field));pointer-events:none}
${R} .ec-error{margin:0;max-width:22rem;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--danger);text-wrap:pretty}
${R} .ec-inline{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em}
${R} .ec-stage{background:var(--band);color:var(--band-ink);padding:clamp(24px,3vw,40px) clamp(20px,3vw,32px) clamp(20px,3vw,32px)}
${R} .ec-stage-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 16px}
${R} .ec-stage-title{margin:0;font-family:var(--font-display);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:var(--display-weight,800);letter-spacing:-.01em;text-transform:var(--display-case,none);color:var(--band-ink);text-wrap:balance}
${R} .ec-chip{display:inline-flex;align-items:center;min-height:28px;padding:4px 12px;border-radius:999px;background:oklch(from var(--band-ink) l c h / .12);color:var(--band-ink);font-size:.875rem;line-height:1.2;font-weight:800;letter-spacing:.06em;text-transform:uppercase}
${R} .ec-stale{margin:12px 0 0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--band-ink)}
${R} .ec-stairs{list-style:none;margin:28px 0 0;padding:0;display:grid;grid-template-columns:repeat(var(--n),minmax(0,1fr)) minmax(0,1.3fr);gap:10px;align-items:start}
${R} .ec-stair{display:flex;flex-direction:column;min-width:0;animation:cf-epc-calculator-2-rise .45s ${EASE} both;animation-delay:min(calc(var(--i,0) * .07s),.28s)}
${R} .ec-plot{height:clamp(300px,30vw,360px);display:flex;flex-direction:column;justify-content:flex-end;gap:10px;border-bottom:2px solid oklch(from var(--band-ink) l c h / .28)}
${R} .ec-amt{font-family:var(--font-display);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:800;letter-spacing:-.01em;color:var(--band-ink);font-variant-numeric:tabular-nums;white-space:nowrap}
${R} .ec-riser{position:relative;display:block;height:calc(16px + (76% - 16px) * var(--h,0));border-radius:10px 10px 0 0;background:color-mix(in oklch,var(--band-ink) 16%,var(--band));overflow:hidden;transition:height .45s ${EASE}}
${R} .ec-gain{position:absolute;left:0;right:0;top:0;height:calc(var(--g,0) * 100%);background:${FILL};box-shadow:inset 0 1px 0 oklch(from ${FILL} calc(l + .12) c h / .7);transition:height .45s ${EASE},width .45s ${EASE}}
${R} .ec-meta{display:grid;gap:4px;padding-top:14px;min-width:0}
${R} .ec-name{font-size:1.0625rem;line-height:1.2;font-weight:800;color:var(--band-ink);text-wrap:balance}
${R} .ec-math{font-size:.9375rem;line-height:1.4;font-weight:500;color:${SOFT};font-variant-numeric:tabular-nums;text-wrap:pretty}
${R} .is-total .ec-tower{height:100%;display:flex;flex-direction:column;padding:clamp(16px,2vw,24px);border-radius:12px 12px 0 0;background:${FILL};color:var(--accent-fill-ink,var(--card));box-shadow:inset 0 1px 0 oklch(from ${FILL} calc(l + .12) c h / .7);container-type:inline-size}
${R} .ec-tower-label{font-size:.875rem;line-height:1.2;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
${R} .ec-total{margin-top:12px;font-family:var(--font-display);font-size:clamp(1.625rem,18cqi,3.75rem);line-height:1;font-weight:800;letter-spacing:-.03em;font-variant-numeric:tabular-nums;white-space:nowrap}
${R} .ec-per{display:block;margin-top:12px;max-width:100%;font-size:.9375rem;line-height:1.4;font-weight:600;text-wrap:pretty}
${R} .ec-fine{margin:24px 0 0;max-width:72ch;font-size:.9375rem;line-height:1.45;font-weight:500;color:${SOFT};text-wrap:pretty}
${R} .ec-close{margin-top:clamp(48px,6vw,72px);display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:clamp(32px,5vw,72px);align-items:start}
${R} .ec-letter p{margin:0 0 16px;max-width:62ch;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.6;color:var(--ink);text-wrap:pretty}
${R} .ec-letter .ec-salute{font-weight:700}
${R} .ec-letter .ec-signoff{margin:24px 0 0}
${R} .ec-sign{display:flex;align-items:center;gap:16px;margin-top:12px}
${R} .ec-letter .ec-sign p{margin:0}
${R} .ec-portrait{width:64px;height:64px;flex:none;border-radius:12px;object-fit:cover;object-position:50% 25%}
${R} .ec-letter .ec-owner{font-family:var(--font-display);font-size:1.125rem;line-height:1.2;font-weight:800}
${R} .ec-letter .ec-role{font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted)}
${R} .ec-act{display:grid;gap:16px;padding:clamp(20px,3vw,32px);border-radius:var(--card-radius,var(--radius,14px));background:color-mix(in oklch,var(--ink) 4%,var(--surface))}
${R} .ec-q{margin:0;font-family:var(--font-display);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:var(--display-weight,800);letter-spacing:-.01em;text-transform:var(--display-case,none);color:var(--ink);text-wrap:balance}
${R} .ec-recap{margin:0;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--ink);text-wrap:pretty}
${R} .ec-recap strong{font-weight:800;font-variant-numeric:tabular-nums}
${R} .ec-cta-wrap{display:grid;gap:10px;margin-top:8px}
${R} .ec-cta{display:inline-flex;align-items:center;justify-content:center;width:100%;min-height:72px;padding:12px 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from ${BG} calc(l + .04) c h),oklch(from ${BG2} calc(l - .02) c h));color:var(--button-ink,var(--cta-ink));font-family:var(--button-font,var(--font-display));font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;font-weight:var(--button-weight,800);text-transform:var(--button-case,none);text-align:center;text-decoration:none;text-shadow:var(--button-text-shadow,none);text-wrap:balance;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from ${BG} calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from ${BG} calc(l - .16) c h),0 1px 2px oklch(from ${SH} l c h / .3),0 8px 16px -6px oklch(from ${SH} l c h / .45));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
${R} .ec-cta:hover,${R} .ec-cta.is-hover{background:linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - .01) c h),oklch(from var(--button-bg-2, var(--cta-2)) calc(l - .07) c h));transform:translateY(-1px);box-shadow:inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + .1) c h / .6),inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - .2) c h),0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / .32),0 12px 20px -6px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / .5)}
${R} .ec-cta:active,${R} .ec-cta.is-active{transform:translateY(1px);background:linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - .06) c h),oklch(from var(--button-bg-2, var(--cta-2)) calc(l - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--button-bg, var(--cta)) calc(l - .24) c h / .55),inset 0 -2px 0 oklch(from var(--button-bg, var(--cta)) calc(l - .18) c h),0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / .3)}
${R} .ec-note{margin:0;text-align:center;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
@keyframes cf-epc-calculator-2-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (max-width:860px){
${R} .ec-stairs{display:flex;flex-direction:column;align-items:stretch;gap:8px;margin-top:20px}
${R} .ec-stair{display:grid;width:100%;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"meta amt" "bar bar";gap:12px 16px;padding:16px;border-radius:10px;background:color-mix(in oklch,var(--band-ink) 8%,var(--band))}
${R} .ec-plot{display:contents}
${R} .ec-amt{grid-area:amt;align-self:start;font-size:1.3125rem}
${R} .ec-riser{grid-area:bar;height:10px;width:calc(6% + 94% * var(--h,0));border-radius:999px;transition:width .45s ${EASE}}
${R} .ec-gain{left:auto;right:0;bottom:0;height:auto;width:calc(var(--g,0) * 100%)}
${R} .ec-meta{grid-area:meta;padding-top:0}
${R} .ec-stair.is-total{display:block;padding:0;margin-top:4px;background:none}
${R} .is-total .ec-plot{display:block;height:auto;border:0}
${R} .is-total .ec-tower{width:100%;height:auto;padding:20px 24px 24px;border-radius:12px}
${R} .is-total .ec-meta{display:none}
${R} .ec-total{font-size:clamp(2.5rem,14cqi,3.25rem)}
${R} .ec-close{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:560px){
${R} .ec-field{flex:1 1 100%}
${R} .ec-input{width:100%}
${R} .ec-product{width:80px;height:80px}
}
@media (prefers-reduced-motion:reduce){
${R} .ec-stair{animation:none}
${R} .ec-riser,${R} .ec-gain,${R} .ec-step,${R} .ec-cta,${R} .ec-input{transition:none}
${R} .ec-cta:hover,${R} .ec-cta.is-hover,${R} .ec-cta:active,${R} .ec-cta.is-active,${R} .ec-step:active:not(:disabled){transform:none}
}
`
pieces/jv/epc-calculator-2/specimen.tsx 41 lines
import __studioImagec38f15d8 from "../assets/56798ae14f9565b1.webp";
import __studioImage7a7f8030 from "../assets/d09e469ae94fd72b.webp";
import * as React from "react"
import { EpcCalculator2 } from "../epc-calculator-2"
import { slot } from "../../slots"
const bootcampShot = __studioImagec38f15d8
const founderPortrait = __studioImage7a7f8030
export const states = ["default", "hover", "active", "disabled", "error"]
export default function EpcCalculator2Specimen({ state }: { state?: "default" | "hover" | "active" | "disabled" | "error" }) {
return (
<EpcCalculator2
state={state}
productName="Bookkeeping Bootcamp"
priceNote="less than an hour of catch-up bookkeeping"
steps={[
{ name: "Front end", price: 47, takeRate: 100, commission: 50 },
{ name: "Order bump", price: 27, takeRate: 35, commission: 50 },
{ name: "Upsell", price: 297, takeRate: 12, commission: 40 },
{ name: "Downsell", price: 97, takeRate: 8, commission: 40 },
]}
defaultSales={40}
salesStep={5}
chartScaleSales={60}
productImage={slot("product", bootcampShot)}
productImageAlt="Bookkeeping Bootcamp workbook beside a laptop and calculator"
letter={[
"Most launch pages show you one number: the front-end commission. On Bookkeeping Bootcamp, that's the smallest step on the staircase.",
"Your buyers also see the client onboarding templates bump, the Bootcamp Pro upsell and a lighter downsell. You earn on every one they take.",
"Set the sales you expect, look at the whole staircase, then grab your link for launch week.",
]}
ownerName="Maya Ellison"
ownerRole="Founder, Bookkeeping Bootcamp"
presenterImage={slot("presenter", founderPortrait)}
presenterImageAlt="Maya Ellison, founder of Bookkeeping Bootcamp"
actionNote="Free to join · One link covers every step"
/>
)
}
| Name | Type | Details |
|---|---|---|
productName RequiredEpcCalculator2 |
string |
|
steps RequiredEpcCalculator2 |
FunnelStep[] |
|
priceNote OptionalEpcCalculator2 |
React.ReactNode |
|
currency OptionalEpcCalculator2 |
string |
|
locale OptionalEpcCalculator2 |
string |
|
defaultSales OptionalEpcCalculator2 |
number |
|
salesStep OptionalEpcCalculator2 |
number |
|
maxSales OptionalEpcCalculator2 |
number |
|
chartScaleSales OptionalEpcCalculator2 |
number |
|
headline OptionalEpcCalculator2 |
string |
|
highlight OptionalEpcCalculator2 |
string |
|
lead OptionalEpcCalculator2 |
React.ReactNode |
|
productImage OptionalEpcCalculator2 |
string |
|
productImageAlt OptionalEpcCalculator2 |
string |
|
letter OptionalEpcCalculator2 |
React.ReactNode[] |
|
ownerName OptionalEpcCalculator2 |
string |
|
ownerRole OptionalEpcCalculator2 |
string |
|
presenterImage OptionalEpcCalculator2 |
string |
|
presenterImageAlt OptionalEpcCalculator2 |
string |
|
actionNote OptionalEpcCalculator2 |
string |
|
href OptionalEpcCalculator2 |
string |
|
onAction OptionalEpcCalculator2 |
(estimate: CommissionEstimate) => void |
|
copy OptionalEpcCalculator2 |
Partial<EpcCalculator2Copy> |
|
state OptionalEpcCalculator2 |
"default" | "hover" | "active" | "disabled" | "error" |
|
className OptionalEpcCalculator2 |
string |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-border--button-2-ink--button-2-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--field-border--field-focus--field-ink--field-radius- Form inputs: background, ink, border, radius and focus colour.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
presenter- A photo of the host, coach or founder.
product- The main product shot or cover (ebook, kit, bottle).
-
56798ae14f9565b1.webp
image/webp · 160 KB
-
d09e469ae94fd72b.webp
image/webp · 82.9 KB