Impact Stats 2
Impact route: the year's supplied milestones drawn as a road across the band. The road ends at an open next stop that holds the give action, so every past result points at today's gift.
Use it in a prompt
Use proof/impact-stats-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/proof/impact-stats-2.tsx. - Import it and pass your copy and images (Props tab):
import { ImpactStats2 } from "@/components/funneldna/proof/impact-stats-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/proof/impact-stats-2/component.tsx 679 lines
// layout: magazine-spread
// Impact route: the year's supplied milestones drawn as a road across the band. The road ends at an open next stop that holds the give action, so every past result points at today's gift.
import * as React from 'react';
import { Flag, Lock } from 'lucide-react';
import { FX_HOST, Spot, Texture } from '../fx/fx';
import topo from '../fx/textures/topo';
export type ImpactStats2Milestone = {
/** When it happened, e.g. 'February' */
month: string;
/** The supplied figure, e.g. '18' or '$31k' */
number: string;
/** What happened, one short line */
label: string;
/** Spot illustration asset (import from ../fx/spots/<name>), set beside the stop */
spot?: string;
};
export type ImpactStats2Goal = {
/** The next stop, e.g. '300 animals home by spring' */
title: string;
/** Raised so far as a plain amount ('$6,200'), shown with target */
raised?: string;
/** The goal amount ('$10,000') */
target?: string;
/** 0 to 1. Wins over raised/target. Supply none of the three to show no progress line */
progress?: number;
};
export type ImpactStats2Copy = {
/** Accessible name of the route list */
routeLabel: string;
/** Prefix in front of the goal title */
nextStop: string;
/** Card heading when no goal is supplied */
nextStopHeading: string;
/** Joins the two amounts: '{raised} raised of {target}' */
raisedOf: string;
/** Used when only progress is supplied. {percent} is replaced */
percentTemplate: string;
/** Accessible name of the progress bar */
progressLabel: string;
};
export type ImpactStats2Props = {
/** Section headline. A string can carry one highlighted phrase */
headline?: React.ReactNode;
/** Phrase inside the headline that gets the marker swipe */
highlight?: string;
/** The mission line */
lead?: React.ReactNode;
body?: React.ReactNode;
/** Large pull line built from a supplied fact */
pull?: { figure?: string; text: string };
/** Photo for the scene slot */
photo?: string;
photoAlt?: string;
photoCaption?: string;
/** One stop per supplied milestone. Leave it empty to show only the mission and the action */
milestones?: ImpactStats2Milestone[];
goal?: ImpactStats2Goal;
/** Future-pacing line inside the next-stop card */
pacing?: string;
/** Suggested gift, e.g. '$25'. Leave it out and no amount shows */
amount?: string;
amountNote?: string;
/** What the amount does, set beside the figure */
amountLine?: string;
label?: string;
reassurance?: string;
href?: string;
onAction?: () => void;
/** Called with the stop index when a stop is pressed */
onStopSelect?: (index: number) => void;
disabled?: boolean;
state?: 'default' | 'hover' | 'active' | 'disabled';
copy?: Partial<ImpactStats2Copy>;
className?: string;
};
export function ImpactStats2(props: ImpactStats2Props) {
const {
headline = 'One year on the road, one stop at a time',
highlight = 'one stop at a time',
lead = 'Here’s every stop we reached this year, and the next one we’re driving toward.',
body,
pull,
photo,
photoAlt = '',
photoCaption,
milestones = [],
goal,
pacing = 'The road isn’t finished. Your gift decides how far it goes next.',
amount,
amountNote = 'one-time gift',
amountLine,
label = 'Fund the next stop',
reassurance = 'Secure checkout · Takes about a minute',
href,
onAction,
onStopSelect,
disabled = false,
state = 'default',
className,
} = props;
const copy: ImpactStats2Copy = { ...COPY, ...props.copy };
const uid = React.useId();
const headId = `${uid}-headline`;
const count = milestones.length;
const hasRoute = count > 0;
const isDisabled = disabled || state === 'disabled';
const progress = goalProgress(goal);
const pct = progress !== null ? Math.round(progress * 100) : 0;
const price = splitPrice(amount);
const sectionRef = React.useRef<HTMLElement>(null);
const mapRef = React.useRef<HTMLDivElement>(null);
const dotRefs = React.useRef<Array<HTMLSpanElement | null>>([]);
const [geo, setGeo] = React.useState<RouteGeo | null>(null);
const [drawn, setDrawn] = React.useState(false);
const [hovered, setHovered] = React.useState<number | null>(null);
const [focused, setFocused] = React.useState<number | null>(null);
const [pinned, setPinned] = React.useState<number | null>(null);
const forced = hasRoute && (state === 'hover' || state === 'active') ? Math.min(1, count - 1) : null;
const current = hovered ?? focused ?? pinned ?? forced;
useIsoLayoutEffect(() => {
if (!hasRoute) return;
const wrap = mapRef.current;
if (!wrap) return;
let cancelled = false;
const measure = () => {
if (cancelled) return;
const box = wrap.getBoundingClientRect();
const pts: Pt[] = [];
for (let i = 0; i <= count; i++) {
const el = dotRefs.current[i];
if (!el) return;
const r = el.getBoundingClientRect();
pts.push({ x: r.left + r.width / 2 - box.left, y: r.top + r.height / 2 - box.top });
}
setGeo(buildRoute(pts, box.width, box.height, progress));
};
measure();
const ro = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(measure) : null;
ro?.observe(wrap);
document.fonts?.ready.then(measure).catch(() => undefined);
return () => {
cancelled = true;
ro?.disconnect();
};
}, [hasRoute, count, progress]);
React.useEffect(() => {
const target = mapRef.current ?? sectionRef.current;
if (!target) return;
const reduce = typeof window.matchMedia === 'function' && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
if (reduce || typeof IntersectionObserver === 'undefined') {
setDrawn(true);
return;
}
const io = new IntersectionObserver(
(entries) => {
if (entries.some((e) => e.isIntersecting)) {
setDrawn(true);
io.disconnect();
}
},
{ threshold: 0.15 },
);
io.observe(target);
return () => io.disconnect();
}, [hasRoute]);
const dur = geo ? 0.6 + 1.8 * geo.done : 0;
const delayFor = (i: number) => (geo && geo.done > 0 ? Math.min(dur, (dur * geo.stops[i]) / geo.done) : 0);
const barDelay = geo && geo.done > 0 ? (dur * geo.lastAt) / geo.done : 0;
const doneOff = geo ? Math.round(1000 - geo.done * 1000) : 1000;
const btnCls = `isr-cta${state === 'hover' ? ' is-hover' : ''}${state === 'active' ? ' is-press' : ''}`;
const action =
href && !isDisabled ? (
<a className={btnCls} href={href} onClick={onAction ? () => onAction() : undefined}>
{label}
</a>
) : (
<button type='button' className={btnCls} disabled={isDisabled} onClick={() => onAction?.()}>
{label}
</button>
);
const card = (
<div className='isr-card'>
<h3 className='isr-card-title'>
{goal ? (
<>
<span className='isr-next'>{copy.nextStop}</span> {goal.title}
</>
) : (
copy.nextStopHeading
)}
</h3>
{pacing ? <p className='isr-pacing'>{pacing}</p> : null}
{progress !== null ? (
<div className='isr-progress'>
<div className='isr-bar' role='progressbar' aria-label={copy.progressLabel} aria-valuemin={0} aria-valuemax={100} aria-valuenow={pct}>
<span style={vars({ '--p': progress, '--p-now': drawn ? progress : 0, '--p-delay': `${barDelay}s` })} />
</div>
<p className='isr-raised'>
{goal && goal.raised && goal.target ? (
<>
<strong>{goal.raised}</strong> {copy.raisedOf} {goal.target}
</>
) : (
copy.percentTemplate.replace('{percent}', String(pct))
)}
</p>
</div>
) : null}
{price ? (
<div className='isr-amount'>
<p className='isr-amt'>
<span className='isr-fig'>
{price.symbol ? <sup>{price.symbol}</sup> : null}
{price.figure}
</span>
{amountNote ? <span className='isr-amt-note'>{amountNote}</span> : null}
</p>
{amountLine ? <p className='isr-amt-line'>{amountLine}</p> : null}
</div>
) : null}
{action}
{reassurance ? (
<p className='isr-reassure'>
<Lock className='isr-lock' size={16} strokeWidth={2.5} aria-hidden='true' />
{reassurance}
</p>
) : null}
</div>
);
const spreadCls = `isr-spread${photo ? ' has-photo' : ''}${pull ? '' : ' no-pull'}`;
return (
<section ref={sectionRef} className={`cf-impact-stats-2${className ? ` ${className}` : ''}`} style={FX_HOST} aria-labelledby={headId}>
<Texture src={topo} tone='band-ink' />
<style>{CSS}</style>
<div className='isr-inner'>
{hasRoute ? (
<>
<div className={spreadCls}>
<h2 id={headId} className='isr-h'>
{withHighlight(headline, highlight)}
</h2>
{lead || body ? (
<div className='isr-story'>
{lead ? <p className='isr-lead'>{lead}</p> : null}
{body ? <p className='isr-body'>{body}</p> : null}
</div>
) : null}
{pull ? (
<p className='isr-pull'>
{pull.figure ? <span className='isr-pull-fig'>{pull.figure}</span> : null}
<span className='isr-pull-text'>{pull.text}</span>
</p>
) : null}
{photo ? (
<figure className='isr-photo'>
<img src={photo} alt={photoAlt} width={800} height={1000} loading='lazy' decoding='async' />
{photoCaption ? <figcaption>{photoCaption}</figcaption> : null}
</figure>
) : null}
</div>
<div className='isr-map' ref={mapRef}>
{geo ? (
<svg className='isr-svg' width={geo.w} height={geo.h} viewBox={`0 0 ${geo.w} ${geo.h}`} aria-hidden='true' focusable='false'>
<path className='isr-track' d={geo.d} />
<path className='isr-ink' d={geo.d} pathLength={1000} style={vars({ '--off': drawn ? doneOff : 1000, '--done': doneOff, '--dur': `${dur}s` })} />
</svg>
) : null}
<ol className='isr-route' aria-label={copy.routeLabel} style={vars({ '--n': count })}>
{milestones.map((m, i) => {
const on = current === i;
return (
<li
key={`${m.month}-${i}`}
className='isr-stop'
data-side={i % 2 ? 'below' : 'above'}
data-reached={drawn ? '' : undefined}
style={vars({ '--delay': `${delayFor(i)}s` })}
>
<button
type='button'
className={`isr-stop-btn${on ? ' is-on' : ''}`}
aria-pressed={pinned === i}
onMouseEnter={() => setHovered(i)}
onMouseLeave={() => setHovered(null)}
onFocus={() => setFocused(i)}
onBlur={() => setFocused(null)}
onClick={() => {
setPinned((p) => (p === i ? null : i));
onStopSelect?.(i);
}}
>
<span className='isr-text'>
<span className='isr-month'>{m.month}</span>{' '}
<span className='isr-num'>{m.number}</span>{' '}
<span className='isr-label'>{m.label}</span>
</span>
<span
className='isr-dot'
aria-hidden='true'
ref={(el) => {
dotRefs.current[i] = el;
}}
/>
{m.spot ? (
<span className='isr-spot' aria-hidden='true'>
<Spot src={m.spot} size={64} shade='band' light='band-ink' />
</span>
) : null}
</button>
</li>
);
})}
<li className='isr-goal'>
<span
className='isr-goal-dot'
aria-hidden='true'
ref={(el) => {
dotRefs.current[count] = el;
}}
>
<Flag size={20} strokeWidth={2.5} />
</span>
{card}
</li>
</ol>
</div>
</>
) : (
<div className='isr-solo'>
<div className='isr-solo-copy'>
<h2 id={headId} className='isr-h'>
{withHighlight(headline, highlight)}
</h2>
{lead ? <p className='isr-lead'>{lead}</p> : null}
</div>
{card}
</div>
)}
</div>
</section>
);
}
export default ImpactStats2;
const COPY: ImpactStats2Copy = {
routeLabel: 'Our year on the road',
nextStop: 'Next stop:',
nextStopHeading: 'Help us reach the next stop',
raisedOf: 'raised of',
percentTemplate: '{percent}% of the way there',
progressLabel: 'Raised toward the next stop',
};
const useIsoLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
type Pt = { x: number; y: number };
type RouteGeo = { w: number; h: number; d: string; done: number; lastAt: number; stops: number[] };
// Builds a smooth road through every stop centre (horizontal on wide screens, vertical on phones).
// It also works out how far along the road each stop sits and where the drawn line ends.
function buildRoute(points: Pt[], w: number, h: number, progress: number | null): RouteGeo {
const first = points[0];
const last = points[points.length - 1];
const horizontal = Math.abs(last.x - first.x) > Math.abs(last.y - first.y);
const all: Pt[] = [horizontal ? { x: 0, y: first.y } : { x: first.x, y: 0 }, ...points];
let d = `M${fix(all[0].x)} ${fix(all[0].y)}`;
const cum = [0];
for (let i = 1; i < all.length; i++) {
const a = all[i - 1];
const b = all[i];
const c1 = horizontal ? { x: (a.x + b.x) / 2, y: a.y } : { x: a.x, y: (a.y + b.y) / 2 };
const c2 = horizontal ? { x: (a.x + b.x) / 2, y: b.y } : { x: b.x, y: (a.y + b.y) / 2 };
d += ` C${fix(c1.x)} ${fix(c1.y)} ${fix(c2.x)} ${fix(c2.y)} ${fix(b.x)} ${fix(b.y)}`;
cum.push(cum[i - 1] + curveLength(a, c1, c2, b));
}
const total = cum[cum.length - 1] || 1;
const lastStop = cum[cum.length - 2];
const done = (lastStop + (progress ?? 0) * (total - lastStop)) / total;
return { w: Math.round(w), h: Math.round(h), d, done, lastAt: lastStop / total, stops: cum.slice(1).map((c) => c / total) };
}
function curveLength(a: Pt, b: Pt, c: Pt, e: Pt) {
let len = 0;
let px = a.x;
let py = a.y;
for (let s = 1; s <= 24; s++) {
const t = s / 24;
const u = 1 - t;
const x = u * u * u * a.x + 3 * u * u * t * b.x + 3 * u * t * t * c.x + t * t * t * e.x;
const y = u * u * u * a.y + 3 * u * u * t * b.y + 3 * u * t * t * c.y + t * t * t * e.y;
len += Math.hypot(x - px, y - py);
px = x;
py = y;
}
return len;
}
function fix(n: number) {
return Math.round(n * 10) / 10;
}
function goalProgress(goal?: ImpactStats2Goal): number | null {
if (!goal) return null;
if (typeof goal.progress === 'number' && Number.isFinite(goal.progress)) return Math.min(1, Math.max(0, goal.progress));
const raised = toAmount(goal.raised);
const target = toAmount(goal.target);
if (raised !== null && target !== null && target > 0) return Math.min(1, Math.max(0, raised / target));
return null;
}
function toAmount(value?: string): number | null {
if (!value) return null;
const n = parseFloat(value.replace(/[^0-9.]/g, ''));
if (!Number.isFinite(n)) return null;
const unit = value.trim().slice(-1).toLowerCase();
return n * (unit === 'k' ? 1e3 : unit === 'm' ? 1e6 : 1);
}
function splitPrice(amount?: string) {
if (!amount) return null;
const m = /^([^0-9]*)([0-9].*)$/.exec(amount.trim());
return m ? { symbol: m[1].trim(), figure: m[2] } : { symbol: '', figure: amount };
}
function withHighlight(text: React.ReactNode, phrase?: string): React.ReactNode {
if (typeof text !== 'string' || !phrase) return text;
const at = text.indexOf(phrase);
if (at < 0) return text;
return (
<>
{text.slice(0, at)}
<span className='isr-hl'>{phrase}</span>
{text.slice(at + phrase.length)}
</>
);
}
function vars(v: Record<string, string | number>): React.CSSProperties {
return v as React.CSSProperties;
}
// Marker exception: --marker keeps the library's yellow highlighter default. --marker-ink is the dark ink that
// stays readable on that yellow on any band. Both are hex only as var() fallbacks.
const CSS = `
.cf-impact-stats-2 {
--isr-soft: color-mix(in oklab, var(--band-ink) 84%, var(--band));
--isr-line: oklch(from var(--band-ink) l c h / 0.24);
--isr-plate: oklch(from var(--band-ink) l c h / 0.1);
--isr-shadow: var(--shadow, oklch(0.22 0.03 260));
background: var(--band);
color: var(--band-ink);
font-family: var(--font-body);
padding: clamp(56px, 8vw, 112px) clamp(16px, 5vw, 48px) clamp(64px, 8.5vw, 120px);
}
.cf-impact-stats-2, .cf-impact-stats-2 * { box-sizing: border-box; }
.cf-impact-stats-2 .isr-inner { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; }
.cf-impact-stats-2 .isr-spread { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px clamp(24px, 3vw, 40px); }
.cf-impact-stats-2 .isr-h {
margin: 0; color: var(--band-ink); font-family: var(--font-display);
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.1; text-wrap: balance;
}
.cf-impact-stats-2 .isr-hl {
--isr-mk: oklch(from var(--marker, #fae37c) max(l, 0.88) c h / 1);
color: var(--marker-ink, oklch(from var(--isr-mk) 0.22 min(c, 0.05) h));
background-color: var(--isr-mk);
border-radius: 0.1em 0.32em 0.16em 0.28em; padding: 0 0.14em;
-webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.cf-impact-stats-2 .isr-story { align-self: start; }
.cf-impact-stats-2 .isr-lead { margin: 0; max-width: 64ch; font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.4; font-weight: 500; text-wrap: pretty; }
.cf-impact-stats-2 .isr-body { margin: 16px 0 0; max-width: 64ch; color: var(--isr-soft); font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5; text-wrap: pretty; }
.cf-impact-stats-2 .isr-story > .isr-body:first-child { margin-top: 0; }
.cf-impact-stats-2 .isr-pull { margin: 0; display: flex; flex-direction: column; align-self: start; }
.cf-impact-stats-2 .isr-pull-fig {
font-family: var(--font-display); 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;
}
.cf-impact-stats-2 .isr-pull-text {
font-family: var(--font-display); font-weight: var(--display-weight, 800); font-size: clamp(1.3125rem, 1.8vw, 1.625rem);
line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance;
}
.cf-impact-stats-2 .isr-pull-fig + .isr-pull-text { margin-top: 20px; }
.cf-impact-stats-2 .isr-photo { margin: 8px 0 0; }
.cf-impact-stats-2 .isr-photo img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: 50% 35%; border-radius: 12px; }
.cf-impact-stats-2 .isr-photo figcaption { margin-top: 12px; color: var(--isr-soft); font-size: 0.9375rem; line-height: 1.4; font-weight: 500; text-wrap: pretty; }
@media (min-width: 720px) {
.cf-impact-stats-2 .isr-spread { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cf-impact-stats-2 .isr-h, .cf-impact-stats-2 .isr-photo, .cf-impact-stats-2 .isr-spread.no-pull .isr-story { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
.cf-impact-stats-2 .isr-spread { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto 1fr; }
.cf-impact-stats-2 .isr-h { grid-column: 1 / 10; }
.cf-impact-stats-2 .isr-story { grid-column: 1 / 7; grid-row: 2; }
.cf-impact-stats-2 .isr-pull { grid-column: 8 / 13; grid-row: 2; }
.cf-impact-stats-2 .isr-spread.no-pull .isr-story { grid-column: 1 / 10; }
.cf-impact-stats-2 .isr-spread.has-photo .isr-h { grid-column: 1 / 9; }
.cf-impact-stats-2 .isr-spread.has-photo .isr-story { grid-column: 1 / 5; }
.cf-impact-stats-2 .isr-spread.has-photo .isr-pull { grid-column: 5 / 9; }
.cf-impact-stats-2 .isr-spread.has-photo.no-pull .isr-story { grid-column: 1 / 9; }
.cf-impact-stats-2 .isr-photo { grid-column: 9 / 13; grid-row: 1 / 3; margin: 0; align-self: start; }
.cf-impact-stats-2 .isr-photo img { aspect-ratio: 4 / 5; }
}
.cf-impact-stats-2 .isr-map { position: relative; margin-top: clamp(48px, 6vw, 80px); }
.cf-impact-stats-2 .isr-svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 0; }
.cf-impact-stats-2 .isr-track { fill: none; stroke: var(--isr-line); stroke-width: 4; stroke-linecap: round; }
.cf-impact-stats-2 .isr-ink {
fill: none; stroke: var(--band-ink); stroke-width: 4; stroke-linecap: round;
stroke-dasharray: 1000 1000; stroke-dashoffset: var(--off, 1000);
transition: stroke-dashoffset var(--dur, 2s) linear;
}
.cf-impact-stats-2 .isr-route { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
.cf-impact-stats-2 .isr-stop { display: block; margin: 0; }
.cf-impact-stats-2 .isr-stop-btn {
-webkit-appearance: none; appearance: none; background: none; border: 0; margin: 0; padding: 0;
color: inherit; font: inherit; text-align: left; cursor: pointer; width: 100%;
display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: 12px; align-items: start;
-webkit-tap-highlight-color: transparent;
}
.cf-impact-stats-2 .isr-stop-btn:focus { outline: none; }
.cf-impact-stats-2 .isr-text {
grid-column: 2; grid-row: 1; display: flex; flex-direction: column; align-items: flex-start; width: 100%;
padding: 12px; border-radius: 12px; transition: background-color 0.16s ease, transform 0.16s ease;
}
.cf-impact-stats-2 .isr-month { font-size: 0.875rem; line-height: 1.2; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--isr-soft); }
.cf-impact-stats-2 .isr-num {
margin-top: 8px; font-family: var(--font-display); font-weight: var(--display-weight, 800);
font-size: clamp(2rem, 3.6vw, 3.25rem); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.cf-impact-stats-2 .isr-label { margin-top: 12px; font-size: 1rem; line-height: 1.4; font-weight: 500; text-wrap: pretty; }
.cf-impact-stats-2 .isr-stop-btn:hover .isr-text, .cf-impact-stats-2 .isr-stop-btn.is-on .isr-text { background: var(--isr-plate); }
.cf-impact-stats-2 .isr-stop-btn[aria-pressed=true] .isr-text { background: oklch(from var(--band-ink) l c h / 0.14); }
.cf-impact-stats-2 .isr-stop-btn:active .isr-text { background: oklch(from var(--band-ink) l c h / 0.18); transform: translateY(1px); }
.cf-impact-stats-2 .isr-stop-btn:focus-visible .isr-text { outline: 3px solid var(--band-ink); outline-offset: 2px; }
.cf-impact-stats-2 .isr-dot {
grid-column: 1; grid-row: 1; justify-self: center; margin-top: 14px; position: relative; z-index: 1;
width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--band-ink); background: var(--band);
transform: translateY(var(--dy, 0px)) scale(var(--ds, 1));
transition: background-color 0.3s ease var(--delay, 0s), transform 0.16s ease, box-shadow 0.16s ease;
}
.cf-impact-stats-2 .isr-stop[data-reached] .isr-dot { background: var(--band-ink); }
.cf-impact-stats-2 .isr-stop-btn:hover .isr-dot, .cf-impact-stats-2 .isr-stop-btn.is-on .isr-dot, .cf-impact-stats-2 .isr-stop-btn:focus-visible .isr-dot {
--ds: 1.3; box-shadow: 0 0 0 6px oklch(from var(--band-ink) l c h / 0.2);
}
.cf-impact-stats-2 .isr-spot {
grid-column: 3; grid-row: 1; align-self: center; display: block; line-height: 0;
transform: scale(0.9); transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) var(--delay, 0s);
}
.cf-impact-stats-2 .isr-stop[data-reached] .isr-spot { transform: scale(1); }
.cf-impact-stats-2 .isr-stop-btn:hover .isr-spot, .cf-impact-stats-2 .isr-stop-btn.is-on .isr-spot { transform: scale(1.06); transition-delay: 0s; }
.cf-impact-stats-2 .isr-goal { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; align-items: start; margin-top: 16px; }
.cf-impact-stats-2 .isr-goal-dot {
grid-column: 1; grid-row: 1; justify-self: center; margin-top: 8px; position: relative; z-index: 1;
width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--band-ink); background: var(--band); color: var(--band-ink);
display: grid; place-items: center;
}
.cf-impact-stats-2 .isr-goal .isr-card { grid-column: 1 / -1; grid-row: 2; margin-top: 16px; max-width: 560px; }
.cf-impact-stats-2 .isr-card {
background: var(--card); color: var(--ink);
border: 1px solid color-mix(in oklch, var(--accent) 28%, var(--card));
border-radius: var(--card-radius, var(--radius, 14px));
box-shadow: var(--card-shadow, var(--shadow-lg, 0 2px 4px oklch(0.22 0.03 260 / 0.22), 0 12px 24px -8px oklch(0.22 0.03 260 / 0.32)));
padding: clamp(20px, 3vw, 32px);
}
.cf-impact-stats-2 .isr-card-title {
margin: 0 0 12px; color: var(--ink); font-family: var(--font-display); font-weight: var(--display-weight, 800);
font-size: clamp(1.3125rem, 1.8vw, 1.625rem); line-height: 1.15; letter-spacing: -0.01em; text-transform: var(--display-case, none); text-wrap: balance;
}
.cf-impact-stats-2 .isr-next { color: var(--accent); }
.cf-impact-stats-2 .isr-pacing { margin: 0 0 20px; color: var(--muted); font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5; text-wrap: pretty; }
.cf-impact-stats-2 .isr-progress { margin: 0 0 20px; }
.cf-impact-stats-2 .isr-bar { height: 10px; border-radius: 999px; overflow: hidden; background: color-mix(in oklch, var(--ink) 10%, var(--card)); }
.cf-impact-stats-2 .isr-bar > span {
display: block; height: 100%; border-radius: inherit; background: var(--accent-fill, var(--accent));
transform-origin: left center; transform: scaleX(var(--p-now, 0));
transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) var(--p-delay, 0s);
}
.cf-impact-stats-2 .isr-raised { margin: 8px 0 0; color: var(--ink); font-size: 0.9375rem; line-height: 1.4; font-weight: 600; }
.cf-impact-stats-2 .isr-raised strong { font-weight: 800; }
.cf-impact-stats-2 .isr-amount {
display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 0 0 16px; padding: 16px;
border-radius: 10px; background: color-mix(in oklch, var(--ink) 4%, var(--card));
}
.cf-impact-stats-2 .isr-amt { margin: 0; display: flex; flex-direction: column; }
.cf-impact-stats-2 .isr-fig {
display: block; color: var(--ink); font-family: var(--font-display); 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;
}
.cf-impact-stats-2 .isr-fig sup { font-size: 0.42em; line-height: 1; vertical-align: top; position: relative; top: 0.08em; margin-right: 0.04em; font-weight: inherit; }
.cf-impact-stats-2 .isr-amt-note { margin-top: 12px; color: var(--muted); font-size: 0.875rem; line-height: 1.2; font-weight: 800; }
.cf-impact-stats-2 .isr-amt-line { flex: 1 1 140px; margin: 0; color: var(--ink); font-size: 0.9375rem; line-height: 1.4; font-weight: 500; text-wrap: pretty; }
.cf-impact-stats-2 .isr-cta {
--isr-bg: var(--button-bg, var(--cta)); --isr-bg2: var(--button-bg-2, var(--cta-2));
display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 64px; padding: 0 16px;
border: 0; border-radius: var(--button-radius, var(--radius, 12px)); cursor: pointer; text-decoration: none; text-align: center;
font-family: var(--button-font, var(--font-display)); 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-wrap: balance;
color: var(--button-ink, var(--cta-ink)); text-shadow: var(--button-text-shadow, none);
background: linear-gradient(oklch(from var(--isr-bg) calc(l + 0.04) c h), oklch(from var(--isr-bg2) calc(l - 0.02) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--isr-bg) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--isr-bg) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--isr-shadow) l c h / 0.35), 0 8px 16px -6px oklch(from var(--isr-shadow) l c h / 0.45));
transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.cf-impact-stats-2 .isr-cta:hover:not(:disabled), .cf-impact-stats-2 .isr-cta.is-hover:not(:disabled) {
transform: translateY(-1px);
background: linear-gradient(oklch(from var(--isr-bg) calc(l - 0.01) c h), oklch(from var(--isr-bg2) calc(l - 0.07) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--isr-bg) calc(l + 0.12) c h / 0.7), inset 0 -3px 0 oklch(from var(--isr-bg) calc(l - 0.18) c h), 0 1px 2px oklch(from var(--isr-shadow) l c h / 0.4), 0 12px 20px -6px oklch(from var(--isr-shadow) l c h / 0.5));
}
.cf-impact-stats-2 .isr-cta:active:not(:disabled), .cf-impact-stats-2 .isr-cta.is-press:not(:disabled) {
transform: translateY(1px);
background: linear-gradient(oklch(from var(--isr-bg) calc(l - 0.06) c h), oklch(from var(--isr-bg2) calc(l - 0.1) c h));
box-shadow: inset 0 2px 4px oklch(from var(--isr-bg) calc(l - 0.22) c h / 0.55), inset 0 -2px 0 oklch(from var(--isr-bg) calc(l - 0.16) c h), 0 1px 1px oklch(from var(--isr-shadow) l c h / 0.3);
}
.cf-impact-stats-2 .isr-cta:focus-visible { outline: 3px solid var(--field-focus, var(--accent)); outline-offset: 3px; }
.cf-impact-stats-2 .isr-cta:disabled {
cursor: not-allowed; transform: none; text-shadow: none;
background: var(--button-2-bg, var(--secondary)); color: var(--button-2-ink, var(--secondary-ink));
box-shadow: var(--button-2-shadow, var(--shadow-sm, 0 1px 2px oklch(0.22 0.03 260 / 0.2)));
}
.cf-impact-stats-2 .isr-reassure { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 0.9375rem; line-height: 1.4; font-weight: 500; text-wrap: pretty; }
.cf-impact-stats-2 .isr-lock { display: inline-block; vertical-align: -0.15em; margin-inline-end: 0.4em; }
.cf-impact-stats-2 .isr-solo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px clamp(32px, 5vw, 72px); }
.cf-impact-stats-2 .isr-solo-copy .isr-lead { margin-top: 16px; }
.cf-impact-stats-2 .isr-solo .isr-card { max-width: 480px; }
@media (min-width: 960px) {
.cf-impact-stats-2 .isr-solo { grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); align-items: start; }
.cf-impact-stats-2 .isr-solo .isr-card { max-width: none; }
}
@media (min-width: 1200px) {
.cf-impact-stats-2 .isr-route {
grid-template-columns: repeat(var(--n), minmax(0, 1fr)) minmax(360px, 400px);
grid-template-rows: auto 64px auto; column-gap: 12px; row-gap: 0;
}
.cf-impact-stats-2 .isr-stop { display: grid; grid-row: 1 / 4; grid-template-rows: subgrid; }
.cf-impact-stats-2 .isr-stop-btn { grid-row: 1 / 4; grid-template-rows: subgrid; grid-template-columns: minmax(0, 1fr); column-gap: 0; text-align: center; }
.cf-impact-stats-2 .isr-text { grid-column: 1; grid-row: 1; align-self: end; align-items: center; padding: 12px 8px 4px; }
.cf-impact-stats-2 .isr-stop[data-side=below] .isr-text { grid-row: 3; align-self: start; padding: 4px 8px 12px; }
.cf-impact-stats-2 .isr-dot { grid-column: 1; grid-row: 2; align-self: center; margin: 0; --dy: -14px; }
.cf-impact-stats-2 .isr-stop[data-side=below] .isr-dot { --dy: 14px; }
.cf-impact-stats-2 .isr-spot { grid-column: 1; grid-row: 3; align-self: start; justify-self: center; margin-top: 16px; }
.cf-impact-stats-2 .isr-stop[data-side=below] .isr-spot { grid-row: 1; align-self: end; margin: 0 0 16px; }
.cf-impact-stats-2 .isr-goal { grid-row: 1 / 4; grid-template-rows: subgrid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; align-items: center; margin: 0 0 0 8px; }
.cf-impact-stats-2 .isr-goal-dot { grid-row: 2; align-self: center; margin: 0; }
.cf-impact-stats-2 .isr-goal .isr-card { grid-column: 2; grid-row: 1 / 4; align-self: center; max-width: none; margin-top: 0; padding: 24px; }
.cf-impact-stats-2 .isr-goal .isr-cta { font-size: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
.cf-impact-stats-2 .isr-ink { stroke-dashoffset: var(--done, 0); transition: none; }
.cf-impact-stats-2 .isr-bar > span { transform: scaleX(var(--p, 0)); transition: none; }
.cf-impact-stats-2 .isr-dot, .cf-impact-stats-2 .isr-text, .cf-impact-stats-2 .isr-cta { transition: none; }
.cf-impact-stats-2 .isr-spot, .cf-impact-stats-2 .isr-stop[data-reached] .isr-spot, .cf-impact-stats-2 .isr-stop-btn:hover .isr-spot, .cf-impact-stats-2 .isr-stop-btn.is-on .isr-spot { transform: none; transition: none; }
.cf-impact-stats-2 .isr-stop-btn:active .isr-text, .cf-impact-stats-2 .isr-cta:hover:not(:disabled), .cf-impact-stats-2 .isr-cta.is-hover:not(:disabled), .cf-impact-stats-2 .isr-cta:active:not(:disabled), .cf-impact-stats-2 .isr-cta.is-press:not(:disabled) { transform: none; }
}
`;
pieces/proof/impact-stats-2/specimen.tsx 42 lines
import __studioImagec4f64b70 from "../assets/0034c4a39d1180de.webp";
import { ImpactStats2 } from '../impact-stats-2';
import { slot } from '../../slots';
import truck from '../../fx/spots/truck';
import community from '../../fx/spots/community';
import shield from '../../fx/spots/shield';
import pin from '../../fx/spots/pin';
import savings from '../../fx/spots/savings';
export const states = ['default', 'hover', 'active', 'disabled'];
type SpecimenState = 'default' | 'hover' | 'active' | 'disabled';
export default function ImpactStats2Specimen({ state = 'default' }: { state?: SpecimenState }) {
return (
<ImpactStats2
state={state}
headline='A year on the road, and every mile ends at a couch'
highlight='ends at a couch'
lead='Second Chance Paws drives dogs and cats off the county’s urgent list and into foster homes, vet care and families. This is the road we drove this year.'
body='Every stop below happened because a neighbour chipped in. The next stop hasn’t happened yet. That’s the one you can fund today.'
pull={{ figure: '214', text: 'animals rode this route home this year.' }}
photo={slot('scene', __studioImagec4f64b70)}
photoAlt='A volunteer lifting a scruffy brown-and-white dog out of a rescue van'
photoCaption='Every stop starts the same way: a van door, a blanket and a ride somewhere safe.'
milestones={[
{ month: 'February', number: '18', label: 'dogs pulled off the county shelter’s urgent list', spot: truck },
{ month: 'April', number: '42', label: 'foster homes opened their doors', spot: community },
{ month: 'June', number: '96', label: 'vet visits paid for, vaccines to surgery', spot: shield },
{ month: 'September', number: '150', label: 'animals adopted into forever homes', spot: pin },
{ month: 'November', number: '$31k', label: 'raised by 1,180 neighbours', spot: savings },
]}
goal={{ title: '300 animals home by spring', raised: '$6,200', target: '$10,000' }}
pacing='Picture the spring update: 300 names, 300 couches, and your gift behind every one.'
amount='$25'
amountNote='one-time gift'
amountLine='Covers one rescue ride, a vet check and a warm first bed.'
label='Fund the next stop'
reassurance='Secure checkout · Takes about a minute'
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalImpactStats2 |
React.ReactNode |
|
highlight OptionalImpactStats2 |
string |
|
lead OptionalImpactStats2 |
React.ReactNode |
|
body OptionalImpactStats2 |
React.ReactNode |
|
pull OptionalImpactStats2 |
{ figure?: string; text: string } |
|
photo OptionalImpactStats2 |
string |
|
photoAlt OptionalImpactStats2 |
string |
|
photoCaption OptionalImpactStats2 |
string |
|
milestones OptionalImpactStats2 |
ImpactStats2Milestone[] |
|
goal OptionalImpactStats2 |
ImpactStats2Goal |
|
pacing OptionalImpactStats2 |
string |
|
amount OptionalImpactStats2 |
string |
|
amountNote OptionalImpactStats2 |
string |
|
amountLine OptionalImpactStats2 |
string |
|
label OptionalImpactStats2 |
string |
|
reassurance OptionalImpactStats2 |
string |
|
href OptionalImpactStats2 |
string |
|
onAction OptionalImpactStats2 |
() => void |
|
onStopSelect OptionalImpactStats2 |
(index: number) => void |
|
disabled OptionalImpactStats2 |
boolean |
|
state OptionalImpactStats2 |
'default' | 'hover' | 'active' | 'disabled' |
|
copy OptionalImpactStats2 |
Partial<ImpactStats2Copy> |
|
className OptionalImpactStats2 |
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-ink--button-2-shadow- Secondary button.
--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field-focus- 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.
scene- A wide atmosphere photo behind or beside the copy.
-
0034c4a39d1180de.webp
image/webp · 148 KB
-
0d114386aa55e8d2.webp
image/webp · 15.6 KB
-
5602e47ebdb81810.webp
image/webp · 35.6 KB
-
75ba15955a7397f6.webp
image/webp · 18.6 KB
-
7d6f1c81c93d8f71.webp
image/webp · 18.2 KB
-
87170e25e6a4d825.webp
image/webp · 18.7 KB
-
a57ca5c86a05001f.webp
image/webp · 108 KB