Challenge Days 2
Challenge Days, the build scrubber: future-paces a free challenge. The reader drags a day scrubber from Day 1 to the
Use it in a prompt
Use content/challenge-days-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/challenge-days-2.tsx. - Import it and pass your copy and images (Props tab):
import { ChallengeDays2 } from "@/components/funneldna/content/challenge-days-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/challenge-days-2/component.tsx 693 lines
// layout: bento-grid
// Challenge Days, the build scrubber: future-paces a free challenge. The reader drags a day scrubber from Day 1 to the
// payoff day, the "you'll have" list fills item by item and the routine illustration takes shape, then they save a seat.
"use client"
import * as React from "react"
import { AlertCircle, CalendarCheck, Check, Globe, GripHorizontal, GripVertical, Loader2, Minus } from "lucide-react"
import { Texture, FX_HOST } from "../fx/fx"
import leak from "../fx/textures/leak"
/** One challenge day: what the reader will have built by the end of it (a deliverable, never a promised result). */
export type ChallengeBuildDay = {
have: string
/** What they do that day; shown with the illustration while the day is chosen. */
detail?: string
/** ISO start of the live session, shown in the event's time zone (timeZone prop). */
startsAt?: string
/** Ready-made time text, used when startsAt is not set, e.g. "Mon · 6:30 AM ET". */
time?: string
}
/** One illustration of the routine taking shape; stages are spread across the days in order. */
export type ChallengeBuildStage = {
src: string
alt: string
/** Caption used when the chosen day has no detail. */
caption?: string
}
/** A short paragraph that opens with a bold lead-in phrase. */
export type ChallengeDays2LeadIn = { lead: string; text: string }
/** Generated labels. Placeholders: {n} a day number, {total} day count, {have} that day's item, {zone} the time zone. */
export type ChallengeDays2Copy = {
startTitle: string
haveTitle: string
dayLabel: string
payoff: string
railLabel: string
railHint: string
valueText: string
built: string
notYet: string
stageCaption: string
scheduleTitle: string
zoneNote: string
actionTitle: string
saving: string
}
export type ChallengeDays2State = "default" | "hover" | "active" | "disabled" | "error"
export type ChallengeDays2Props = {
heading?: string
/** A phrase inside the heading, set on one marker stroke. */
highlight?: string
lead?: string
/** Short facts shown as chips under the lead. */
facts?: string[]
/** What the reader starts with on Day 1. */
startWith?: string[]
days?: ChallengeBuildDay[]
/** Illustrations of the routine taking shape (scene slot); omit to hide the picture tile. */
stages?: ChallengeBuildStage[]
/** Day the scrubber starts on (1-based). */
initialDay?: number
/** IANA zone the live times are shown in, e.g. "America/New_York". */
timeZone?: string
/** Readable zone name for the note under the schedule; defaults to timeZone. */
timeZoneLabel?: string
locale?: string
leadIns?: ChallengeDays2LeadIn[]
ctaLabel?: string
/** One short reassurance line under the button. */
ctaNote?: string
/** Navigation destination; the button renders as a link when set. */
href?: string
/** Called on click. A returned promise shows the saving label; a rejection shows errorText. */
onAction?: () => void | Promise<void>
errorText?: string
copy?: Partial<ChallengeDays2Copy>
/** Preview state for the studio. */
state?: ChallengeDays2State
className?: string
}
export const challengeBuildDays: ChallengeBuildDay[] = [
{ have: "Your wake-up time, chosen and set", detail: "Pick one wake-up time you can keep for all five mornings." },
{ have: "A 10-minute wind-down for the night before", detail: "Set out what tomorrow's first hour needs before you sleep." },
{ have: "Your first-hour plan on one card", detail: "Write the three things you do before you pick up your phone." },
{ have: "A phone-free start, set up", detail: "Move the charger, set a focus mode and clear the nightstand." },
{ have: "Your full Calm Mornings routine, written out", detail: "Put every piece together on one printed card for tomorrow." },
]
const DEFAULT_START = ["A phone alarm and a snooze button", "No plan for the first hour", "Email before breakfast"]
const DEFAULT_FACTS = ["5 live mornings", "One piece built each day", "Free to join"]
const DEFAULT_LEAD_INS: ChallengeDays2LeadIn[] = [
{ lead: "Five short live mornings.", text: "Each session builds one piece of your routine, so you never start from a blank page." },
{ lead: "You leave every morning with something made.", text: "A wake-up time, a plan, a card. On Day 5 they come together as one routine." },
{ lead: "Free to join.", text: "Save your seat now and Day 1 comes straight to you." },
]
const DEFAULT_COPY: ChallengeDays2Copy = {
startTitle: "Day 1: you start with",
haveTitle: "By Day {n} you'll have",
dayLabel: "Day {n}",
payoff: "Payoff",
railLabel: "Challenge day",
railHint: "Slide to Day {total}",
valueText: "Day {n} of {total}: {have}",
built: "Built by now.",
notYet: "Comes on Day {n}.",
stageCaption: "Day {n}: your routine so far",
scheduleTitle: "Join live each morning",
zoneNote: "Times shown in {zone}",
actionTitle: "Start building it on Day 1",
saving: "Saving your seat…",
}
export function ChallengeDays2(props: ChallengeDays2Props) {
const {
heading = "In five mornings you'll have a routine you built yourself",
highlight = "a routine you built yourself",
lead = "Join the free Calm Mornings Challenge. Slide through the days to see what you'll have built by each morning.",
facts = DEFAULT_FACTS,
startWith = DEFAULT_START,
days: daysIn = challengeBuildDays,
stages = [],
initialDay = 1,
timeZone,
timeZoneLabel,
locale = "en-US",
leadIns = DEFAULT_LEAD_INS,
ctaLabel = "Save my seat & send Day 1",
ctaNote = "Free 5-day challenge · Live online",
href,
onAction,
errorText = "We couldn't save your seat. Please try again.",
copy: copyIn,
state = "default",
className,
} = props
const copy = { ...DEFAULT_COPY, ...copyIn }
const days = daysIn.length ? daysIn : challengeBuildDays
const n = days.length
const clampDay = React.useCallback((v: number) => Math.min(n, Math.max(1, Math.round(v))), [n])
const headingId = React.useId()
const [picked, setPicked] = React.useState(() => clampDay(initialDay))
const current = clampDay(picked)
const prevRef = React.useRef(current)
const prev = prevRef.current
React.useEffect(() => {
prevRef.current = current
}, [current])
const railRef = React.useRef<HTMLDivElement>(null)
const dragRef = React.useRef(false)
const [dragging, setDragging] = React.useState(false)
const [vertical, setVertical] = React.useState(false)
React.useEffect(() => {
const el = railRef.current
if (!el || typeof ResizeObserver === "undefined") return
const check = () => {
const r = el.getBoundingClientRect()
setVertical(r.height > r.width)
}
check()
const ro = new ResizeObserver(check)
ro.observe(el)
return () => ro.disconnect()
}, [])
const pick = (x: number, y: number) => {
const el = railRef.current
if (!el) return
const r = el.getBoundingClientRect()
const isVertical = r.height > r.width
const raw = isVertical ? (y - r.top) / r.height : (x - r.left) / r.width
const t = Math.min(0.9999, Math.max(0, raw))
setPicked(clampDay(Math.floor(t * n) + 1))
}
const stopDrag = () => {
dragRef.current = false
setDragging(false)
}
const onKey = (e: React.KeyboardEvent<HTMLDivElement>) => {
let next = current
switch (e.key) {
case "ArrowRight":
case "ArrowDown":
case "PageDown":
next = current + 1
break
case "ArrowLeft":
case "ArrowUp":
case "PageUp":
next = current - 1
break
case "Home":
next = 1
break
case "End":
next = n
break
default:
return
}
e.preventDefault()
setPicked(clampDay(next))
}
const times = React.useMemo(
() =>
days.map((d) => {
if (d.startsAt) return formatWhen(d.startsAt, timeZone, locale)
if (d.time) return { date: "", time: d.time }
return null
}),
[days, timeZone, locale],
)
const hasSchedule = times.some(Boolean)
const zone = timeZoneLabel ?? timeZone
const stageIndex = stages.length ? Math.min(stages.length - 1, Math.floor(((current - 1) * stages.length) / n)) : -1
const stageDetail = days[current - 1]?.detail ?? stages[stageIndex]?.caption
const mounted = React.useRef(true)
React.useEffect(() => {
mounted.current = true
return () => {
mounted.current = false
}
}, [])
const [busy, setBusy] = React.useState(false)
const [failed, setFailed] = React.useState(false)
const disabled = state === "disabled"
const showError = state === "error" || failed
const handleClick = (e: React.MouseEvent<HTMLElement>) => {
if (disabled || busy) {
e.preventDefault()
return
}
if (!onAction) return
setFailed(false)
let result: void | Promise<void>
try {
result = onAction()
} catch {
setFailed(true)
return
}
if (result && typeof (result as Promise<void>).then === "function") {
setBusy(true)
;(result as Promise<void>).then(
() => {
if (mounted.current) setBusy(false)
},
() => {
if (!mounted.current) return
setBusy(false)
setFailed(true)
},
)
}
}
const btnClass = ["cfcb-btn", state === "hover" && "is-hover", state === "active" && "is-active"].filter(Boolean).join(" ")
const btnInner = busy ? (
<>
<Loader2 className="cfcb-spin" size={20} strokeWidth={2.5} aria-hidden="true" />
<span>{copy.saving}</span>
</>
) : (
<span>{ctaLabel}</span>
)
const delayFor = (i: number) => (i < current && i >= prev ? Math.min(0.28, (i - prev) * 0.07) : 0)
return (
<section className={["cf-challenge-days-2", className].filter(Boolean).join(" ")} aria-labelledby={headingId}>
<style>{CSS}</style>
<div className="cfcb-wrap">
<div className="cfcb-grid" data-img={stages.length ? "" : undefined} data-sched={hasSchedule ? "" : undefined}>
<div className="cfcb-tile cfcb-promise" style={{ ...FX_HOST, ...vars({ "--rd": "0s" }) }}>
<Texture src={leak} tone="band-ink" position="top right" />
<div className="cfcb-promise-in">
<h2 id={headingId} className="cfcb-h2">
<Marked text={heading} highlight={highlight} />
</h2>
{lead ? <p className="cfcb-lead">{lead}</p> : null}
{facts.length ? (
<ul className="cfcb-facts">
{facts.map((f) => (
<li key={f}>{f}</li>
))}
</ul>
) : null}
</div>
</div>
{stages.length ? (
<figure className="cfcb-tile cfcb-card cfcb-stage" style={vars({ "--rd": "0.07s" })}>
<div className="cfcb-frame">
{stages.map((s, i) => (
<img
key={s.src + i}
src={s.src}
alt={i === stageIndex ? s.alt : ""}
aria-hidden={i === stageIndex ? undefined : true}
data-on={i === stageIndex ? "" : undefined}
decoding="async"
/>
))}
</div>
<figcaption className="cfcb-cap">
<p className="cfcb-cap-t">{fill(copy.stageCaption, { n: current })}</p>
{stageDetail ? <p className="cfcb-cap-d">{stageDetail}</p> : null}
</figcaption>
</figure>
) : null}
<div className="cfcb-tile cfcb-card cfcb-build" style={vars({ "--rd": "0.14s" })}>
<div className="cfcb-split" style={vars({ "--n": n, "--d": current })}>
<h3 className="cfcb-h3 cfcb-bh">{copy.startTitle}</h3>
<ul className="cfcb-before cfcb-bl">
{startWith.map((s) => (
<li key={s}>
<span className="cfcb-minus" aria-hidden="true">
<Minus size={16} strokeWidth={2.5} />
</span>
<span className="cfcb-before-t">{s}</span>
</li>
))}
</ul>
<p className="cfcb-hint" aria-hidden="true">
{fill(copy.railHint, { total: n })}
</p>
<div
ref={railRef}
className={dragging ? "cfcb-rail is-drag" : "cfcb-rail"}
role="slider"
tabIndex={0}
aria-label={copy.railLabel}
aria-valuemin={1}
aria-valuemax={n}
aria-valuenow={current}
aria-valuetext={fill(copy.valueText, { n: current, total: n, have: days[current - 1]?.have ?? "" })}
aria-orientation={vertical ? "vertical" : "horizontal"}
onKeyDown={onKey}
onPointerDown={(e) => {
if (e.pointerType === "mouse" && e.button !== 0) return
e.currentTarget.setPointerCapture(e.pointerId)
e.currentTarget.focus({ preventScroll: true })
dragRef.current = true
setDragging(true)
pick(e.clientX, e.clientY)
}}
onPointerMove={(e) => {
if (dragRef.current) pick(e.clientX, e.clientY)
}}
onPointerUp={stopDrag}
onPointerCancel={stopDrag}
onLostPointerCapture={stopDrag}
>
<span className="cfcb-track" aria-hidden="true" />
<span className="cfcb-fillbar" aria-hidden="true" />
{days.map((d, i) => (
<span key={d.have + i} className="cfcb-stop" data-on={i < current ? "" : undefined} aria-hidden="true" />
))}
<span className="cfcb-thumb" aria-hidden="true">
<GripVertical className="cfcb-g-x" size={16} strokeWidth={2.5} />
<GripHorizontal className="cfcb-g-y" size={16} strokeWidth={2.5} />
{fill(copy.dayLabel, { n: current })}
</span>
</div>
<h3 className="cfcb-h3 cfcb-ah">{fill(copy.haveTitle, { n: current })}</h3>
<ol className="cfcb-after">
{days.map((d, i) => {
const on = i < current
const isCurrent = i === current - 1
const isPayoff = i === n - 1
return (
<li
key={d.have + i}
data-on={on ? "" : undefined}
data-current={isCurrent ? "" : undefined}
style={vars({ "--d": delayFor(i) + "s" })}
onClick={() => setPicked(i + 1)}
>
<span className="cfcb-badge" aria-hidden="true">
{on ? <Check size={16} strokeWidth={3} /> : i + 1}
</span>
<span className="cfcb-have">
<span className="cfcb-day">
{fill(copy.dayLabel, { n: i + 1 })}
{isPayoff ? <span className="cfcb-flag">{copy.payoff}</span> : null}
</span>
<span className="cfcb-have-t">{d.have}</span>
<span className="cfcb-sr">{on ? copy.built : fill(copy.notYet, { n: i + 1 })}</span>
</span>
</li>
)
})}
</ol>
</div>
</div>
{hasSchedule ? (
<div className="cfcb-tile cfcb-card cfcb-sched" style={vars({ "--rd": "0.21s" })}>
<h3 className="cfcb-h3">{copy.scheduleTitle}</h3>
<ol className="cfcb-times">
{days.map((d, i) =>
times[i] ? (
<li key={d.have + i} data-current={i === current - 1 ? "" : undefined} onClick={() => setPicked(i + 1)}>
<span className="cfcb-tday">{fill(copy.dayLabel, { n: i + 1 })}</span>
<span className="cfcb-tdate">{times[i]?.date}</span>
<span className="cfcb-ttime">{times[i]?.time}</span>
</li>
) : null,
)}
</ol>
{zone ? (
<p className="cfcb-zone">
<Globe className="cfcb-ii" size={16} strokeWidth={2.5} aria-hidden="true" />
{fill(copy.zoneNote, { zone })}
</p>
) : null}
</div>
) : null}
<div className="cfcb-tile cfcb-card cfcb-action" style={vars({ "--rd": "0.28s" })}>
<div className="cfcb-pitch">
<h3 className="cfcb-h3">{copy.actionTitle}</h3>
{leadIns.map((p) => (
<p key={p.lead}>
<strong>{p.lead}</strong> {p.text}
</p>
))}
</div>
<div className="cfcb-go">
{href && !disabled ? (
<a className={btnClass} href={href} onClick={handleClick} aria-busy={busy || undefined}>
{btnInner}
</a>
) : (
<button type="button" className={btnClass} disabled={disabled} onClick={handleClick} aria-busy={busy || undefined}>
{btnInner}
</button>
)}
{ctaNote ? (
<p className="cfcb-note">
<CalendarCheck className="cfcb-ii" size={16} strokeWidth={2.5} aria-hidden="true" />
{ctaNote}
</p>
) : null}
{showError ? (
<p className="cfcb-err" role="alert">
<AlertCircle className="cfcb-ii" size={18} strokeWidth={2.5} aria-hidden="true" />
{errorText}
</p>
) : null}
</div>
</div>
</div>
</div>
</section>
)
}
export default ChallengeDays2
function vars(v: Record<string, string | number>): React.CSSProperties {
return v as React.CSSProperties
}
function fill(t: string, values: Record<string, string | number>) {
return Object.keys(values).reduce((s, k) => s.split("{" + k + "}").join(String(values[k])), t)
}
function formatWhen(iso: string, timeZone: string | undefined, locale: string) {
const at = new Date(iso)
if (Number.isNaN(at.getTime())) return null
try {
const date = new Intl.DateTimeFormat(locale, { weekday: "short", month: "short", day: "numeric", timeZone }).format(at)
const time = new Intl.DateTimeFormat(locale, { hour: "numeric", minute: "2-digit", timeZone, timeZoneName: "short" }).format(at)
return { date, time }
} catch {
return null
}
}
function Marked({ text, highlight }: { text: string; highlight?: string }) {
const at = highlight ? text.indexOf(highlight) : -1
if (!highlight || at < 0) return <>{text}</>
return (
<>
{text.slice(0, at)}
<span className="cfcb-hl">{highlight.replace(/(^|\s)(\S{1,2}) (?=\S)/g, "$1$2\u00a0")}</span>
{text.slice(at + highlight.length)}
</>
)
}
const SHADOW_SM = "var(--shadow-sm, 0 1px 1px oklch(from var(--cfcb-sh) l c h / 0.18), 0 1px 3px oklch(from var(--cfcb-sh) l c h / 0.14))"
const SHADOW_MD = "var(--shadow-md, 0 1px 2px oklch(from var(--cfcb-sh) l c h / 0.22), 0 4px 10px -2px oklch(from var(--cfcb-sh) l c h / 0.2))"
const SHADOW_LG = "var(--shadow-lg, 0 2px 4px oklch(from var(--cfcb-sh) l c h / 0.22), 0 12px 24px -8px oklch(from var(--cfcb-sh) l c h / 0.32))"
const FOCUS = "oklch(from var(--field-focus, var(--accent, #2563eb)) l c h / 0.6)"
const CSS = `
.cf-challenge-days-2 {
--cfcb-sh: var(--shadow, oklch(0.22 0.03 260));
--cfcb-line: var(--card-border, oklch(from var(--ink, #101828) l c h / 0.12));
--cfcb-quiet: color-mix(in oklch, var(--ink, #101828) 4%, var(--card, #ffffff));
--cfcb-pick: color-mix(in oklch, var(--accent, #2563eb) 10%, var(--card, #ffffff));
--cfcb-pick-line: color-mix(in oklch, var(--accent, #2563eb) 42%, var(--card, #ffffff));
--cfcb-fill: var(--accent-fill, var(--accent, #2563eb));
--cfcb-fill-ink: var(--accent-fill-ink, var(--card, #ffffff));
--cfcb-r: var(--card-radius, var(--radius, 14px));
--cfcb-marker-src: var(--marker, #fae37c);
--cfcb-marker: oklch(from var(--cfcb-marker-src) max(l, 0.88) c h);
--cfcb-marker-ink: oklch(from var(--cfcb-marker-src) 0.2 min(c, 0.04) h);
--cfcb-badge-ink: var(--status-glyph, #ffffff);
--cfcb-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
position: relative;
background: var(--surface, #ffffff);
color: var(--ink, #101828);
font-family: var(--font-body, system-ui, sans-serif);
padding: clamp(56px, 8vw, 112px) clamp(16px, 5vw, 48px) clamp(64px, 8.5vw, 120px);
overflow-x: clip;
}
.cf-challenge-days-2 *, .cf-challenge-days-2 *::before, .cf-challenge-days-2 *::after { box-sizing: border-box; }
.cf-challenge-days-2 .cfcb-wrap { max-width: 1120px; margin: 0 auto; container: cfcb / inline-size; }
.cf-challenge-days-2 .cfcb-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.cf-challenge-days-2 .cfcb-tile { border-radius: var(--cfcb-r); animation: cfcb-rise 0.45s var(--cfcb-ease) both; animation-delay: var(--rd, 0s); }
.cf-challenge-days-2 .cfcb-card { background: var(--card, #ffffff); color: var(--ink, #101828); border: 1px solid var(--cfcb-line); box-shadow: var(--card-shadow, ${SHADOW_MD}); }
.cf-challenge-days-2 .cfcb-h3 { margin: 0; font-family: var(--font-display, inherit); font-size: clamp(1.3125rem, 1.8vw, 1.625rem); line-height: 1.15; font-weight: var(--display-weight, 800); letter-spacing: -0.01em; text-transform: var(--display-case, none); text-wrap: balance; }
.cf-challenge-days-2 .cfcb-promise { position: relative; overflow: hidden; isolation: isolate; background: var(--band, #1b2540); color: var(--band-ink, #ffffff); padding: clamp(24px, 3.4vw, 40px); box-shadow: ${SHADOW_MD}, inset 0 1px 0 oklch(from var(--band-ink, #ffffff) l c h / 0.08); }
.cf-challenge-days-2 .cfcb-promise-in { position: relative; z-index: 1; }
.cf-challenge-days-2 .cfcb-h2 { margin: 0 0 16px; font-family: var(--font-display, inherit); font-size: clamp(2rem, 3.6vw, 3.25rem); line-height: 1.06; font-weight: var(--display-weight, 800); letter-spacing: var(--display-tracking, -0.025em); text-transform: var(--display-case, none); text-wrap: balance; }
.cf-challenge-days-2 .cfcb-hl { color: var(--cfcb-marker-ink); background: linear-gradient(transparent 8%, oklch(from var(--cfcb-marker) l c h / 1) 8%, oklch(from var(--cfcb-marker) l c h / 1) 99%, transparent 99%); padding: 0 0.08em; border-radius: 0.12em 0.24em 0.16em 0.28em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.cf-challenge-days-2 .cfcb-lead { margin: 0 0 24px; max-width: 60ch; font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.4; font-weight: 500; text-wrap: pretty; }
.cf-challenge-days-2 .cfcb-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cf-challenge-days-2 .cfcb-facts li { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 12px; border-radius: 999px; background: oklch(from var(--band-ink, #ffffff) l c h / 0.12); font-size: 0.875rem; font-weight: 800; line-height: 1.2; }
.cf-challenge-days-2 .cfcb-stage { margin: 0; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.cf-challenge-days-2 .cfcb-frame { position: relative; flex: 1 1 auto; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--cfcb-quiet); }
.cf-challenge-days-2 .cfcb-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; opacity: 0; transition: opacity 0.45s ease; }
.cf-challenge-days-2 .cfcb-frame img[data-on] { opacity: 1; }
.cf-challenge-days-2 .cfcb-cap { padding: 0 8px 8px; }
.cf-challenge-days-2 .cfcb-cap-t { margin: 0 0 4px; font-family: var(--font-display, inherit); font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.3; font-weight: 800; }
.cf-challenge-days-2 .cfcb-cap-d { margin: 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 500; color: var(--muted, #475467); text-wrap: pretty; }
.cf-challenge-days-2 .cfcb-build { padding: clamp(20px, 3vw, 32px); border-color: var(--cfcb-pick-line); box-shadow: ${SHADOW_LG}; container: cfcb-build / inline-size; }
.cf-challenge-days-2 .cfcb-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.cf-challenge-days-2 .cfcb-before, .cf-challenge-days-2 .cfcb-after { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cf-challenge-days-2 .cfcb-before li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 14px; border-radius: 10px; background: var(--cfcb-quiet); }
.cf-challenge-days-2 .cfcb-before-t { padding-top: 2px; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.35; font-weight: 500; text-wrap: pretty; }
.cf-challenge-days-2 .cfcb-minus { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; background: var(--secondary, oklch(0.93 0.015 263)); color: var(--secondary-ink, var(--ink, #101828)); }
.cf-challenge-days-2 .cfcb-hint { margin: 8px 0 -4px; text-align: center; font-size: 0.875rem; font-weight: 800; line-height: 1.2; color: var(--muted, #475467); text-wrap: balance; }
.cf-challenge-days-2 .cfcb-rail { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); height: 56px; align-items: center; justify-items: center; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; outline: none; -webkit-tap-highlight-color: transparent; }
.cf-challenge-days-2 .cfcb-rail.is-drag { cursor: grabbing; }
.cf-challenge-days-2 .cfcb-track, .cf-challenge-days-2 .cfcb-fillbar { position: absolute; border-radius: 999px; pointer-events: none; }
.cf-challenge-days-2 .cfcb-track { top: 50%; height: 6px; margin-top: -3px; left: calc(50% / var(--n)); right: calc(50% / var(--n)); background: oklch(from var(--ink, #101828) l c h / 0.1); }
.cf-challenge-days-2 .cfcb-fillbar { top: 50%; height: 6px; margin-top: -3px; left: calc(50% / var(--n)); width: calc((var(--d) - 1) / var(--n) * 100%); background: var(--cfcb-fill); transition: width 0.3s var(--cfcb-ease), height 0.3s var(--cfcb-ease); }
.cf-challenge-days-2 .cfcb-stop { position: relative; z-index: 1; width: 14px; height: 14px; border-radius: 999px; background: var(--card, #ffffff); border: 2px solid oklch(from var(--ink, #101828) l c h / 0.24); pointer-events: none; transition: background-color 0.2s ease, border-color 0.2s ease; }
.cf-challenge-days-2 .cfcb-stop[data-on] { background: var(--cfcb-fill); border-color: var(--cfcb-fill); }
.cf-challenge-days-2 .cfcb-thumb { position: absolute; z-index: 2; top: 50%; left: calc((var(--d) - 0.5) / var(--n) * 100%); transform: translate(-50%, -50%); display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; min-width: 80px; padding: 0 12px; border-radius: 999px; background: linear-gradient(oklch(from var(--cfcb-fill) calc(l + 0.02) c h), oklch(from var(--cfcb-fill) calc(l - 0.04) c h)); color: var(--cfcb-fill-ink); font-size: 0.875rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; box-shadow: inset 0 1px 0 oklch(from var(--cfcb-fill) calc(l + 0.14) c h / 0.6), 0 1px 2px oklch(from var(--cfcb-sh) l c h / 0.3), 0 6px 12px -4px oklch(from var(--cfcb-sh) l c h / 0.4); transition: left 0.3s var(--cfcb-ease), top 0.3s var(--cfcb-ease), transform 0.16s ease, background 0.16s ease; }
.cf-challenge-days-2 .cfcb-rail:hover .cfcb-thumb { background: linear-gradient(oklch(from var(--cfcb-fill) calc(l - 0.02) c h), oklch(from var(--cfcb-fill) calc(l - 0.08) c h)); }
.cf-challenge-days-2 .cfcb-rail.is-drag .cfcb-thumb { transform: translate(-50%, -50%) scale(1.05); box-shadow: inset 0 1px 0 oklch(from var(--cfcb-fill) calc(l + 0.14) c h / 0.6), 0 1px 2px oklch(from var(--cfcb-sh) l c h / 0.34), 0 8px 16px -4px oklch(from var(--cfcb-sh) l c h / 0.46); }
.cf-challenge-days-2 .cfcb-rail:focus-visible .cfcb-thumb { outline: 3px solid ${FOCUS}; outline-offset: 3px; }
.cf-challenge-days-2 .cfcb-g-y { display: none; }
.cf-challenge-days-2 .cfcb-after li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 14px; border-radius: 10px; border: 1px solid transparent; transition: background-color 0.3s ease var(--d, 0s), border-color 0.3s ease var(--d, 0s); }
.cf-challenge-days-2 .cfcb-after li { cursor: pointer; border-color: oklch(from var(--ink, #101828) l c h / 0.12); }
.cf-challenge-days-2 .cfcb-after li[data-on] { background: var(--cfcb-quiet); border-color: transparent; }
.cf-challenge-days-2 .cfcb-times li { cursor: pointer; }
@media (hover: hover) {
.cf-challenge-days-2 .cfcb-after li:not([data-current]):hover { border-color: oklch(from var(--ink, #101828) l c h / 0.26); }
.cf-challenge-days-2 .cfcb-times li:not([data-current]):hover { border-color: oklch(from var(--ink, #101828) l c h / 0.2); }
}
.cf-challenge-days-2 .cfcb-after li[data-current] { background: var(--cfcb-pick); border-color: var(--cfcb-pick-line); }
.cf-challenge-days-2 .cfcb-badge { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; border: 2px solid oklch(from var(--ink, #101828) l c h / 0.22); color: var(--muted, #475467); font-size: 0.875rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.cf-challenge-days-2 .cfcb-after li[data-on] .cfcb-badge { background: var(--success, #16803c); border-color: var(--success, #16803c); color: var(--cfcb-badge-ink); animation: cfcb-pop 0.3s var(--cfcb-ease) both; animation-delay: var(--d, 0s); }
.cf-challenge-days-2 .cfcb-have { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cf-challenge-days-2 .cfcb-day { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 800; line-height: 1.2; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted, #475467); }
.cf-challenge-days-2 .cfcb-flag { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 12px; border-radius: 999px; background: var(--cfcb-fill); color: var(--cfcb-fill-ink); font-size: 0.875rem; font-weight: 800; letter-spacing: 0.04em; }
.cf-challenge-days-2 .cfcb-have-t { font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.3; font-weight: 700; color: var(--muted, #475467); text-wrap: pretty; transition: color 0.3s ease var(--d, 0s); }
.cf-challenge-days-2 .cfcb-after li[data-on] .cfcb-have-t { color: var(--ink, #101828); }
.cf-challenge-days-2 .cfcb-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.cf-challenge-days-2 .cfcb-sched { padding: clamp(20px, 3vw, 28px); }
.cf-challenge-days-2 .cfcb-sched .cfcb-h3 { margin-bottom: 16px; }
.cf-challenge-days-2 .cfcb-times { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cf-challenge-days-2 .cfcb-times li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; background: var(--cfcb-quiet); font-size: 0.9375rem; line-height: 1.3; transition: background-color 0.2s ease, border-color 0.2s ease; }
.cf-challenge-days-2 .cfcb-times li[data-current] { background: var(--cfcb-pick); border-color: var(--cfcb-pick-line); }
.cf-challenge-days-2 .cfcb-tday { font-weight: 800; white-space: nowrap; }
.cf-challenge-days-2 .cfcb-tdate { font-weight: 500; color: var(--muted, #475467); }
.cf-challenge-days-2 .cfcb-ttime { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cf-challenge-days-2 .cfcb-zone { margin: 12px 0 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 500; color: var(--muted, #475467); text-wrap: pretty; }
.cf-challenge-days-2 .cfcb-ii { display: inline-block; vertical-align: -0.15em; margin-inline-end: 0.4em; }
.cf-challenge-days-2 .cfcb-action { display: grid; gap: 24px; padding: clamp(24px, 3.4vw, 40px); }
.cf-challenge-days-2 .cfcb-pitch .cfcb-h3 { margin-bottom: 12px; }
.cf-challenge-days-2 .cfcb-pitch p { margin: 0 0 8px; max-width: 64ch; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5; text-wrap: pretty; }
.cf-challenge-days-2 .cfcb-pitch p:last-child { margin-bottom: 0; }
.cf-challenge-days-2 .cfcb-pitch strong { font-weight: 800; }
.cf-challenge-days-2 .cfcb-go { display: flex; flex-direction: column; align-items: stretch; gap: 12px; width: 100%; }
.cf-challenge-days-2 .cfcb-btn {
--cfcb-b: var(--button-bg, var(--cta, #dc2626));
--cfcb-b2: var(--button-bg-2, var(--cta-2, #b91c1c));
appearance: none; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 72px; padding: 12px 28px;
border-radius: var(--button-radius, var(--radius, 12px));
font-family: var(--button-font, var(--font-display, inherit)); font-size: clamp(1.125rem, 1.55vw, 1.375rem); font-weight: var(--button-weight, 800); text-transform: var(--button-case, none); line-height: 1.15; text-align: center; text-wrap: balance; text-decoration: none;
color: var(--button-ink, var(--cta-ink, #ffffff)); text-shadow: var(--button-text-shadow, none);
background: linear-gradient(oklch(from var(--cfcb-b) calc(l + 0.04) c h), oklch(from var(--cfcb-b2) calc(l - 0.02) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--cfcb-b) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--cfcb-b) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--cfcb-sh) l c h / 0.3), 0 8px 16px -6px oklch(from var(--cfcb-sh) l c h / 0.45));
cursor: pointer; transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.cf-challenge-days-2 .cfcb-btn:hover:not(:disabled), .cf-challenge-days-2 .cfcb-btn.is-hover:not(:disabled) {
background: linear-gradient(oklch(from var(--cfcb-b) calc(l - 0.01) c h), oklch(from var(--cfcb-b2) calc(l - 0.07) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--cfcb-b) calc(l + 0.12) c h / 0.7), inset 0 -3px 0 oklch(from var(--cfcb-b) calc(l - 0.18) c h), 0 1px 2px oklch(from var(--cfcb-sh) l c h / 0.32), 0 10px 20px -6px oklch(from var(--cfcb-sh) l c h / 0.5));
transform: translateY(-1px);
}
.cf-challenge-days-2 .cfcb-btn:active:not(:disabled), .cf-challenge-days-2 .cfcb-btn.is-active:not(:disabled) {
transform: translateY(1px);
background: linear-gradient(oklch(from var(--cfcb-b) calc(l - 0.05) c h), oklch(from var(--cfcb-b2) calc(l - 0.09) c h));
box-shadow: inset 0 2px 4px oklch(from var(--cfcb-sh) l c h / 0.35), inset 0 -2px 0 oklch(from var(--cfcb-b) calc(l - 0.18) c h), 0 1px 2px oklch(from var(--cfcb-sh) l c h / 0.3);
}
.cf-challenge-days-2 .cfcb-btn:focus-visible { outline: 3px solid ${FOCUS}; outline-offset: 3px; }
.cf-challenge-days-2 .cfcb-btn:disabled { background: var(--button-2-bg, var(--secondary, oklch(0.93 0.015 263))); color: var(--button-2-ink, var(--secondary-ink, #101828)); text-shadow: none; box-shadow: var(--button-2-shadow, ${SHADOW_SM}); cursor: not-allowed; transform: none; }
.cf-challenge-days-2 .cfcb-btn[aria-busy='true'] { cursor: progress; }
.cf-challenge-days-2 .cfcb-spin { flex: 0 0 auto; animation: cfcb-spin 0.8s linear infinite; }
.cf-challenge-days-2 .cfcb-note { margin: 0; text-align: center; font-size: 0.9375rem; line-height: 1.4; font-weight: 500; color: var(--muted, #475467); text-wrap: pretty; }
.cf-challenge-days-2 .cfcb-err { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--danger-soft, oklch(0.93 0.024 27)); color: var(--danger, oklch(0.5 0.17 27)); font-size: 0.9375rem; line-height: 1.4; font-weight: 600; text-wrap: pretty; }
@container cfcb (max-width: 480px) {
.cf-challenge-days-2 .cfcb-btn { padding: 12px 18px; }
}
@container cfcb (max-width: 400px) {
.cf-challenge-days-2 .cfcb-btn { padding: 12px 14px; font-size: 1.0625rem; }
}
@container cfcb (min-width: 860px) {
.cf-challenge-days-2 .cfcb-grid { gap: 20px; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); grid-template-areas: "promise promise" "builder builder" "action action"; }
.cf-challenge-days-2 .cfcb-grid[data-img][data-sched] { grid-template-areas: "promise image" "builder image" "builder sched" "action action"; }
.cf-challenge-days-2 .cfcb-grid[data-img]:not([data-sched]) { grid-template-areas: "promise image" "builder image" "action action"; }
.cf-challenge-days-2 .cfcb-grid[data-sched]:not([data-img]) { grid-template-areas: "promise sched" "builder sched" "action action"; }
.cf-challenge-days-2 .cfcb-promise { grid-area: promise; }
.cf-challenge-days-2 .cfcb-stage { grid-area: image; }
.cf-challenge-days-2 .cfcb-build { grid-area: builder; }
.cf-challenge-days-2 .cfcb-sched { grid-area: sched; }
.cf-challenge-days-2 .cfcb-action { grid-area: action; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); column-gap: 48px; align-items: start; }
.cf-challenge-days-2 .cfcb-frame { aspect-ratio: auto; min-height: 320px; }
}
@container cfcb-build (min-width: 600px) {
.cf-challenge-days-2 .cfcb-split { grid-template-columns: minmax(0, 0.8fr) 88px minmax(0, 1.3fr); grid-template-rows: auto 1fr; column-gap: 20px; row-gap: 16px; }
.cf-challenge-days-2 .cfcb-bh { grid-column: 1; grid-row: 1; align-self: end; }
.cf-challenge-days-2 .cfcb-bl { grid-column: 1; grid-row: 2; align-self: start; }
.cf-challenge-days-2 .cfcb-hint { grid-column: 2; grid-row: 1; align-self: end; margin: 0; }
.cf-challenge-days-2 .cfcb-rail { grid-column: 2; grid-row: 2; height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(var(--n), minmax(0, 1fr)); touch-action: pan-x; }
.cf-challenge-days-2 .cfcb-track { top: calc(50% / var(--n)); bottom: calc(50% / var(--n)); left: 50%; right: auto; width: 6px; height: auto; margin: 0 0 0 -3px; }
.cf-challenge-days-2 .cfcb-fillbar { top: calc(50% / var(--n)); left: 50%; width: 6px; margin: 0 0 0 -3px; height: calc((var(--d) - 1) / var(--n) * 100%); }
.cf-challenge-days-2 .cfcb-thumb { left: 50%; top: calc((var(--d) - 0.5) / var(--n) * 100%); }
.cf-challenge-days-2 .cfcb-g-x { display: none; }
.cf-challenge-days-2 .cfcb-g-y { display: block; }
.cf-challenge-days-2 .cfcb-ah { grid-column: 3; grid-row: 1; align-self: end; }
.cf-challenge-days-2 .cfcb-after { grid-column: 3; grid-row: 2; display: grid; grid-template-rows: repeat(var(--n), minmax(0, 1fr)); gap: 0; }
.cf-challenge-days-2 .cfcb-after li { margin: 4px 0; }
}
@keyframes cfcb-rise { from { opacity: 0.82; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cfcb-pop { from { transform: scale(0.9); } to { transform: scale(1); } }
@keyframes cfcb-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
.cf-challenge-days-2 *, .cf-challenge-days-2 *::before, .cf-challenge-days-2 *::after { animation: none !important; transition: none !important; }
.cf-challenge-days-2 .cfcb-btn:hover:not(:disabled), .cf-challenge-days-2 .cfcb-btn.is-hover:not(:disabled) { transform: none; }
}
`
pieces/content/challenge-days-2/specimen.tsx 55 lines
import __studioImage613660bf from "../assets/e3a0b3c15d60527e.webp";
import __studioImage751649d3 from "../assets/9252eead2973c3fa.webp";
import __studioImageaf1f976d from "../assets/79b9b3fc9add054b.webp";
import ChallengeDays2, { challengeBuildDays, type ChallengeDays2State } from "../challenge-days-2"
import defaults from "../../studio-defaults.json"
import { slot } from "../../slots"
export const states = ["default", "hover", "active", "disabled", "error"]
// Calm Mornings, a fictional five-day challenge: live each weekday at 6:30 AM New York time.
const STARTS = [
"2026-12-07T11:30:00Z",
"2026-12-08T11:30:00Z",
"2026-12-09T11:30:00Z",
"2026-12-10T11:30:00Z",
"2026-12-11T11:30:00Z",
]
export default function ChallengeDays2Specimen({ state }: { state?: ChallengeDays2State }) {
return (
<ChallengeDays2
state={state}
initialDay={3}
lead="Join the free Calm Mornings Challenge with Coach Nora Hale. Slide through the five days to see what you'll have built by each morning."
days={challengeBuildDays.map((d, i) => ({ ...d, startsAt: STARTS[i] }))}
timeZone="America/New_York"
timeZoneLabel="Eastern Time (New York)"
stages={[
{
src: slot(
"scene",
__studioImage613660bf,
),
alt: "A bare nightstand with only a glowing phone alarm before dawn",
},
{
src: slot(
"scene",
__studioImage751649d3,
),
alt: "The nightstand at first light with water, a notebook and a rolled mat set out",
},
{
src: slot(
"scene",
__studioImageaf1f976d,
),
alt: "A sunlit corner set for a calm morning with a mat, tea, a journal and the phone put away",
},
]}
errorText={defaults.sample.registration.error}
onAction={() => undefined}
/>
)
}
| Name | Type | Details |
|---|---|---|
heading OptionalChallengeDays2 |
string |
|
highlight OptionalChallengeDays2 |
string |
|
lead OptionalChallengeDays2 |
string |
|
facts OptionalChallengeDays2 |
string[] |
|
startWith OptionalChallengeDays2 |
string[] |
|
days OptionalChallengeDays2 |
ChallengeBuildDay[] |
|
stages OptionalChallengeDays2 |
ChallengeBuildStage[] |
|
initialDay OptionalChallengeDays2 |
number |
|
timeZone OptionalChallengeDays2 |
string |
|
timeZoneLabel OptionalChallengeDays2 |
string |
|
locale OptionalChallengeDays2 |
string |
|
leadIns OptionalChallengeDays2 |
ChallengeDays2LeadIn[] |
|
ctaLabel OptionalChallengeDays2 |
string |
|
ctaNote OptionalChallengeDays2 |
string |
|
href OptionalChallengeDays2 |
string |
|
onAction OptionalChallengeDays2 |
() => void | Promise<void> |
|
errorText OptionalChallengeDays2 |
string |
|
copy OptionalChallengeDays2 |
Partial<ChallengeDays2Copy> |
|
state OptionalChallengeDays2 |
ChallengeDays2State |
|
className OptionalChallengeDays2 |
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.
scene- A wide atmosphere photo behind or beside the copy.
-
79b9b3fc9add054b.webp
image/webp · 45.3 KB
-
9252eead2973c3fa.webp
image/webp · 59.1 KB
-
986367d82c360c9a.webp
image/webp · 102 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
e3a0b3c15d60527e.webp
image/webp · 35.6 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB