Comparison Us Them 2
Drag-to-compare block for free-trial pages: the reader pulls one divider across the same week, out of the old way and into
Use it in a prompt
Use content/comparison-us-them-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/content/comparison-us-them-2.tsx. - Import it and pass your copy and images (Props tab):
import { ComparisonUsThem2 } from "@/components/funneldna/content/comparison-us-them-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/comparison-us-them-2/component.tsx 613 lines
// layout: before-after-split
// Drag-to-compare block for free-trial pages: the reader pulls one divider across the same week, out of the old way and into
// the offer, while the rows under it light the side the divider favours and the offer's column closes on the trial action.
import * as React from 'react';
import { Check, ChevronsLeftRight, MoveHorizontal, X } from 'lucide-react';
import { FX_HOST, Pattern } from '../fx/fx';
export type ComparisonUsThem2Row = {
/** What changes in the week; sits on the divider seam above the two answers. */
label: React.ReactNode;
/** The old way's answer (left of the divider). */
before: React.ReactNode;
/** One short line under the old way's answer. */
beforeNote?: React.ReactNode;
/** The offer's answer (right of the divider). */
after: React.ReactNode;
/** One short line under the offer's answer. */
afterNote?: React.ReactNode;
};
export type ComparisonUsThem2Props = {
/** Section headline. */
title?: React.ReactNode;
/** Phrase inside a string title that gets the marker stroke. */
highlight?: string;
/** Subheadline under the title. */
lead?: React.ReactNode;
/** The old-way image (slot before). */
beforeImage?: string;
beforeAlt?: string;
/** The same scene done the offer's way (slot after), framed like the before image. */
afterImage?: string;
afterAlt?: string;
/** Column heading for the old way. */
beforeLabel?: React.ReactNode;
/** Column heading for the offer. */
afterLabel?: React.ReactNode;
/** Short old-way name: image tag, phone toggle and phone column heading. */
beforeShort?: string;
/** Short offer name: image tag, phone toggle and phone column heading. */
afterShort?: string;
/** Line above the image pair inviting the drag (desktop). */
dragHint?: React.ReactNode;
/** Accessible name of the divider handle. */
sliderLabel?: string;
/** Spoken divider value; placeholders {before}, {after}, {beforeLabel}, {afterLabel}. */
sliderValueText?: string;
/** Accessible name of the phone before/after toggle. */
toggleLabel?: string;
/** Accessible name of the comparison table. */
tableLabel?: string;
/** Hidden heading of the row-label column (read by screen readers). */
rowHeaderLabel?: string;
/** Comparison rows; every claim comes only from here. */
rows?: ComparisonUsThem2Row[];
/** Closing line in the old-way column beside the action (desktop). */
beforeClose?: React.ReactNode;
/** Currency sign set superscript beside the price. */
priceCurrency?: React.ReactNode;
/** Price figure; empty hides the price. */
priceAmount?: React.ReactNode;
/** Small line under the price. */
priceNote?: React.ReactNode;
/** Action button text. */
label?: React.ReactNode;
/** One plain line under the button. */
secondaryLine?: React.ReactNode;
/** Lead-in of the P.S. */
psLabel?: React.ReactNode;
/** P.S. text; empty hides it. */
ps?: React.ReactNode;
/** Where the divider starts, 5 to 95 (percent of the old way showing). */
defaultPosition?: number;
/** Navigation destination; renders the action as a link. */
href?: string;
/** Called when the action is pressed. */
onAction?: () => void;
disabled?: boolean;
/** Preview state: forces the hover or pressed look on the handle and button, or disables the button. */
state?: 'default' | 'hover' | 'active' | 'disabled';
/** Root class for page-level placement. */
className?: string;
};
const P = 'cf-comparison-us-them-2';
const MIN = 5;
const MAX = 95;
const STEP = 5;
const PAGE = 20;
const PHONE_BEFORE = 80;
const PHONE_AFTER = 20;
const PHONE_QUERY = '(max-width: 640px)';
export function ComparisonUsThem2(props: ComparisonUsThem2Props) {
const {
title = 'Drag next week’s rota out of the spreadsheet',
highlight = 'out of the spreadsheet',
lead = 'Same clinic, same team, same week. Pull the line to the left and see what changes when the rota lives in Rotamint.',
beforeImage = '',
beforeAlt = 'A laptop showing a cluttered staff rota spreadsheet on a messy desk',
afterImage = '',
afterAlt = 'The same laptop showing a clean weekly staff schedule on a tidy desk',
beforeLabel = 'The spreadsheet week',
afterLabel = 'The Rotamint week',
beforeShort = 'Spreadsheet',
afterShort = 'Rotamint',
dragHint = 'Drag the line to move your week across',
sliderLabel = 'Compare the spreadsheet week with the Rotamint week',
sliderValueText = '{before}% {beforeLabel}, {after}% {afterLabel}',
toggleLabel = 'Choose which week to see',
tableLabel = 'How the week compares',
rowHeaderLabel = 'What changes',
rows = [],
beforeClose = 'Or rebuild it by hand again next Sunday.',
priceCurrency = '$',
priceAmount = '',
priceNote = 'today · 14-day free trial',
label = 'Start My Free Trial',
secondaryLine = 'or drag the line back to the spreadsheet week',
psLabel = 'P.S.',
ps = 'Your first 14 days are free, so next week’s rota can be the first one you build in Rotamint.',
defaultPosition = 66,
href,
onAction,
disabled = false,
state = 'default',
className,
} = props;
const uid = React.useId();
const titleId = `${uid}-title`;
const [pos, setPos] = React.useState<number>(() =>
clamp(Number.isFinite(defaultPosition) ? defaultPosition : 66, MIN, MAX),
);
const [dragging, setDragging] = React.useState(false);
const frameRef = React.useRef<HTMLDivElement>(null);
const handleRef = React.useRef<HTMLDivElement>(null);
const dragRef = React.useRef(false);
const isDisabled = disabled || state === 'disabled';
const shown = Math.round(pos);
const wBefore = clamp((pos - 50) / 30, 0, 1);
const wAfter = clamp((50 - pos) / 30, 0, 1);
const favour: 'before' | 'after' | 'even' = pos > 52 ? 'before' : pos < 48 ? 'after' : 'even';
const view: 'before' | 'after' = pos >= 50 ? 'before' : 'after';
const valueText = fill(sliderValueText, {
before: String(shown),
after: String(100 - shown),
beforeLabel: beforeShort,
afterLabel: afterShort,
});
const moveTo = (clientX: number) => {
const frame = frameRef.current;
if (!frame) return;
const box = frame.getBoundingClientRect();
if (!box.width) return;
setPos(clamp(((clientX - box.left) / box.width) * 100, MIN, MAX));
};
const onPointerDown = (event: React.PointerEvent<HTMLDivElement>) => {
if (event.pointerType === 'mouse' && event.button !== 0) return;
if (typeof window !== 'undefined' && window.matchMedia?.(PHONE_QUERY).matches) return;
if (event.pointerType === 'mouse') event.preventDefault();
dragRef.current = true;
setDragging(true);
try {
event.currentTarget.setPointerCapture(event.pointerId);
} catch {
/* capture is optional */
}
moveTo(event.clientX);
handleRef.current?.focus({ preventScroll: true });
};
const onPointerMove = (event: React.PointerEvent<HTMLDivElement>) => {
if (!dragRef.current) return;
moveTo(event.clientX);
};
const endDrag = (event: React.PointerEvent<HTMLDivElement>) => {
if (!dragRef.current) return;
dragRef.current = false;
setDragging(false);
try {
if (event.currentTarget.hasPointerCapture(event.pointerId)) {
event.currentTarget.releasePointerCapture(event.pointerId);
}
} catch {
/* already released */
}
};
const onKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {
const step = event.shiftKey ? STEP * 2 : STEP;
let next: number;
switch (event.key) {
case 'ArrowLeft':
case 'ArrowDown':
next = pos - step;
break;
case 'ArrowRight':
case 'ArrowUp':
next = pos + step;
break;
case 'PageDown':
next = pos - PAGE;
break;
case 'PageUp':
next = pos + PAGE;
break;
case 'Home':
next = MIN;
break;
case 'End':
next = MAX;
break;
default:
return;
}
event.preventDefault();
setPos(clamp(next, MIN, MAX));
};
const handleAction = (event: React.MouseEvent<HTMLElement>) => {
if (isDisabled) {
event.preventDefault();
return;
}
onAction?.();
};
const col = (side: 'before' | 'after', extra: string) =>
cx(`${P}__col`, `${P}__col--${side}`, extra, (favour === side || favour === 'even') && 'is-fav');
const rootStyle = {
...FX_HOST,
'--pos': pos.toFixed(2),
'--w-before': wBefore.toFixed(3),
'--w-after': wAfter.toFixed(3),
} as React.CSSProperties;
const ctaStyle = {
borderRadius: 'var(--button-radius, var(--radius, 12px))',
fontFamily: 'var(--button-font, var(--font-display))',
fontWeight: 'var(--button-weight, 800)',
textTransform: 'var(--button-case, none)',
color: 'var(--button-ink, var(--cta-ink))',
textShadow: 'var(--button-text-shadow, none)',
} as React.CSSProperties;
const action = href ? (
<a
className={`${P}__cta`}
style={ctaStyle}
href={isDisabled ? undefined : href}
role={isDisabled ? 'link' : undefined}
aria-disabled={isDisabled || undefined}
onClick={handleAction}
>
{label}
</a>
) : (
<button
type='button'
className={`${P}__cta`}
style={ctaStyle}
disabled={isDisabled}
onClick={handleAction}
>
{label}
</button>
);
return (
<section
className={cx(
P,
state === 'hover' && 'is-hover',
state === 'active' && 'is-active',
dragging && 'is-dragging',
className,
)}
style={rootStyle}
aria-labelledby={titleId}
>
<style>{CSS}</style>
<Pattern name='grid' fade='top' />
<div className={`${P}__wrap`}>
<header className={`${P}__head`}>
<h2 id={titleId} className={`${P}__title`}>
{renderTitle(title, highlight)}
</h2>
{lead ? <p className={`${P}__lead`}>{lead}</p> : null}
</header>
<div className={`${P}__card`}>
{dragHint ? (
<p className={`${P}__hint`}>
<MoveHorizontal size={18} strokeWidth={2.5} aria-hidden='true' />
{dragHint}
</p>
) : null}
<div className={`${P}__toggle`} role='group' aria-label={toggleLabel}>
<button
type='button'
className={`${P}__seg`}
aria-pressed={view === 'before'}
onClick={() => setPos(PHONE_BEFORE)}
>
{beforeShort}
</button>
<button
type='button'
className={`${P}__seg`}
aria-pressed={view === 'after'}
onClick={() => setPos(PHONE_AFTER)}
>
{afterShort}
</button>
</div>
<div
ref={frameRef}
className={`${P}__frame`}
data-view={view}
onPointerDown={onPointerDown}
onPointerMove={onPointerMove}
onPointerUp={endDrag}
onPointerCancel={endDrag}
onLostPointerCapture={endDrag}
>
<div className={`${P}__layer ${P}__layer--after`}>
{afterImage ? (
<img
className={`${P}__img`}
src={afterImage}
alt={afterAlt}
width={1536}
height={1024}
loading='lazy'
decoding='async'
draggable={false}
/>
) : null}
{afterShort ? (
<span className={`${P}__tag ${P}__tag--after`} aria-hidden='true'>
{afterShort}
</span>
) : null}
</div>
<div className={`${P}__layer ${P}__layer--before`}>
{beforeImage ? (
<img
className={`${P}__img`}
src={beforeImage}
alt={beforeAlt}
width={1536}
height={1024}
loading='lazy'
decoding='async'
draggable={false}
/>
) : null}
{beforeShort ? (
<span className={`${P}__tag ${P}__tag--before`} aria-hidden='true'>
{beforeShort}
</span>
) : null}
</div>
<div className={`${P}__divider`}>
<span className={`${P}__line`} aria-hidden='true' />
<div
ref={handleRef}
className={`${P}__handle`}
role='slider'
tabIndex={0}
aria-label={sliderLabel}
aria-orientation='horizontal'
aria-valuemin={MIN}
aria-valuemax={MAX}
aria-valuenow={shown}
aria-valuetext={valueText}
onKeyDown={onKeyDown}
>
<ChevronsLeftRight size={24} strokeWidth={2.5} aria-hidden='true' />
</div>
</div>
</div>
<div className={`${P}__table`} role='table' aria-label={tableLabel}>
<div className={`${P}__tr ${P}__tr--head`} role='row'>
<span className={`${P}__sr`} role='columnheader'>
{rowHeaderLabel}
</span>
<div className={col('before', `${P}__th`)} role='columnheader'>
<span className={`${P}__badge ${P}__badge--no`} aria-hidden='true'>
<X size={16} strokeWidth={3} />
</span>
<span>
<span className={`${P}__long`}>{beforeLabel}</span>
<span className={`${P}__short`}>{beforeShort}</span>
</span>
</div>
<div className={col('after', `${P}__th`)} role='columnheader'>
<span className={`${P}__badge ${P}__badge--yes`} aria-hidden='true'>
<Check size={16} strokeWidth={3} />
</span>
<span>
<span className={`${P}__long`}>{afterLabel}</span>
<span className={`${P}__short`}>{afterShort}</span>
</span>
</div>
</div>
{rows.map((row, index) => (
<div key={index} className={`${P}__tr`} role='row'>
<div className={`${P}__rowhead`} role='rowheader'>
{row.label}
</div>
<div className={col('before', `${P}__cell`)} role='cell'>
<span className={`${P}__badge ${P}__badge--no`} aria-hidden='true'>
<X size={16} strokeWidth={3} />
</span>
<div className={`${P}__text`}>
<p className={`${P}__value`}>{row.before}</p>
{row.beforeNote ? <p className={`${P}__note`}>{row.beforeNote}</p> : null}
</div>
</div>
<div className={col('after', `${P}__cell`)} role='cell'>
<span className={`${P}__badge ${P}__badge--yes`} aria-hidden='true'>
<Check size={16} strokeWidth={3} />
</span>
<div className={`${P}__text`}>
<p className={`${P}__value`}>{row.after}</p>
{row.afterNote ? <p className={`${P}__note`}>{row.afterNote}</p> : null}
</div>
</div>
</div>
))}
</div>
<div className={`${P}__close`}>
<div className={col('before', `${P}__close-before`)}>
{beforeClose ? (
<>
<span className={`${P}__badge ${P}__badge--no`} aria-hidden='true'>
<X size={16} strokeWidth={3} />
</span>
<p className={`${P}__close-line`}>{beforeClose}</p>
</>
) : null}
</div>
<div className={col('after', `${P}__close-after`)}>
{priceAmount ? (
<>
<p className={`${P}__price`}>
<span className={`${P}__cur`}>{priceCurrency}</span>
{priceAmount}
</p>
{priceNote ? <p className={`${P}__price-note`}>{priceNote}</p> : null}
</>
) : null}
{action}
{secondaryLine ? <p className={`${P}__secondary`}>{secondaryLine}</p> : null}
</div>
{ps ? (
<p className={`${P}__ps`}>
<strong>{psLabel}</strong> {ps}
</p>
) : null}
</div>
</div>
</div>
</section>
);
}
export default ComparisonUsThem2;
function clamp(value: number, low: number, high: number) {
if (Number.isNaN(value)) return low;
return Math.min(high, Math.max(low, value));
}
function cx(...parts: Array<string | false | null | undefined>) {
return parts.filter(Boolean).join(' ');
}
function fill(template: string, values: Record<string, string>) {
return Object.keys(values).reduce((out, key) => out.split(`{${key}}`).join(values[key]), template);
}
function renderTitle(title: React.ReactNode, highlight: string | undefined): React.ReactNode {
if (typeof title !== 'string' || !highlight) return title;
const at = title.indexOf(highlight);
if (at < 0) return title;
return (
<>
{title.slice(0, at)}
<span className={`${P}__mark`}>{highlight}</span>
{title.slice(at + highlight.length)}
</>
);
}
/* Status badges keep a white glyph on the solid status fill (theme-contract status badge rule). */
const CSS = `
.${P}{--pad:clamp(20px,3vw,32px);--hair:oklch(from var(--ink) l c h / .1);--seam:oklch(from var(--ink) l c h / .16);--tint-before:color-mix(in oklch,var(--ink) 6%,var(--card));--tint-after:color-mix(in oklch,var(--accent) 11%,var(--card));--ring:oklch(from var(--field-focus,var(--accent)) l c h / .6);--sh:var(--shadow,oklch(0.22 0.03 260));--sh-sm:var(--shadow-sm,0 1px 1px oklch(0.22 0.03 260 / .18),0 1px 3px oklch(0.22 0.03 260 / .14));--sh-md:var(--shadow-md,0 1px 2px oklch(0.22 0.03 260 / .22),0 4px 10px -2px oklch(0.22 0.03 260 / .2));--sh-lg:var(--shadow-lg,0 2px 4px oklch(0.22 0.03 260 / .22),0 12px 24px -8px oklch(0.22 0.03 260 / .32));position:relative;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)}
.${P} *,.${P} *::before,.${P} *::after{box-sizing:border-box}
.${P}__wrap{position:relative;z-index:1;max-width:1120px;margin:0 auto}
.${P}__head{max-width:46rem;margin:0 auto clamp(32px,4vw,48px);text-align:center;animation:${P}-rise .45s cubic-bezier(.2,.7,.2,1) both}
.${P}__title{margin:0;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.06;color:var(--ink);text-wrap:balance}
.${P}__mark{background:linear-gradient(transparent 56%,color-mix(in oklch,var(--marker,#fae37c) 85%,transparent) 56%,color-mix(in oklch,var(--marker,#fae37c) 85%,transparent) 92%,transparent 92%);-webkit-box-decoration-break:clone;box-decoration-break:clone;padding:0 .06em;border-radius:.12em .3em .16em .28em}
.${P}__lead{margin:16px auto 0;max-width:40rem;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.${P}__card{position:relative;padding:var(--pad);overflow:hidden;background:var(--card);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(--sh-lg));animation:${P}-rise .45s cubic-bezier(.2,.7,.2,1) .07s both}
.${P}__hint{margin:0 0 16px;text-align:center;font-size:15px;line-height:1.4;font-weight:600;color:var(--muted);text-wrap:pretty}
.${P}__hint svg{display:inline-block;vertical-align:-.2em;margin-inline-end:.4em}
.${P}__toggle{display:none;gap:4px;padding:4px;margin:0 0 16px;border-radius:var(--button-radius,var(--radius,12px));background:var(--button-2-bg,var(--secondary))}
.${P}__seg{flex:1 1 0;min-height:48px;padding:0 12px;border:0;border-radius:max(0px,calc(var(--button-radius,var(--radius,12px)) - 4px));background:oklch(from var(--button-2-bg,var(--secondary)) l c h / 0);color:var(--button-2-ink,var(--secondary-ink));font-family:var(--button-font,var(--font-display));font-size:16px;font-weight:var(--button-weight,800);line-height:1.2;cursor:pointer;transition:background .16s ease,color .16s ease,box-shadow .16s ease}
.${P}__seg:hover{background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - .03) c h)}
.${P}__seg[aria-pressed='true']{background:var(--card);color:var(--ink);box-shadow:var(--sh-sm)}
.${P}__seg:focus-visible{outline:3px solid var(--ring);outline-offset:2px}
.${P}__frame{position:relative;aspect-ratio:16/9;border-radius:12px;overflow:hidden;isolation:isolate;background:color-mix(in oklch,var(--ink) 6%,var(--card));touch-action:pan-y;cursor:ew-resize;user-select:none;-webkit-user-select:none}
.${P}__layer{position:absolute;inset:0}
.${P}__layer--before{z-index:1;clip-path:inset(0 calc(100% - var(--pos) * 1%) 0 0);transition:clip-path .35s cubic-bezier(.2,.7,.2,1)}
.${P}__img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:50% 50%;pointer-events:none;-webkit-user-drag:none}
.${P}__tag{position:absolute;top:16px;display:inline-flex;align-items:center;min-height:30px;padding:4px 12px;border-radius:999px;background:var(--card);color:var(--ink);font-size:14px;font-weight:800;line-height:1.2;white-space:nowrap;box-shadow:var(--sh-sm)}
.${P}__tag--before{left:16px}
.${P}__tag--after{right:16px}
.${P}__divider{position:absolute;top:0;bottom:0;left:calc(var(--pos) * 1%);width:0;z-index:2;transition:left .35s cubic-bezier(.2,.7,.2,1)}
.${P}__line{position:absolute;top:0;bottom:0;left:-1.5px;width:3px;background:var(--band-ink);box-shadow:0 0 0 1px oklch(from var(--sh) l c h / .35)}
.${P}__handle{position:absolute;top:50%;left:0;width:52px;height:52px;margin:-26px 0 0 -26px;display:grid;place-items:center;border-radius:999px;background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));box-shadow:var(--sh-md);cursor:grab;touch-action:none;transition:transform .16s ease,box-shadow .16s ease,color .16s ease,background .16s ease,border-color .16s ease}
.${P}__handle:hover,.${P}.is-hover .${P}__handle{transform:scale(1.06);color:var(--accent);box-shadow:var(--sh-lg)}
.${P}__handle:focus{outline:none}
.${P}__handle:focus-visible{outline:3px solid var(--ring);outline-offset:3px}
.${P}__handle:active,.${P}.is-dragging .${P}__handle,.${P}.is-active .${P}__handle{cursor:grabbing;transform:scale(.95);background:color-mix(in oklch,var(--ink) 6%,var(--card));border-color:var(--accent);color:var(--accent);box-shadow:var(--sh-sm)}
.${P}.is-dragging .${P}__layer--before,.${P}.is-dragging .${P}__divider{transition:none}
.${P}.is-dragging .${P}__frame{cursor:grabbing}
.${P}__table{margin:24px calc(var(--pad) * -1) 0}
.${P}__tr{position:relative;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.${P}__tr + .${P}__tr{border-top:1px solid var(--hair)}
.${P}__sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.${P}__col{position:relative;isolation:isolate;min-width:0}
.${P}__col::before{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;background:var(--tint-before);opacity:var(--w-before);transition:opacity .2s ease}
.${P}__col--after::before{background:var(--tint-after);opacity:var(--w-after)}
.${P}__col--before{border-inline-end:1px solid var(--seam)}
.${P}__th{display:flex;align-items:center;gap:12px;padding:16px var(--pad) 20px;font-family:var(--font-display);font-size:17px;font-weight:800;line-height:1.2;color:var(--ink)}
.${P}__th.${P}__col--before{flex-direction:row-reverse;text-align:right}
.${P}__short{display:none}
.${P}__rowhead{position:absolute;top:0;left:50%;z-index:2;transform:translate(-50%,-50%);width:max-content;max-width:calc(100% - 48px);min-height:30px;padding:5px 14px;border-radius:999px;background:var(--card);border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));box-shadow:var(--sh-sm);color:var(--ink);font-size:14px;font-weight:800;line-height:1.3;text-align:center;text-wrap:balance}
.${P}__cell{display:flex;align-items:flex-start;gap:14px;padding:40px var(--pad) 28px}
.${P}__cell.${P}__col--before{flex-direction:row-reverse;text-align:right}
.${P}__text{min-width:0}
.${P}__value{margin:0;font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;color:var(--muted);text-wrap:balance;transition:color .2s ease}
.${P}__col.is-fav .${P}__value,.${P}__col--after .${P}__value{color:var(--ink)}
.${P}__note{margin:8px 0 0;font-size:15px;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.${P}__badge{flex:none;display:inline-grid;place-items:center;width:28px;height:28px;border-radius:999px;color:var(--status-glyph,#fff)}
.${P}__cell .${P}__badge{margin-top:1px}
.${P}__badge--no{background:oklch(from var(--danger) min(l,.58) c h)}
.${P}__badge--yes{background:oklch(from var(--success) min(l,.58) c h)}
.${P}__close{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);margin:0 calc(var(--pad) * -1) calc(var(--pad) * -1);border-top:1px solid var(--hair)}
.${P}__close-before{display:flex;flex-direction:row-reverse;align-items:flex-start;gap:14px;padding:36px var(--pad);text-align:right}
.${P}__close-line{margin:2px 0 0;max-width:26rem;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--muted);text-wrap:pretty}
.${P}__close-after{display:flex;flex-direction:column;align-items:center;text-align:center;padding:36px var(--pad)}
.${P}__price{margin:0;display:flex;align-items:flex-start;justify-content:center;font-family:var(--font-display);font-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)}
.${P}__cur{font-size:.45em;line-height:1;margin:.1em .06em 0 0}
.${P}__price-note{margin:12px 0 0;font-size:15px;line-height:1.4;font-weight:600;color:var(--muted)}
.${P}__cta{display:inline-flex;align-items:center;justify-content:center;width:100%;max-width:28rem;min-height:72px;margin-top:24px;padding:0 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));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-align:center;text-wrap:balance;text-decoration:none;color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow,none);cursor:pointer;background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 2px oklch(from var(--sh) l c h / .3),0 8px 16px -6px oklch(from var(--sh) l c h / .35));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.${P}__cta:first-child{margin-top:0}
.${P}__cta:hover:not(:disabled):not([aria-disabled='true']),.${P}.is-hover .${P}__cta:not(:disabled):not([aria-disabled='true']){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));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 2px oklch(from var(--sh) l c h / .32),0 10px 20px -6px oklch(from var(--sh) l c h / .42))}
.${P}__cta:active:not(:disabled):not([aria-disabled='true']),.${P}.is-active .${P}__cta:not(:disabled):not([aria-disabled='true']){transform:translateY(1px);background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .03) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .08) c h));box-shadow:inset 0 2px 3px oklch(from var(--button-bg,var(--cta)) calc(l - .22) c h / .5),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 2px oklch(from var(--sh) l c h / .3)}
.${P}__cta:focus-visible{outline:3px solid var(--ring);outline-offset:3px}
.${P}__cta:disabled,.${P}__cta[aria-disabled='true']{cursor:not-allowed;transform:none;background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink)) !important;text-shadow:none !important;box-shadow:var(--button-2-shadow,var(--shadow-sm))}
.${P}__secondary{margin:12px 0 0;font-size:15px;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.${P}__ps{grid-column:1/-1;margin:0;padding:24px max(var(--pad),calc((100% - 38rem) / 2)) var(--pad);border-top:1px solid var(--hair);background:var(--card);text-align:center;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--ink);text-wrap:pretty}
.${P}__ps strong{font-weight:800}
@media (max-width:640px){
.${P}__hint,.${P}__divider{display:none}
.${P}__toggle{display:flex}
.${P}__frame{aspect-ratio:4/3;cursor:default;touch-action:auto}
.${P}__frame[data-view='before'] .${P}__layer--before{clip-path:inset(0 0 0 0)}
.${P}__frame[data-view='after'] .${P}__layer--before{clip-path:inset(0 100% 0 0)}
.${P}__tag{top:12px}
.${P}__tag--before{left:12px}
.${P}__tag--after{right:12px}
.${P}__table{margin-top:20px}
.${P}__th{gap:8px;padding:12px 14px;font-size:15px}
.${P}__th.${P}__col--before{flex-direction:row;text-align:left}
.${P}__th .${P}__badge{width:24px;height:24px}
.${P}__long{display:none}
.${P}__short{display:inline}
.${P}__rowhead{position:static;grid-column:1/-1;transform:none;width:auto;max-width:none;min-height:0;padding:10px 14px;border:0;border-radius:0;box-shadow:none;background:color-mix(in oklch,var(--ink) 5%,var(--card));font-size:15px;text-align:left}
.${P}__cell{gap:0;padding:12px 14px 16px}
.${P}__cell.${P}__col--before{flex-direction:row;text-align:left}
.${P}__cell .${P}__badge{display:none}
.${P}__value{font-size:17px;line-height:1.25}
.${P}__note{margin-top:4px}
.${P}__close{grid-template-columns:minmax(0,1fr)}
.${P}__close-before{display:none}
.${P}__close-after{padding:28px var(--pad)}
.${P}__cta{max-width:none;padding:0 16px}
.${P}__secondary{display:none}
.${P}__ps{padding:20px var(--pad) var(--pad)}
}
@media (prefers-reduced-motion:reduce){
.${P}__head,.${P}__card{animation:none}
.${P}__layer--before,.${P}__divider,.${P}__handle,.${P}__col::before,.${P}__value,.${P}__cta,.${P}__seg{transition:none}
.${P}__handle:hover,.${P}.is-hover .${P}__handle,.${P}__handle:active,.${P}.is-dragging .${P}__handle,.${P}.is-active .${P}__handle{transform:none}
.${P}__cta:active:not(:disabled),.${P}.is-active .${P}__cta:not(:disabled){transform:none}
}
@keyframes ${P}-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
`;
pieces/content/comparison-us-them-2/specimen.tsx 64 lines
import __studioImage37d37bd6 from "../assets/d05545d26db69517.webp";
import __studioImage32345429 from "../assets/33f42cfaf79da45f.webp";
import ComparisonUsThem2, { type ComparisonUsThem2Props } from '../comparison-us-them-2';
import { slot } from '../../slots';
export const states = ['default', 'hover', 'active', 'disabled'];
const rows: ComparisonUsThem2Props['rows'] = [
{
label: 'Building next week’s rota',
before: 'Most of Sunday night',
beforeNote: 'Copy last week, then fix every clash by hand',
after: 'About 20 minutes',
afterNote: 'Start from last week’s pattern in one view',
},
{
label: 'Covering a shift swap',
before: 'A group-chat thread',
beforeNote: 'Then someone has to update the sheet',
after: 'One tap to approve',
afterNote: 'Staff request it and the rota updates itself',
},
{
label: 'Handling a no-show',
before: 'Found out at 8am',
beforeNote: 'Ringing round for cover from the front desk',
after: 'Flagged the night before',
afterNote: 'Unconfirmed shifts land in your morning list',
},
];
export default function ComparisonUsThem2Specimen({ state }: { state?: ComparisonUsThem2Props['state'] }) {
return (
<ComparisonUsThem2
state={state}
title='Drag next week’s rota out of the spreadsheet'
highlight='out of the spreadsheet'
lead='Same clinic, same team, same week. Pull the line to the left and see what changes when the rota lives in Rotamint.'
beforeImage={slot(
'before',
__studioImage37d37bd6,
)}
beforeAlt='A laptop showing a cluttered staff rota spreadsheet on a messy desk at night'
afterImage={slot(
'after',
__studioImage32345429,
)}
afterAlt='The same laptop showing a clean weekly staff schedule in Rotamint on a tidy desk in morning light'
beforeLabel='The spreadsheet week'
afterLabel='The Rotamint week'
beforeShort='Spreadsheet'
afterShort='Rotamint'
dragHint='Drag the line to move your week across'
rows={rows}
beforeClose='Or rebuild it by hand again next Sunday.'
priceCurrency='$'
priceAmount='0'
priceNote='today · 14-day free trial'
label='Start My Free Trial'
secondaryLine='or drag the line back to the spreadsheet week'
ps='Your first 14 days are free, so next week’s rota can be the first one you build in Rotamint.'
/>
);
}
| Name | Type | Details |
|---|---|---|
title OptionalComparisonUsThem2 |
React.ReactNode |
|
highlight OptionalComparisonUsThem2 |
string |
|
lead OptionalComparisonUsThem2 |
React.ReactNode |
|
beforeImage OptionalComparisonUsThem2 |
string |
|
beforeAlt OptionalComparisonUsThem2 |
string |
|
afterImage OptionalComparisonUsThem2 |
string |
|
afterAlt OptionalComparisonUsThem2 |
string |
|
beforeLabel OptionalComparisonUsThem2 |
React.ReactNode |
|
afterLabel OptionalComparisonUsThem2 |
React.ReactNode |
|
beforeShort OptionalComparisonUsThem2 |
string |
|
afterShort OptionalComparisonUsThem2 |
string |
|
dragHint OptionalComparisonUsThem2 |
React.ReactNode |
|
sliderLabel OptionalComparisonUsThem2 |
string |
|
sliderValueText OptionalComparisonUsThem2 |
string |
|
toggleLabel OptionalComparisonUsThem2 |
string |
|
tableLabel OptionalComparisonUsThem2 |
string |
|
rowHeaderLabel OptionalComparisonUsThem2 |
string |
|
rows OptionalComparisonUsThem2 |
ComparisonUsThem2Row[] |
|
beforeClose OptionalComparisonUsThem2 |
React.ReactNode |
|
priceCurrency OptionalComparisonUsThem2 |
React.ReactNode |
|
priceAmount OptionalComparisonUsThem2 |
React.ReactNode |
|
priceNote OptionalComparisonUsThem2 |
React.ReactNode |
|
label OptionalComparisonUsThem2 |
React.ReactNode |
|
secondaryLine OptionalComparisonUsThem2 |
React.ReactNode |
|
psLabel OptionalComparisonUsThem2 |
React.ReactNode |
|
ps OptionalComparisonUsThem2 |
React.ReactNode |
|
defaultPosition OptionalComparisonUsThem2 |
number |
|
href OptionalComparisonUsThem2 |
string |
|
onAction OptionalComparisonUsThem2 |
() => void |
|
disabled OptionalComparisonUsThem2 |
boolean |
|
state OptionalComparisonUsThem2 |
'default' | 'hover' | 'active' | 'disabled' |
|
className OptionalComparisonUsThem2 |
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-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-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.
after- An image this piece places.
before- An image this piece places.
-
33f42cfaf79da45f.webp
image/webp · 71.7 KB
-
d05545d26db69517.webp
image/webp · 168 KB