Time Back Calculator 1
Time-back calculator: one big slider turns a weekly chore into hours, money and a year of week-cells won back, then hands the visitor to one action.
Use it in a prompt
Use content/time-back-calculator 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/content/time-back-calculator.tsx. - Import it and pass your copy and images (Props tab):
import { TimeBackCalculator } from "@/components/funneldna/content/time-back-calculator"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/time-back-calculator/component.tsx 533 lines
// layout: bento-grid
// Time-back calculator: one big slider turns a weekly chore into hours, money and a year of week-cells won back, then hands the visitor to one action.
import React from "react";
import { CircleAlert, Info, ShieldCheck } from "lucide-react";
import { Texture, Divider, FX_HOST } from "../fx/fx";
import topo from "../fx/textures/topo";
export type TimeBackEstimate = {
hoursPerWeek: number;
teamSize: number;
hourlyValue: number;
hoursBack: number;
valueBack: number;
weeksBack: number;
};
export type TimeBackCalculatorProps = {
headline?: React.ReactNode;
lead?: React.ReactNode;
/** Slider label: the weekly task being measured. */
label?: string;
/** Unit beside the big slider readout. */
unit?: string;
hoursMin?: number;
hoursMax?: number;
hoursStep?: number;
defaultHours?: number;
defaultTeamSize?: number;
defaultHourlyValue?: number;
teamLabel?: string;
teamPlaceholder?: string;
teamMax?: number;
hourlyLabel?: string;
hourlyPlaceholder?: string;
hourlyMax?: number;
/** Inline error; {max} is replaced. */
teamError?: string;
/** Inline error; {max} is replaced. */
hourlyError?: string;
/** Share of the work the offer automates, 0 to 1. Drives every estimate. */
automationShare?: number;
/** Plain assumption line; {percent} and {weeks} are replaced. */
assumption?: string;
/** Bold lead-in that marks the figures as an estimate. */
estimateLabel?: string;
/** Working weeks counted per year. */
weeksPerYear?: number;
/** Hours in one work week (one cell). */
workWeekHours?: number;
/** {weeks} is replaced. */
weeksHeading?: string;
/** Shown when more than 52 weeks come back; {weeks} is replaced. */
weeksOverflowHeading?: string;
/** Shown while the team size is missing or invalid. */
weeksEmptyHeading?: string;
/** {hours} is replaced. */
weeksLegend?: string;
/** Accessible label for the cells; {weeks} and {total} are replaced. */
weeksAriaLabel?: string;
resultHeading?: string;
hoursUnit?: string;
valueLabel?: string;
/** Figure shown while a field is invalid. */
emptyFigure?: string;
emptyResult?: string;
/** The question the button answers. */
actionQuestion?: string;
actionLabel?: string;
/** Price line, e.g. "Just $39 a month". Hidden when empty. */
price?: string;
/** The value in words beside the price. */
priceNote?: string;
/** One short reassurance line under the price. Hidden when empty. */
reassurance?: string;
/** {n} is replaced. */
sliderMinLabel?: string;
/** {n} is replaced. */
sliderMaxLabel?: string;
currency?: string;
locale?: string;
/** Draw the angled edge into the next (surface) section. */
showEdge?: boolean;
href?: string;
onAction?: (estimate: TimeBackEstimate) => void;
state?: "default" | "hover" | "active" | "disabled" | "error";
className?: string;
};
export function TimeBackCalculator(props: TimeBackCalculatorProps) {
const {
headline = "See the hours you get back every year",
lead = "Set your real week. The estimate updates as you move the slider.",
label = "Hours a week each person spends on this task",
unit = "hours a week",
hoursMin = 1,
hoursMax = 40,
hoursStep = 1,
defaultHours = 10,
defaultTeamSize = 3,
defaultHourlyValue = 50,
teamLabel = "People on this task",
teamPlaceholder = "3",
teamMax = 500,
hourlyLabel = "Hourly value of their time",
hourlyPlaceholder = "50",
hourlyMax = 1000,
teamError = "Enter a team size from 1 to {max}.",
hourlyError = "Enter an hourly value from 1 to {max}.",
automationShare = 0.6,
assumption = "Assumes {percent}% of this work is automated, across {weeks} working weeks a year.",
estimateLabel = "Estimate only.",
weeksPerYear = 48,
workWeekHours = 40,
weeksHeading = "That's {weeks} work weeks back in your year",
weeksOverflowHeading = "That's more than a whole year back: {weeks} work weeks across your team",
weeksEmptyHeading = "Add your team size to see your year fill up",
weeksLegend = "One square = one {hours}-hour work week",
weeksAriaLabel = "{weeks} of {total} work weeks returned",
resultHeading = "Here's the time you win back each year",
hoursUnit = "hours back a year",
valueLabel = "of time back at your hourly value",
emptyFigure = "—",
emptyResult = "Fill in both fields to see your estimate.",
actionQuestion = "Ready to take those hours back?",
actionLabel = "I'm ready, show me how",
price = "",
priceNote = "",
reassurance = "",
sliderMinLabel = "{n} hr",
sliderMaxLabel = "{n} hrs",
currency = "USD",
locale = "en-US",
showEdge = true,
href,
onAction,
state = "default",
className = "",
} = props;
const uid = React.useId();
const ids = {
range: `${uid}-range`,
team: `${uid}-team`,
hourly: `${uid}-hourly`,
teamErr: `${uid}-team-error`,
hourlyErr: `${uid}-hourly-error`,
};
const [hours, setHours] = React.useState(() => clamp(defaultHours, hoursMin, hoursMax));
const [teamText, setTeamText] = React.useState(state === "error" ? "0" : String(defaultTeamSize));
const [hourlyText, setHourlyText] = React.useState(String(defaultHourlyValue));
const [touched, setTouched] = React.useState({ team: state === "error", hourly: state === "error" });
const teamRef = React.useRef<HTMLInputElement>(null);
const hourlyRef = React.useRef<HTMLInputElement>(null);
const fmt = React.useMemo(() => {
const whole = new Intl.NumberFormat(locale, { maximumFractionDigits: 0 });
const oneDp = new Intl.NumberFormat(locale, { maximumFractionDigits: 1 });
let money: Intl.NumberFormat;
try {
money = new Intl.NumberFormat(locale, { style: "currency", currency, minimumFractionDigits: 0, maximumFractionDigits: 0 });
} catch {
money = whole;
}
const symbol = money.formatToParts(0).find((part) => part.type === "currency")?.value ?? "";
return { whole, oneDp, money, symbol };
}, [locale, currency]);
const team = parseNumber(teamText);
const hourly = parseNumber(hourlyText);
const teamOk = Number.isInteger(team) && team >= 1 && team <= teamMax;
const hourlyOk = Number.isFinite(hourly) && hourly >= 1 && hourly <= hourlyMax;
const share = clamp(automationShare, 0, 1);
const exactHours = teamOk ? hours * team * weeksPerYear * share : 0;
const hoursBack = Math.round(exactHours);
const valueBack = teamOk && hourlyOk ? Math.round(hoursBack * hourly) : 0;
const weeksBack = workWeekHours > 0 ? exactHours / workWeekHours : 0;
const total = 52;
const hoursText = teamOk ? fmt.whole.format(hoursBack) : emptyFigure;
const valueText = teamOk && hourlyOk ? fmt.money.format(valueBack) : emptyFigure;
const weeksText = fmt.oneDp.format(weeksBack);
const weeksTitle = !teamOk
? weeksEmptyHeading
: fill(weeksBack > total ? weeksOverflowHeading : weeksHeading, { weeks: weeksText });
const cells = Array.from({ length: total }, (_, i) => clamp(weeksBack - i, 0, 1));
const pct = ((hours - hoursMin) / Math.max(1, hoursMax - hoursMin)) * 100;
const isDisabled = state === "disabled";
const showTeamError = touched.team && !teamOk;
const showHourlyError = touched.hourly && !hourlyOk;
const estimate: TimeBackEstimate = {
hoursPerWeek: hours,
teamSize: teamOk ? team : 0,
hourlyValue: hourlyOk ? hourly : 0,
hoursBack,
valueBack,
weeksBack: Math.round(weeksBack * 10) / 10,
};
const handleAction = (event: React.MouseEvent<HTMLElement>) => {
if (isDisabled) {
event.preventDefault();
return;
}
if (!teamOk || !hourlyOk) {
event.preventDefault();
setTouched({ team: true, hourly: true });
(teamOk ? hourlyRef : teamRef).current?.focus();
return;
}
onAction?.(estimate);
};
const buttonClass = `tbc-btn${state === "hover" ? " is-hover" : ""}${state === "active" ? " is-active" : ""}`;
const button =
href && !isDisabled ? (
<a className={buttonClass} href={href} onClick={handleAction}>
{actionLabel}
</a>
) : (
<button type="button" className={buttonClass} onClick={handleAction} disabled={isDisabled}>
{actionLabel}
</button>
);
return (
<section
className={`cf-time-back-calculator${showEdge ? " has-edge" : ""}${className ? ` ${className}` : ""}`}
style={FX_HOST}
>
<style>{CSS}</style>
<Texture src={topo} tone="band-ink" />
<div className="tbc-inner">
<header className="tbc-head">
<h2 className="tbc-h2">{headline}</h2>
{lead ? <p className="tbc-lead">{lead}</p> : null}
</header>
<div className="tbc-grid">
<div className="tbc-tile tbc-weeks" style={vars({ "--d": 0 })}>
<div className="tbc-weeks-top">
<h3 className="tbc-sub">{weeksTitle}</h3>
<p className="tbc-legend">
<span className="tbc-swatch" aria-hidden="true" />
{fill(weeksLegend, { hours: fmt.whole.format(workWeekHours) })}
</p>
</div>
<div
className="tbc-cells"
role="img"
aria-label={fill(weeksAriaLabel, { weeks: teamOk ? weeksText : "0", total })}
>
{cells.map((f, i) => (
<span key={i} className="tbc-cell" style={vars({ "--i": i, "--f": f })}>
<i />
</span>
))}
</div>
</div>
<div className="tbc-tile tbc-input" style={vars({ "--d": 1 })}>
<label className="tbc-sub" htmlFor={ids.range}>
{label}
</label>
<p className="tbc-readout" aria-hidden="true">
<span className="tbc-n">{fmt.whole.format(hours)}</span>
<span className="tbc-u">{unit}</span>
</p>
<input
id={ids.range}
className="tbc-range"
type="range"
min={hoursMin}
max={hoursMax}
step={hoursStep}
value={hours}
aria-valuetext={`${fmt.whole.format(hours)} ${unit}`}
onChange={(event) => setHours(Number(event.target.value))}
style={vars({ "--pct": `${pct}%` })}
/>
<div className="tbc-ends" aria-hidden="true">
<span>{fill(sliderMinLabel, { n: hoursMin })}</span>
<span>{fill(sliderMaxLabel, { n: hoursMax })}</span>
</div>
<hr className="tbc-rule" />
<div className="tbc-fields">
<Field
id={ids.team}
errorId={ids.teamErr}
label={teamLabel}
value={teamText}
placeholder={teamPlaceholder}
inputMode="numeric"
error={fill(teamError, { max: fmt.whole.format(teamMax) })}
showError={showTeamError}
inputRef={teamRef}
onChange={setTeamText}
onBlur={() => setTouched((t) => ({ ...t, team: true }))}
/>
<Field
id={ids.hourly}
errorId={ids.hourlyErr}
label={hourlyLabel}
value={hourlyText}
placeholder={hourlyPlaceholder}
inputMode="decimal"
prefix={fmt.symbol}
error={fill(hourlyError, { max: fmt.whole.format(hourlyMax) })}
showError={showHourlyError}
inputRef={hourlyRef}
onChange={setHourlyText}
onBlur={() => setTouched((t) => ({ ...t, hourly: true }))}
/>
</div>
</div>
<div className="tbc-tile tbc-result" style={vars({ "--d": 2 })}>
<h3 className="tbc-sub">{resultHeading}</h3>
<div className="tbc-figures" aria-live="polite" aria-atomic="true">
<p className="tbc-giant" style={vars({ "--scale": scaleFor(hoursText.length, 5, 7) })}>
{hoursText}
</p>
<p className="tbc-giant-unit">{hoursUnit}</p>
<p className="tbc-value">
<span className="tbc-vnum" style={vars({ "--scale": scaleFor(valueText.length, 8, 10) })}>
{valueText}
</span>
<span className="tbc-vlbl">{valueLabel}</span>
</p>
</div>
{!teamOk || !hourlyOk ? <p className="tbc-empty">{emptyResult}</p> : null}
<p className="tbc-note">
<Info size={16} strokeWidth={2.5} aria-hidden="true" />
<strong>{estimateLabel}</strong>{" "}
{fill(assumption, { percent: fmt.whole.format(share * 100), weeks: fmt.whole.format(weeksPerYear) })}
</p>
<div className="tbc-act">
<p className="tbc-q">{actionQuestion}</p>
{button}
{price ? (
<p className="tbc-price">
<strong>{price}</strong>
{priceNote ? <span>{` · ${priceNote}`}</span> : null}
</p>
) : null}
{reassurance ? (
<p className="tbc-reassure">
<ShieldCheck size={16} strokeWidth={2.5} aria-hidden="true" />
{reassurance}
</p>
) : null}
</div>
</div>
</div>
</div>
{showEdge ? <Divider shape="angle" tone="surface" height={56} /> : null}
</section>
);
}
export default TimeBackCalculator;
function Field({
id,
errorId,
label,
value,
placeholder,
inputMode,
prefix,
error,
showError,
inputRef,
onChange,
onBlur,
}: {
id: string;
errorId: string;
label: string;
value: string;
placeholder: string;
inputMode: "numeric" | "decimal";
prefix?: string;
error: string;
showError: boolean;
inputRef: React.Ref<HTMLInputElement>;
onChange: (value: string) => void;
onBlur: () => void;
}) {
return (
<div className="tbc-field">
<label className="tbc-label" htmlFor={id}>
{label}
</label>
<div className="tbc-control">
{prefix ? (
<span className="tbc-prefix" aria-hidden="true">
{prefix}
</span>
) : null}
<input
ref={inputRef}
id={id}
className="tbc-in"
type="text"
inputMode={inputMode}
autoComplete="off"
value={value}
placeholder={placeholder}
aria-invalid={showError}
aria-describedby={showError ? errorId : undefined}
onChange={(event) => onChange(event.target.value)}
onBlur={onBlur}
style={prefix ? { paddingLeft: `calc(16px + ${prefix.length * 0.7 + 0.5}em)` } : undefined}
/>
</div>
{showError ? (
<p className="tbc-error" id={errorId}>
<CircleAlert size={16} strokeWidth={2.5} aria-hidden="true" />
{error}
</p>
) : null}
</div>
);
}
function clamp(n: number, min: number, max: number) {
return Math.min(max, Math.max(min, n));
}
function parseNumber(text: string): number {
const t = text.replace(/[,\s]/g, "");
if (!/^\d+(\.\d+)?$/.test(t)) return NaN;
return Number(t);
}
function fill(template: string, values: Record<string, string | number>) {
return template.replace(/\{(\w+)\}/g, (match, key: string) => (key in values ? String(values[key]) : match));
}
function scaleFor(length: number, full: number, mid: number) {
if (length <= full) return 1;
if (length <= mid) return 0.78;
return 0.6;
}
function vars(values: Record<string, string | number>) {
return values as React.CSSProperties;
}
const R = ".cf-time-back-calculator";
const SH = "oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h";
const BG = "var(--button-bg, var(--cta, #d9342b))";
const BG2 = "var(--button-bg-2, var(--cta-2, #b8281f))";
const CSS = `
${R}{--tbc-sub:var(--ink,#172033);--tbc-line:oklch(from var(--ink,#172033) l c h / .12);--tbc-well:color-mix(in oklch,var(--ink,#172033) 8%,var(--card,#fff));--tbc-focus:var(--field-focus,var(--accent,#2f5fd0));--tbc-fill:var(--accent-fill,var(--accent,#2f5fd0));position:relative;background:var(--band,#13274a);color:var(--band-ink,#fff);font-family:var(--font-body,system-ui,sans-serif);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px)}
${R}.has-edge{padding-bottom:calc(clamp(64px,8.5vw,120px) + 56px)}
${R} *{box-sizing:border-box}
${R} .tbc-inner{position:relative;z-index:1;max-width:1120px;margin:0 auto}
${R} .tbc-head{max-width:46rem;margin:0 0 clamp(32px,4vw,48px)}
${R} .tbc-h2{margin:0 0 16px;font-family:var(--font-display,system-ui,sans-serif);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;color:var(--band-ink,#fff);text-wrap:balance}
${R} .tbc-lead{margin:0;max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--band-ink,#fff);text-wrap:pretty}
${R} .tbc-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:clamp(16px,2vw,24px)}
${R} .tbc-tile{min-width:0;background:var(--card,#fff);color:var(--ink,#172033);border:1px solid var(--card-border,var(--tbc-line));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-md,0 1px 2px ${SH} / .22),0 4px 10px -2px ${SH} / .2)));padding:clamp(20px,3vw,32px);animation:cf-time-back-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(var(--d,0) * .07s)}
${R} .tbc-weeks{grid-column:1 / -1}
${R} .tbc-input{grid-column:span 7}
${R} .tbc-result{grid-column:span 5;display:flex;flex-direction:column;border-color:color-mix(in oklch,var(--accent,#2f5fd0) 45%,var(--card,#fff));box-shadow:var(--shadow-lg,0 2px 4px ${SH} / .22),0 12px 24px -8px ${SH} / .32))}
${R} .tbc-sub{display:block;margin:0;font-family:var(--font-display,system-ui,sans-serif);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;color:var(--tbc-sub);text-wrap:balance}
${R} .tbc-weeks-top{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:8px 24px;margin:0 0 20px}
${R} .tbc-weeks-top .tbc-sub{flex:1 1 24rem}
${R} .tbc-legend{margin:0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted,#55607a)}
${R} .tbc-swatch{display:inline-block;width:.85em;height:.85em;margin-inline-end:.45em;vertical-align:-0.08em;border-radius:3px;background:var(--tbc-fill)}
${R} .tbc-cells{display:grid;grid-template-columns:repeat(52,minmax(0,1fr));gap:4px}
${R} .tbc-cell{position:relative;display:block;height:64px;border-radius:4px;background:var(--tbc-well);overflow:hidden}
${R} .tbc-cell i{position:absolute;inset:0;background:linear-gradient(oklch(from var(--tbc-fill) calc(l + .04) c h),oklch(from var(--tbc-fill) calc(l - .04) c h));transform-origin:50% 100%;transform:scaleY(var(--f,0));transition:transform .32s cubic-bezier(.2,.7,.2,1);transition-delay:calc(var(--i,0) * 5ms)}
${R} .tbc-readout{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;margin:16px 0 20px}
${R} .tbc-n{font-family:var(--font-display,system-ui,sans-serif);font-weight:var(--display-weight,800);font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--ink,#172033)}
${R} .tbc-u{font-size:clamp(1.125rem,1.5vw,1.375rem);font-weight:500;line-height:1.4;color:var(--muted,#55607a)}
${R} .tbc-range{-webkit-appearance:none;appearance:none;display:block;width:100%;height:32px;margin:0;background:transparent;cursor:pointer}
${R} .tbc-range:focus{outline:none}
${R} .tbc-range::-webkit-slider-runnable-track{height:12px;border-radius:999px;background:linear-gradient(to right,var(--tbc-fill) 0 var(--pct,50%),var(--tbc-well) var(--pct,50%) 100%);box-shadow:inset 0 1px 2px ${SH} / .2)}
${R} .tbc-range::-moz-range-track{height:12px;border-radius:999px;background:var(--tbc-well);box-shadow:inset 0 1px 2px ${SH} / .2)}
${R} .tbc-range::-moz-range-progress{height:12px;border-radius:999px;background:var(--tbc-fill)}
${R} .tbc-range::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:32px;height:32px;margin-top:-10px;border-radius:50%;background:var(--card,#fff);border:4px solid var(--tbc-fill);box-shadow:0 1px 2px ${SH} / .3),0 4px 8px -2px ${SH} / .35);transition:transform .16s ease,box-shadow .16s ease}
${R} .tbc-range::-moz-range-thumb{box-sizing:border-box;width:32px;height:32px;border-radius:50%;background:var(--card,#fff);border:4px solid var(--tbc-fill);box-shadow:0 1px 2px ${SH} / .3),0 4px 8px -2px ${SH} / .35);transition:transform .16s ease,box-shadow .16s ease}
${R} .tbc-range:hover::-webkit-slider-thumb{transform:scale(1.08)}
${R} .tbc-range:hover::-moz-range-thumb{transform:scale(1.08)}
${R} .tbc-range:active::-webkit-slider-thumb{transform:scale(.96)}
${R} .tbc-range:active::-moz-range-thumb{transform:scale(.96)}
${R} .tbc-range:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 4px oklch(from var(--tbc-focus) l c h / .4),0 1px 2px ${SH} / .3)}
${R} .tbc-range:focus-visible::-moz-range-thumb{box-shadow:0 0 0 4px oklch(from var(--tbc-focus) l c h / .4),0 1px 2px ${SH} / .3)}
${R} .tbc-ends{display:flex;justify-content:space-between;gap:12px;margin-top:8px;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted,#55607a)}
${R} .tbc-rule{height:1px;margin:28px 0 24px;border:0;background:var(--tbc-line)}
${R} .tbc-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px;align-items:start}
${R} .tbc-label{display:block;margin:0 0 8px;font-size:1.0625rem;font-weight:700;line-height:1.3;color:var(--label-ink,var(--ink,#172033))}
${R} .tbc-control{position:relative}
${R} .tbc-prefix{position:absolute;left:16px;top:50%;transform:translateY(-50%);font-size:1.0625rem;font-weight:700;color:var(--field-ink,#172033);pointer-events:none}
${R} .tbc-in{display:block;width:100%;height:56px;margin:0;padding:0 16px;font:inherit;font-size:1.0625rem;font-weight:600;font-variant-numeric:tabular-nums;color:var(--field-ink,#172033);background:var(--field,#fff);border:1px solid var(--field-border,color-mix(in oklch,var(--ink,#172033) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));transition:border-color .16s ease,box-shadow .16s ease}
${R} .tbc-in::placeholder{color:color-mix(in oklch,var(--field-ink,#172033) 65%,var(--field,#fff));opacity:1}
${R} .tbc-in:hover{border-color:color-mix(in oklch,var(--field-ink,#172033) 45%,var(--field,#fff))}
${R} .tbc-in:focus{outline:none;border-color:var(--tbc-focus);box-shadow:0 0 0 3px oklch(from var(--tbc-focus) l c h / .35)}
${R} .tbc-in[aria-invalid="true"]{border-color:var(--danger,#c0392b)}
${R} .tbc-in[aria-invalid="true"]:focus{box-shadow:0 0 0 3px oklch(from var(--danger,#c0392b) l c h / .3)}
${R} .tbc-error{margin:8px 0 0;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--danger,#c0392b);text-wrap:pretty}
${R} .tbc-error svg,${R} .tbc-note svg,${R} .tbc-reassure svg{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em}
${R} .tbc-figures{margin-top:20px}
${R} .tbc-giant{margin:0;white-space:nowrap;font-family:var(--font-display,system-ui,sans-serif);font-weight:var(--display-weight,800);font-size:calc(clamp(3.5rem,7.2vw,6rem) * var(--scale,1));line-height:.95;letter-spacing:-0.04em;font-variant-numeric:tabular-nums;color:var(--ink,#172033)}
${R} .tbc-giant-unit{margin:12px 0 0;font-size:clamp(1.125rem,1.5vw,1.375rem);font-weight:700;line-height:1.4;color:var(--ink,#172033)}
${R} .tbc-value{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;margin:20px 0 0}
${R} .tbc-vnum{white-space:nowrap;font-family:var(--font-display,system-ui,sans-serif);font-weight:var(--display-weight,800);font-size:calc(clamp(2.5rem,4.2vw,3.75rem) * var(--scale,1));line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--accent,#2f5fd0)}
${R} .tbc-vlbl{font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:600;line-height:1.5;color:var(--muted,#55607a);text-wrap:pretty}
${R} .tbc-empty{margin:16px 0 0;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--ink,#172033)}
${R} .tbc-note{margin:20px 0 0;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted,#55607a);text-wrap:pretty}
${R} .tbc-note svg{color:var(--accent,#2f5fd0)}
${R} .tbc-note strong{font-weight:700;color:var(--ink,#172033)}
${R} .tbc-act{margin-top:auto;padding-top:28px}
${R} .tbc-act::before{content:"";display:block;height:1px;margin:0 0 24px;background:var(--tbc-line)}
${R} .tbc-q{margin:0 0 16px;font-family:var(--font-display,system-ui,sans-serif);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;color:var(--ink,#172033);text-wrap:balance}
${R} .tbc-btn{display:flex;align-items:center;justify-content:center;width:100%;min-height:64px;margin:0;padding:12px 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));font-family:var(--button-font,var(--font-display,system-ui,sans-serif));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;text-align:center;text-decoration:none;text-wrap:balance;color:var(--button-ink,var(--cta-ink,#fff));text-shadow:var(--button-text-shadow,none);cursor:pointer;background:linear-gradient(oklch(from ${BG} calc(l + .04) c h),oklch(from ${BG2} calc(l - .02) c h));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 ${SH} / .3),0 8px 16px -6px ${SH} / .45));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
${R} .tbc-btn:hover,${R} .tbc-btn.is-hover{transform:translateY(-1px);background:linear-gradient(oklch(from ${BG} calc(l - .01) c h),oklch(from ${BG2} calc(l - .07) c h));box-shadow:inset 0 1px 0 oklch(from ${BG} calc(l + .12) c h / .7),inset 0 -3px 0 oklch(from ${BG} calc(l - .2) c h),0 1px 2px ${SH} / .32),0 12px 20px -6px ${SH} / .5)}
${R} .tbc-btn:active,${R} .tbc-btn.is-active{transform:translateY(1px);background:linear-gradient(oklch(from ${BG} calc(l - .05) c h),oklch(from ${BG2} calc(l - .1) c h));box-shadow:inset 0 2px 4px oklch(from ${BG} calc(l - .22) c h / .45),inset 0 -2px 0 oklch(from ${BG} calc(l - .2) c h),0 1px 1px ${SH} / .3)}
${R} .tbc-btn:focus-visible{outline:3px solid var(--tbc-focus);outline-offset:3px}
${R} .tbc-btn:disabled{cursor:not-allowed;transform:none;color:var(--muted,#55607a);text-shadow:none;background:color-mix(in oklch,var(--ink,#172033) 10%,var(--card,#fff));box-shadow:none}
${R} .tbc-price{margin:16px 0 0;text-align:center;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--muted,#55607a);text-wrap:pretty}
${R} .tbc-price strong{font-family:var(--font-display,system-ui,sans-serif);font-weight:var(--display-weight,800);font-size:clamp(1.125rem,1.5vw,1.375rem);color:var(--ink,#172033)}
${R} .tbc-reassure{margin:8px 0 0;text-align:center;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted,#55607a);text-wrap:pretty}
${R} .tbc-reassure svg{color:var(--success,#2f7d4a)}
@keyframes cf-time-back-rise{from{opacity:.82;transform:translateY(8px)}}
@media (max-width:959px){${R} .tbc-input,${R} .tbc-result{grid-column:1 / -1}${R} .tbc-cells{grid-template-columns:repeat(26,minmax(0,1fr))}${R} .tbc-cell{height:44px}}
@media (max-width:599px){${R} .tbc-cells{grid-template-columns:repeat(13,minmax(0,1fr));gap:5px}${R} .tbc-cell{height:auto;aspect-ratio:1 / 1.1}${R} .tbc-fields{grid-template-columns:1fr}${R} .tbc-weeks-top .tbc-sub{flex-basis:100%}}
@media (prefers-reduced-motion:reduce){${R} .tbc-tile{animation:none}${R} .tbc-cell i,${R} .tbc-btn,${R} .tbc-in{transition:none}${R} .tbc-range::-webkit-slider-thumb{transition:none}${R} .tbc-range::-moz-range-thumb{transition:none}${R} .tbc-btn:hover,${R} .tbc-btn.is-hover,${R} .tbc-btn:active,${R} .tbc-btn.is-active{transform:none}}
`;
pieces/content/time-back-calculator/specimen.tsx 33 lines
import TimeBackCalculator, { type TimeBackCalculatorProps } from "../time-back-calculator";
import defaults from "../../studio-defaults.json";
export const states = ["default", "hover", "active", "disabled", "error"];
export default function TimeBackCalculatorSpecimen({ state }: { state?: TimeBackCalculatorProps["state"] }) {
return (
<TimeBackCalculator
state={state}
headline="How many weeks of your year go to bookkeeping?"
lead="Set your team's real week. Ledgerline estimates the hours, the money and the full weeks you get back."
label="Hours a week each person spends on bookkeeping"
unit="hours a week"
defaultHours={8}
defaultTeamSize={3}
defaultHourlyValue={55}
teamLabel="People doing the books"
teamPlaceholder="3"
hourlyLabel="Hourly value of their time"
hourlyPlaceholder="55"
automationShare={0.6}
assumption="Assumes Ledgerline automates {percent}% of this work, across {weeks} working weeks a year."
resultHeading="Here's what Ledgerline hands back each year"
valueLabel="of time back at your hourly value"
actionQuestion="Ready to stop losing weeks to receipts and reconciling?"
actionLabel="I'm ready, show me how"
price="Just $39 a month"
priceNote="less than one hour of bookkeeping help"
reassurance={defaults.sample.guarantee}
onAction={() => {}}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalTimeBackCalculator |
React.ReactNode |
|
lead OptionalTimeBackCalculator |
React.ReactNode |
|
label OptionalTimeBackCalculator |
string |
|
unit OptionalTimeBackCalculator |
string |
|
hoursMin OptionalTimeBackCalculator |
number |
|
hoursMax OptionalTimeBackCalculator |
number |
|
hoursStep OptionalTimeBackCalculator |
number |
|
defaultHours OptionalTimeBackCalculator |
number |
|
defaultTeamSize OptionalTimeBackCalculator |
number |
|
defaultHourlyValue OptionalTimeBackCalculator |
number |
|
teamLabel OptionalTimeBackCalculator |
string |
|
teamPlaceholder OptionalTimeBackCalculator |
string |
|
teamMax OptionalTimeBackCalculator |
number |
|
hourlyLabel OptionalTimeBackCalculator |
string |
|
hourlyPlaceholder OptionalTimeBackCalculator |
string |
|
hourlyMax OptionalTimeBackCalculator |
number |
|
teamError OptionalTimeBackCalculator |
string |
|
hourlyError OptionalTimeBackCalculator |
string |
|
automationShare OptionalTimeBackCalculator |
number |
|
assumption OptionalTimeBackCalculator |
string |
|
estimateLabel OptionalTimeBackCalculator |
string |
|
weeksPerYear OptionalTimeBackCalculator |
number |
|
workWeekHours OptionalTimeBackCalculator |
number |
|
weeksHeading OptionalTimeBackCalculator |
string |
|
weeksOverflowHeading OptionalTimeBackCalculator |
string |
|
weeksEmptyHeading OptionalTimeBackCalculator |
string |
|
weeksLegend OptionalTimeBackCalculator |
string |
|
weeksAriaLabel OptionalTimeBackCalculator |
string |
|
resultHeading OptionalTimeBackCalculator |
string |
|
hoursUnit OptionalTimeBackCalculator |
string |
|
valueLabel OptionalTimeBackCalculator |
string |
|
emptyFigure OptionalTimeBackCalculator |
string |
|
emptyResult OptionalTimeBackCalculator |
string |
|
actionQuestion OptionalTimeBackCalculator |
string |
|
actionLabel OptionalTimeBackCalculator |
string |
|
price OptionalTimeBackCalculator |
string |
|
priceNote OptionalTimeBackCalculator |
string |
|
reassurance OptionalTimeBackCalculator |
string |
|
sliderMinLabel OptionalTimeBackCalculator |
string |
|
sliderMaxLabel OptionalTimeBackCalculator |
string |
|
currency OptionalTimeBackCalculator |
string |
|
locale OptionalTimeBackCalculator |
string |
|
showEdge OptionalTimeBackCalculator |
boolean |
|
href OptionalTimeBackCalculator |
string |
|
onAction OptionalTimeBackCalculator |
(estimate: TimeBackEstimate) => void |
|
state OptionalTimeBackCalculator |
"default" | "hover" | "active" | "disabled" | "error" |
|
className OptionalTimeBackCalculator |
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.
--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.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
This piece reads no image slots.
-
a57ca5c86a05001f.webp
image/webp · 108 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB