Challenge Hero 5
Signs neighbors up for a community challenge: one big join card in the spotlight on a dark track stage, with the weeks, the host, the meet-up spot and optional proof in a row of tiles beneath it.
Use it in a prompt
Use hero/challenge-hero-5 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/hero/challenge-hero-5.tsx. - Import it and pass your copy and images (Props tab):
import { ChallengeHero5 } from "@/components/funneldna/hero/challenge-hero-5"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/challenge-hero-5/component.tsx 626 lines
// layout: spotlight-row
// Signs neighbors up for a community challenge: one big join card in the spotlight on a dark track stage, with the weeks, the host, the meet-up spot and optional proof in a row of tiles beneath it.
import * as React from 'react'
import { AlertCircle, Check, Loader2, Lock, MapPin, Quote } from 'lucide-react'
import { Backdrop, FX_HOST, Spot } from '../fx/fx'
import track from '../fx/backdrops/track'
import community from '../fx/spots/community'
import pin from '../fx/spots/pin'
export type ChallengeHero5State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type ChallengeHero5Week = {
/** What the group works up to that week */
title: string
/** Overrides the generated Week N label */
label?: string
}
export type ChallengeHero5Note = {
/** Bold lead-in phrase that opens the paragraph */
lead: string
text: string
}
export type ChallengeHero5Props = {
headline?: string
/** One continuous phrase inside the headline that gets the marker stroke */
highlight?: string
/** Short paragraphs under the headline, each opening with a bold lead-in */
notes?: ChallengeHero5Note[]
/** Challenge name, used in the join card title */
name?: string
/** {name} is replaced with the challenge name as text. */
joinTitle?: string
/** Quiet chip beside the join card title */
chip?: string
nameLabel?: string
namePlaceholder?: string
emailLabel?: string
emailPlaceholder?: string
reminderLabel?: string
reminderHint?: string
phoneLabel?: string
phonePlaceholder?: string
/** Consent and frequency note beside the phone field */
phoneNote?: string
/** Screen-reader line when the number passes validation */
phoneValidLabel?: string
label?: string
loadingLabel?: string
privacy?: string
error?: string
nameError?: string
emailError?: string
phoneRequiredError?: string
phoneError?: string
/** One rung per week. The count in the tile title comes from this list. */
weeks?: ChallengeHero5Week[]
/** {week} is replaced with the one-based week number as text. */
weekLabel?: string
/** {count} and {unit} are replaced with the week count and unit as text. */
weeksTitle?: string
weekUnit?: string
weekUnitSingular?: string
/** Host portrait (presenter slot) */
hostImage?: string
/** {name} is replaced with the host name as text. */
hostImageAlt?: string
hostName?: string
hostRole?: string
placeName?: string
placeDetail?: string
/** Optional map link for the meet-up spot */
placeHref?: string
placeLinkLabel?: string
/** The proof tile shows only when a quote is supplied */
proofQuote?: string
proofName?: string
/** Stage photo (fx backdrop asset); a page's scene image replaces it */
backdrop?: string
/** Start with text reminders switched on */
reminders?: boolean
disabled?: boolean
state?: ChallengeHero5State
/** Receives validated values (name, email, reminders, and phone when reminders are on). A returned promise shows the loading label; a rejection shows `error`. */
onSubmit?: (values: Record<string, string>) => void | Promise<void>
className?: string
style?: React.CSSProperties
}
export function ChallengeHero5({
headline = 'Run your first 5K with your neighbors beside you',
highlight = 'first 5K',
notes = DEFAULT_NOTES,
name = 'Riverside 5K in 5 Weeks',
joinTitle = 'Join the {name}',
chip = 'Free · All paces welcome',
nameLabel = 'First name',
namePlaceholder = 'Dana',
emailLabel = 'Email address',
emailPlaceholder = 'you@example.com',
reminderLabel = 'Text me a reminder before each run',
reminderHint = 'Optional · Switch it off anytime',
phoneLabel = 'Mobile number',
phonePlaceholder = '(555) 123-4567',
phoneNote = 'One text before each meet-up. Msg & data rates may apply. Reply STOP to opt out.',
phoneValidLabel = 'Mobile number looks good.',
label = 'Yes! I’m in for the Riverside 5K',
loadingLabel = 'Saving your spot…',
privacy = 'We respect your inbox. Unsubscribe anytime.',
error = 'We couldn’t complete your registration. Please try again.',
nameError = 'Please enter your first name.',
emailError = 'Please enter a valid email address.',
phoneRequiredError = 'Add your mobile number, or switch reminders off.',
phoneError = 'Enter a mobile number with at least 10 digits.',
weeks = DEFAULT_WEEKS,
weekLabel = 'Week {week}',
weeksTitle = '{count} {unit}, one step at a time',
weekUnit = 'weeks',
weekUnitSingular = 'week',
hostImage,
hostImageAlt = 'Portrait of {name}',
hostName = 'Coach Jordan Ellis',
hostRole = 'Leads every group run, from the first walk to the finish.',
placeName = 'Riverside Park boathouse',
placeDetail = 'Every group run starts and finishes on the boathouse steps.',
placeHref,
placeLinkLabel = 'Get directions',
proofQuote = '',
proofName = '',
backdrop = track,
reminders = false,
disabled = false,
state = 'default',
onSubmit,
className,
style,
}: ChallengeHero5Props) {
const uid = React.useId().replace(/:/g, '')
const isDisabled = disabled || state === 'disabled'
const [remind, setRemind] = React.useState(reminders || state === 'error')
const [phone, setPhone] = React.useState('')
const [errors, setErrors] = React.useState<Errors>(() =>
state === 'error' ? { email: emailError, phone: phoneRequiredError } : {},
)
const [status, setStatus] = React.useState<Status>('idle')
const mounted = React.useRef(true)
React.useEffect(() => {
setRemind(reminders || state === 'error')
setErrors(state === 'error' ? { email: emailError, phone: phoneRequiredError } : {})
setStatus('idle')
}, [state, reminders, emailError, phoneRequiredError])
React.useEffect(() => {
mounted.current = true
return () => {
mounted.current = false
}
}, [])
const loading = status === 'loading'
const live = !isDisabled && !loading
const digits = phone.replace(/\D/g, '').length
const phoneOk = digits >= 10 && digits <= 15
const n = weeks.length
const hasProof = proofQuote.trim().length > 0
const id = (key: string) => `${uid}-${key}`
const clear = (key: keyof Errors) =>
setErrors((prev) => {
if (!prev[key]) return prev
const next = { ...prev }
delete next[key]
return next
})
const toggle = () => {
if (isDisabled) return
const next = !remind
setRemind(next)
if (!next) clear('phone')
}
const checkPhone = () => {
if (digits && !phoneOk) setErrors((prev) => ({ ...prev, phone: phoneError }))
}
const handleSubmit = async (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault()
if (!live) return
const form = event.currentTarget
const data = new FormData(form)
const values: Record<string, string> = {
name: String(data.get('name') ?? '').trim(),
email: String(data.get('email') ?? '').trim(),
reminders: remind ? 'yes' : 'no',
}
const next: Errors = {}
if (!values.name) next.name = nameError
if (!EMAIL.test(values.email)) next.email = emailError
if (remind) {
values.phone = phone.trim()
if (!digits) next.phone = phoneRequiredError
else if (!phoneOk) next.phone = phoneError
}
setErrors(next)
setStatus('idle')
const first = FIELD_ORDER.find((key) => next[key])
if (first) {
const input = form.elements.namedItem(first)
if (input instanceof HTMLInputElement) input.focus()
return
}
try {
const result: unknown = onSubmit?.(values)
if (!result || typeof (result as PromiseLike<void>).then !== 'function') return
setStatus('loading')
await (result as PromiseLike<void>)
if (mounted.current) setStatus('idle')
} catch {
if (mounted.current) setStatus('error')
}
}
const at = highlight ? headline.indexOf(highlight) : -1
const h1 =
at < 0 ? (
headline
) : (
<>
{headline.slice(0, at)}
<span className='c5-hl'>{highlight}</span>
{headline.slice(at + highlight.length)}
</>
)
const btnClass = [
'c5-btn',
live && state === 'hover' ? 'is-hover' : '',
live && state === 'active' ? 'is-active' : '',
loading ? 'is-loading' : '',
]
.filter(Boolean)
.join(' ')
const showOk = remind && phoneOk && !errors.phone
return (
<section
className={['cf-challenge-hero-5', className].filter(Boolean).join(' ')}
style={{ ...FX_HOST, ...style }}
aria-labelledby={id('h')}
>
<style>{CSS}</style>
<Backdrop src={backdrop} treatment='scrim-dark' position='center 40%' />
<div className='c5-wrap'>
<header className='c5-head c5-rv' style={delay(0)}>
<h1 id={id('h')} className='c5-h1'>
{h1}
</h1>
{notes.length ? (
<div className='c5-notes'>
{notes.map((note, i) => (
<p key={i} className='c5-note'>
<strong>{note.lead}</strong> {note.text}
</p>
))}
</div>
) : null}
</header>
<div className='c5-join c5-rv' style={delay(1)}>
<div className='c5-jtop'>
<h2 id={id('j')} className='c5-jtitle'>
{fill(joinTitle, { name })}
</h2>
{chip ? <span className='c5-chip'>{chip}</span> : null}
</div>
<form className='c5-form' noValidate onSubmit={handleSubmit} aria-labelledby={id('j')} aria-busy={loading || undefined}>
<div className='c5-fields'>
<div className='c5-field'>
<label htmlFor={id('name')} className='c5-label'>
{nameLabel}
</label>
<input
id={id('name')}
className='c5-input'
name='name'
type='text'
autoComplete='given-name'
placeholder={namePlaceholder}
disabled={isDisabled}
aria-invalid={errors.name ? true : undefined}
aria-describedby={errors.name ? id('name-err') : undefined}
onChange={() => clear('name')}
/>
{errors.name ? <FieldError id={id('name-err')} text={errors.name} /> : null}
</div>
<div className='c5-field'>
<label htmlFor={id('email')} className='c5-label'>
{emailLabel}
</label>
<input
id={id('email')}
className='c5-input'
name='email'
type='email'
inputMode='email'
autoComplete='email'
placeholder={emailPlaceholder}
disabled={isDisabled}
aria-invalid={errors.email ? true : undefined}
aria-describedby={errors.email ? id('email-err') : undefined}
onChange={() => clear('email')}
/>
{errors.email ? <FieldError id={id('email-err')} text={errors.email} /> : null}
</div>
<button type='submit' className={btnClass} disabled={isDisabled || loading}>
{loading ? (
<>
<Loader2 className='c5-spin' size={20} strokeWidth={2.5} aria-hidden='true' />
<span>{loadingLabel}</span>
</>
) : (
<span>{label}</span>
)}
</button>
</div>
<div className='c5-foot'>
<button
type='button'
role='switch'
aria-checked={remind}
aria-controls={remind ? id('pw') : undefined}
className='c5-switch'
onClick={toggle}
disabled={isDisabled}
>
<span className='c5-track' aria-hidden='true'>
<span className='c5-thumb' />
</span>
<span className='c5-stext'>
<span className='c5-stitle'>{reminderLabel}</span>
{reminderHint ? <span className='c5-shint'>{reminderHint}</span> : null}
</span>
</button>
{privacy ? (
<p className='c5-privacy'>
<Lock size={16} strokeWidth={2.5} aria-hidden='true' />
{privacy}
</p>
) : null}
</div>
{remind ? (
<div className='c5-phone' id={id('pw')}>
<div className='c5-field'>
<label htmlFor={id('phone')} className='c5-label'>
{phoneLabel}
</label>
<div className='c5-iw'>
<input
id={id('phone')}
className='c5-input'
name='phone'
type='tel'
inputMode='tel'
autoComplete='tel'
placeholder={phonePlaceholder}
value={phone}
disabled={isDisabled}
aria-invalid={errors.phone ? true : undefined}
aria-describedby={[errors.phone ? id('phone-err') : '', phoneNote ? id('pn') : ''].filter(Boolean).join(' ') || undefined}
onChange={(event) => {
setPhone(event.target.value)
clear('phone')
}}
onBlur={checkPhone}
/>
{showOk ? (
<span className='c5-ok' aria-hidden='true'>
<Check size={16} strokeWidth={3} />
</span>
) : null}
</div>
{errors.phone ? <FieldError id={id('phone-err')} text={errors.phone} /> : null}
<span className='c5-sr' aria-live='polite'>
{showOk ? phoneValidLabel : ''}
</span>
</div>
{phoneNote ? (
<p id={id('pn')} className='c5-pnote'>
{phoneNote}
</p>
) : null}
</div>
) : null}
{status === 'error' ? (
<p className='c5-alert' role='alert'>
<AlertCircle size={18} strokeWidth={2.5} aria-hidden='true' />
{error}
</p>
) : null}
</form>
</div>
<div className={`c5-row${hasProof ? ' has-proof' : ''}`}>
{n ? (
<div className='c5-tile c5-weeks c5-rv' style={delay(2)}>
<h3 className='c5-ttitle'>{fill(weeksTitle, { count: String(n), unit: n === 1 ? weekUnitSingular : weekUnit })}</h3>
<ol className='c5-ladder'>
{weeks.map((week, i) => (
<li key={i} className='c5-rung'>
<span className='c5-wk'>{week.label ?? fill(weekLabel, { week: String(i + 1) })}</span>
<span className='c5-wt'>{week.title}</span>
<span className='c5-bar' aria-hidden='true'>
<i style={{ '--c5-w': `${((i + 1) / n) * 100}%`, '--c5-d': `${Math.min(i * 0.07, 0.28) + 0.2}s` } as React.CSSProperties} />
</span>
</li>
))}
</ol>
</div>
) : null}
{hostName ? (
<div className='c5-tile c5-host c5-rv' style={delay(3)}>
{hostImage ? (
<img className='c5-photo' src={hostImage} alt={fill(hostImageAlt, { name: hostName })} width={480} height={360} loading='lazy' decoding='async' />
) : (
<span className='c5-spot'>
<Spot src={community} size={72} shade='band' light='band-ink' />
</span>
)}
<div className='c5-tbody'>
<h3 className='c5-ttitle'>{hostName}</h3>
{hostRole ? <p className='c5-soft'>{hostRole}</p> : null}
</div>
</div>
) : null}
{placeName ? (
<div className='c5-tile c5-place c5-rv' style={delay(4)}>
<span className='c5-spot'>
<Spot src={pin} size={64} shade='band' light='band-ink' />
</span>
<div className='c5-tbody'>
<h3 className='c5-ttitle'>{placeName}</h3>
{placeDetail ? <p className='c5-soft'>{placeDetail}</p> : null}
{placeHref ? (
<a className='c5-link' href={placeHref}>
<MapPin size={16} strokeWidth={2.5} aria-hidden='true' />
{placeLinkLabel}
</a>
) : null}
</div>
</div>
) : null}
{hasProof ? (
<figure className='c5-tile c5-proof c5-rv' style={delay(4)}>
<Quote size={24} strokeWidth={2.5} aria-hidden='true' />
<blockquote>{proofQuote}</blockquote>
{proofName ? <figcaption>{proofName}</figcaption> : null}
</figure>
) : null}
</div>
</div>
</section>
)
}
export default ChallengeHero5
function FieldError({ id, text }: { id: string; text: string }) {
return (
<p id={id} className='c5-err'>
<AlertCircle size={16} strokeWidth={2.5} aria-hidden='true' />
{text}
</p>
)
}
type Status = 'idle' | 'loading' | 'error'
type Errors = { name?: string; email?: string; phone?: string }
const FIELD_ORDER = ['name', 'email', 'phone'] as const
const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
function fill(template: string, values: Record<string, string>) {
return template.replace(/\{(\w+)\}/g, (match, key: string) => (key in values ? values[key] : match))
}
function delay(i: number) {
return { '--c5-d': `${Math.min(i * 0.07, 0.28)}s` } as React.CSSProperties
}
const DEFAULT_NOTES: ChallengeHero5Note[] = [
{ lead: 'Start where you are.', text: 'Week one is walking with short, easy jogs. No race pace, no pressure.' },
{ lead: 'Run it together.', text: 'Meet the group by the river, follow one simple plan, and finish side by side.' },
]
const DEFAULT_WEEKS: ChallengeHero5Week[] = [
{ title: 'Walk–run intervals' },
{ title: 'Jog five minutes at a time' },
{ title: 'Jog ten minutes at a time' },
{ title: 'Run twenty minutes straight' },
{ title: 'Run the full 5K together' },
]
const R = '.cf-challenge-hero-5'
const CSS = `
${R}{--c5-sh:var(--shadow,oklch(0.22 0.03 260));--c5-marker:var(--accent-fill,var(--accent));--c5-soft:color-mix(in oklab,var(--band-ink) 85%,var(--band));--c5-tile:color-mix(in oklab,var(--band-ink) 7%,var(--band));--c5-ring:var(--field-focus,var(--accent));--c5-off:color-mix(in oklab,var(--ink) 34%,var(--card));--c5-knob:oklch(from var(--card) max(l,.98) 0 h);position:relative;isolation:isolate;overflow:hidden;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)}
${R} *,${R} *::before,${R} *::after{box-sizing:border-box}
${R} .c5-wrap{position:relative;z-index:1;max-width:1120px;margin:0 auto;display:grid;gap:clamp(24px,3vw,32px)}
${R} .c5-head{display:grid;gap:24px}
${R} .c5-h1{margin:0;font-family:var(--font-display);font-size:clamp(2.5rem,5.4vw,4.875rem);line-height:1.04;font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);text-wrap:balance;color:var(--band-ink)}
${R} .c5-hl{color:inherit;padding:0 .08em;margin:0 -.04em;background-image:linear-gradient(color-mix(in oklab,var(--c5-marker) 50%,transparent),color-mix(in oklab,var(--c5-marker) 50%,transparent));background-repeat:no-repeat;background-size:100% 44%;background-position:0 90%;-webkit-box-decoration-break:clone;box-decoration-break:clone}
${R} .c5-notes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px clamp(24px,4vw,48px);max-width:56rem}
${R} .c5-note{margin:0;font-size:clamp(1.125rem,1.5vw,1.375rem);font-weight:500;line-height:1.4;text-wrap:pretty;color:var(--band-ink)}
${R} .c5-note strong{font-weight:800}
${R} .c5-join{background:var(--card);color:var(--ink);border:1px solid oklch(from var(--accent) l c h / .42);border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--shadow-lg,0 2px 4px oklch(from var(--c5-sh) l c h / .22),0 12px 24px -8px oklch(from var(--c5-sh) l c h / .32));padding:clamp(20px,3vw,32px)}
${R} .c5-jtop{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 16px;margin-bottom:24px}
${R} .c5-jtitle{margin:0;font-family:var(--font-display);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-transform:var(--display-case,none);text-wrap:balance;color:var(--ink)}
${R} .c5-chip{display:inline-flex;align-items:center;min-height:30px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch,var(--ink) 6%,var(--card));color:var(--ink);font-size:.875rem;font-weight:800;line-height:1.2}
${R} .c5-form{display:grid;gap:16px}
${R} .c5-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr) auto;gap:16px;align-items:start}
${R} .c5-field{display:grid;gap:8px;min-width:0}
${R} .c5-label{font-size:1rem;font-weight:700;line-height:1.3;color:var(--label-ink,var(--ink))}
${R} .c5-input{display:block;width:100%;height:56px;padding:0 16px;margin:0;font:inherit;font-size:1.0625rem;font-weight:500;color:var(--field-ink);background:var(--field);border:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));outline:none;appearance:none;transition:border-color .16s ease,box-shadow .16s ease}
${R} .c5-input::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
${R} .c5-input:hover:not(:disabled){border-color:color-mix(in oklch,var(--ink) 42%,transparent)}
${R} .c5-input:focus{border-color:var(--c5-ring);box-shadow:0 0 0 3px oklch(from var(--c5-ring) l c h / .35)}
${R} .c5-input[aria-invalid=true]{border-color:var(--danger)}
${R} .c5-input[aria-invalid=true]:focus{box-shadow:0 0 0 3px oklch(from var(--danger) l c h / .3)}
${R} .c5-input:disabled{background:color-mix(in oklch,var(--ink) 5%,var(--field));cursor:not-allowed}
${R} .c5-iw{position:relative}
${R} .c5-iw .c5-input{padding-right:52px}
${R} .c5-ok{position:absolute;top:50%;right:16px;display:grid;place-items:center;width:24px;height:24px;margin-top:-12px;border-radius:50%;background:var(--success);color:var(--c5-badge-ink,#fff);animation:c5-pop .3s cubic-bezier(.2,.7,.2,1) both}
${R} .c5-err{margin:0;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--danger);text-wrap:pretty}
${R} .c5-err svg,${R} .c5-privacy svg,${R} .c5-alert svg,${R} .c5-link svg{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em}
${R} .c5-btn{--c5-b:var(--button-bg,var(--cta));position:relative;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:56px;margin-top:calc(1rem * 1.3 + 8px);padding:0 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--c5-b) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .02) c h));color:var(--button-ink,var(--cta-ink));font-family:var(--button-font,var(--font-display));font-size:clamp(1.125rem,1.55vw,1.375rem);font-weight:var(--button-weight,800);line-height:1.15;text-transform:var(--button-case,none);text-align:center;white-space:nowrap;text-shadow:var(--button-text-shadow,none);cursor:pointer;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--c5-b) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--c5-b) calc(l - .16) c h),0 1px 2px oklch(from var(--c5-sh) l c h / .3),0 8px 16px -6px oklch(from var(--c5-sh) l c h / .45));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
${R} .c5-btn:hover:not(:disabled),${R} .c5-btn.is-hover{background:linear-gradient(oklch(from var(--c5-b) 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(--c5-b) calc(l + .1) c h / .7),inset 0 -3px 0 oklch(from var(--c5-b) calc(l - .2) c h),0 1px 2px oklch(from var(--c5-sh) l c h / .34),0 10px 20px -6px oklch(from var(--c5-sh) l c h / .55))}
${R} .c5-btn:active:not(:disabled),${R} .c5-btn.is-active{transform:translateY(1px);background:linear-gradient(oklch(from var(--c5-b) calc(l - .05) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .09) c h));box-shadow:inset 0 2px 4px oklch(from var(--c5-b) calc(l - .22) c h / .5),inset 0 -2px 0 oklch(from var(--c5-b) calc(l - .16) c h),0 1px 2px oklch(from var(--c5-sh) l c h / .3)}
${R} .c5-btn:focus-visible{outline:3px solid var(--c5-ring);outline-offset:3px}
${R} .c5-btn:disabled:not(.is-loading){background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));text-shadow:none;box-shadow:var(--button-2-shadow,var(--shadow-sm));cursor:not-allowed}
${R} .c5-btn.is-loading{cursor:progress}
${R} .c5-spin{animation:c5-spin .8s linear infinite}
${R} .c5-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 24px}
${R} .c5-switch{display:inline-flex;align-items:center;gap:12px;min-height:44px;max-width:100%;margin:0 0 0 -6px;padding:6px 12px 6px 6px;border:0;border-radius:var(--radius,12px);background:var(--card);color:var(--ink);font:inherit;text-align:left;cursor:pointer;transition:background .16s ease}
${R} .c5-switch:hover:not(:disabled){background:color-mix(in oklch,var(--ink) 5%,var(--card))}
${R} .c5-switch:focus-visible{outline:3px solid var(--c5-ring);outline-offset:2px}
${R} .c5-track{position:relative;flex:0 0 auto;width:48px;height:28px;border-radius:999px;background:var(--c5-off);box-shadow:inset 0 1px 2px oklch(from var(--c5-sh) l c h / .28);transition:background .2s ease}
${R} .c5-switch:hover:not(:disabled) .c5-track{background:color-mix(in oklch,var(--ink) 44%,var(--card))}
${R} .c5-thumb{position:absolute;top:3px;left:3px;display:block;width:22px;height:22px;border-radius:50%;background:var(--c5-knob);box-shadow:0 1px 2px oklch(from var(--c5-sh) l c h / .35),0 2px 4px -1px oklch(from var(--c5-sh) l c h / .3);transition:transform .2s cubic-bezier(.2,.7,.2,1)}
${R} .c5-switch[aria-checked=true] .c5-track{background:var(--accent-fill,var(--accent))}
${R} .c5-switch[aria-checked=true]:hover:not(:disabled) .c5-track{background:oklch(from var(--accent-fill,var(--accent)) calc(l - .05) c h)}
${R} .c5-switch[aria-checked=true] .c5-thumb{transform:translateX(20px)}
${R} .c5-switch:disabled{cursor:not-allowed}
${R} .c5-switch:disabled .c5-track{background:color-mix(in oklch,var(--ink) 16%,var(--card))}
${R} .c5-switch:disabled .c5-stitle{color:var(--muted)}
${R} .c5-stext{display:grid;gap:2px;min-width:0}
${R} .c5-stitle{font-size:1.0625rem;font-weight:700;line-height:1.3;text-wrap:pretty}
${R} .c5-shint{font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted)}
${R} .c5-privacy{margin:0;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted);text-wrap:pretty}
${R} .c5-phone{display:grid;grid-template-columns:minmax(0,22rem) minmax(0,1fr);gap:8px 24px;align-items:start;padding:16px;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card));animation:c5-open .35s cubic-bezier(.2,.7,.2,1) both}
${R} .c5-pnote{margin:calc(1rem * 1.3 + 8px) 0 0;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted);text-wrap:pretty}
${R} .c5-alert{margin:0;padding:12px 16px;border-radius:10px;background:var(--danger-soft);color:var(--danger);font-size:.9375rem;font-weight:600;line-height:1.4}
${R} .c5-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
${R} .c5-row{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:stretch}
${R} .c5-row.has-proof{grid-template-columns:minmax(0,1.4fr) repeat(3,minmax(0,1fr))}
${R} .c5-tile{display:flex;flex-direction:column;gap:16px;min-width:0;margin:0;padding:clamp(20px,2.4vw,24px);border-radius:var(--card-radius,var(--radius,14px));background:var(--c5-tile);border:1px solid oklch(from var(--band-ink) l c h / .14);color:var(--band-ink)}
${R} .c5-ttitle{margin:0;font-family:var(--font-display);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-transform:var(--display-case,none);text-wrap:balance;color:var(--band-ink)}
${R} .c5-tbody{display:grid;gap:8px;min-width:0}
${R} .c5-soft{margin:0;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--c5-soft);text-wrap:pretty}
${R} .c5-ladder{display:grid;gap:12px;margin:0;padding:0;list-style:none}
${R} .c5-rung{display:grid;grid-template-columns:4.5rem minmax(0,1fr);gap:8px 12px;align-items:baseline}
${R} .c5-wk{font-size:.875rem;font-weight:800;line-height:1.2;letter-spacing:.06em;text-transform:uppercase;font-variant-numeric:tabular-nums;color:var(--band-ink)}
${R} .c5-wt{font-size:1rem;font-weight:600;line-height:1.35;text-wrap:pretty}
${R} .c5-bar{grid-column:2;display:block;height:6px;border-radius:999px;background:oklch(from var(--band-ink) l c h / .14);overflow:hidden}
${R} .c5-bar i{display:block;width:var(--c5-w);height:100%;border-radius:inherit;background:var(--accent-fill,var(--accent));transform-origin:left center;animation:c5-grow .6s cubic-bezier(.2,.7,.2,1) var(--c5-d,0s) both}
${R} .c5-photo{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;object-position:50% 25%;border-radius:12px}
${R} .c5-spot{display:block;flex:0 0 auto;line-height:0}
${R} .c5-link{display:inline-block;margin-top:4px;color:var(--band-ink);font-size:.9375rem;font-weight:700;line-height:1.4;text-decoration:underline;text-decoration-color:oklch(from var(--band-ink) l c h / .5);text-underline-offset:.18em}
${R} .c5-link:hover{text-decoration-color:var(--band-ink)}
${R} .c5-link:focus-visible{outline:3px solid var(--band-ink);outline-offset:3px;border-radius:4px}
${R} .c5-proof blockquote{margin:0;font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:600;line-height:1.5;text-wrap:pretty}
${R} .c5-proof figcaption{font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--c5-soft)}
${R} .c5-rv{animation:c5-rise .45s cubic-bezier(.2,.7,.2,1) var(--c5-d,0s) both}
@keyframes c5-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes c5-open{from{opacity:.82;clip-path:inset(0 0 100% 0 round 10px)}to{opacity:1;clip-path:inset(0 0 0 0 round 10px)}}
@keyframes c5-grow{from{transform:scaleX(.3)}to{transform:none}}
@keyframes c5-pop{from{transform:scale(.9)}to{transform:none}}
@keyframes c5-spin{to{transform:rotate(360deg)}}
@media (max-width:1023px){
${R} .c5-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
${R} .c5-btn{grid-column:1/-1;width:100%;margin-top:4px}
${R} .c5-row,${R} .c5-row.has-proof{grid-template-columns:repeat(2,minmax(0,1fr))}
${R} .c5-weeks,${R} .c5-proof{grid-column:1/-1}
}
@media (max-width:639px){
${R} .c5-notes{grid-template-columns:1fr}
${R} .c5-fields{grid-template-columns:1fr}
${R} .c5-btn{min-height:64px;padding:12px 16px;white-space:normal;text-wrap:balance}
${R} .c5-foot{align-items:flex-start}
${R} .c5-phone{grid-template-columns:1fr;padding:12px}
${R} .c5-pnote{margin-top:0}
${R} .c5-row,${R} .c5-row.has-proof{grid-template-columns:1fr}
${R} .c5-host{display:grid;grid-template-columns:96px minmax(0,1fr);align-items:start}
${R} .c5-host .c5-photo{aspect-ratio:1/1}
${R} .c5-place{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start}
}
@media (prefers-reduced-motion:reduce){
${R} .c5-rv,${R} .c5-bar i,${R} .c5-phone,${R} .c5-ok,${R} .c5-spin{animation:none}
${R} .c5-btn,${R} .c5-input,${R} .c5-switch,${R} .c5-track,${R} .c5-thumb{transition:none}
${R} .c5-btn:active:not(:disabled),${R} .c5-btn.is-active{transform:none}
}
`
pieces/hero/challenge-hero-5/specimen.tsx 45 lines
import __studioImageeff1136e from "../assets/2ac05b6dbe1839fe.webp";
import * as React from 'react'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
import { ChallengeHero5, type ChallengeHero5State } from '../challenge-hero-5'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function ChallengeHero5Specimen({ state = 'default' }: { state?: ChallengeHero5State }) {
const reg = defaults.sample.registration
return (
<ChallengeHero5
state={state}
headline='Run your first 5K with your neighbors beside you'
highlight='first 5K'
notes={[
{ lead: 'Start where you are.', text: 'Week one is walking with short, easy jogs. No race pace, no pressure.' },
{ lead: 'Run it together.', text: 'Meet the group by the river, follow one simple plan, and finish side by side.' },
]}
name='Riverside 5K in 5 Weeks'
chip='Free · All paces welcome'
label='Yes! I’m in for the Riverside 5K'
privacy={reg.privacy}
error={reg.error}
weeks={[
{ title: 'Walk–run intervals' },
{ title: 'Jog five minutes at a time' },
{ title: 'Jog ten minutes at a time' },
{ title: 'Run twenty minutes straight' },
{ title: 'Run the full 5K together' },
]}
hostImage={slot(
'presenter',
__studioImageeff1136e,
)}
hostName='Coach Jordan Ellis'
hostRole='Leads every group run, from the first walk to the finish.'
placeName='Riverside Park boathouse'
placeDetail='Every group run starts and finishes on the boathouse steps.'
proofQuote='I hadn’t run since school. By week five I ran the whole river loop with the group.'
proofName='Dana R., Riverside'
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalChallengeHero5 |
string |
Default 'Run your first 5K with your neighbors beside you'
|
highlight OptionalChallengeHero5 |
string |
Default 'first 5K'
|
notes OptionalChallengeHero5 |
ChallengeHero5Note[] |
Default DEFAULT_NOTES
|
name OptionalChallengeHero5 |
string |
Default 'Riverside 5K in 5 Weeks'
|
joinTitle OptionalChallengeHero5 |
string |
Default 'Join the {name}'
|
chip OptionalChallengeHero5 |
string |
Default 'Free · All paces welcome'
|
nameLabel OptionalChallengeHero5 |
string |
Default 'First name'
|
namePlaceholder OptionalChallengeHero5 |
string |
Default 'Dana'
|
emailLabel OptionalChallengeHero5 |
string |
Default 'Email address'
|
emailPlaceholder OptionalChallengeHero5 |
string |
Default 'you@example.com'
|
reminderLabel OptionalChallengeHero5 |
string |
Default 'Text me a reminder before each run'
|
reminderHint OptionalChallengeHero5 |
string |
Default 'Optional · Switch it off anytime'
|
phoneLabel OptionalChallengeHero5 |
string |
Default 'Mobile number'
|
phonePlaceholder OptionalChallengeHero5 |
string |
Default '(555) 123-4567'
|
phoneNote OptionalChallengeHero5 |
string |
Default 'One text before each meet-up. Msg & data rates may apply. Reply STOP to opt out.'
|
phoneValidLabel OptionalChallengeHero5 |
string |
Default 'Mobile number looks good.'
|
label OptionalChallengeHero5 |
string |
Default 'Yes! I’m in for the Riverside 5K'
|
loadingLabel OptionalChallengeHero5 |
string |
Default 'Saving your spot…'
|
privacy OptionalChallengeHero5 |
string |
Default 'We respect your inbox. Unsubscribe anytime.'
|
error OptionalChallengeHero5 |
string |
Default 'We couldn’t complete your registration. Please try again.'
|
nameError OptionalChallengeHero5 |
string |
Default 'Please enter your first name.'
|
emailError OptionalChallengeHero5 |
string |
Default 'Please enter a valid email address.'
|
phoneRequiredError OptionalChallengeHero5 |
string |
Default 'Add your mobile number, or switch reminders off.'
|
phoneError OptionalChallengeHero5 |
string |
Default 'Enter a mobile number with at least 10 digits.'
|
weeks OptionalChallengeHero5 |
ChallengeHero5Week[] |
Default DEFAULT_WEEKS
|
weekLabel OptionalChallengeHero5 |
string |
Default 'Week {week}'
|
weeksTitle OptionalChallengeHero5 |
string |
Default '{count} {unit}, one step at a time'
|
weekUnit OptionalChallengeHero5 |
string |
Default 'weeks'
|
weekUnitSingular OptionalChallengeHero5 |
string |
Default 'week'
|
hostImage OptionalChallengeHero5 |
string |
|
hostImageAlt OptionalChallengeHero5 |
string |
Default 'Portrait of {name}'
|
hostName OptionalChallengeHero5 |
string |
Default 'Coach Jordan Ellis'
|
hostRole OptionalChallengeHero5 |
string |
Default 'Leads every group run, from the first walk to the finish.'
|
placeName OptionalChallengeHero5 |
string |
Default 'Riverside Park boathouse'
|
placeDetail OptionalChallengeHero5 |
string |
Default 'Every group run starts and finishes on the boathouse steps.'
|
placeHref OptionalChallengeHero5 |
string |
|
placeLinkLabel OptionalChallengeHero5 |
string |
Default 'Get directions'
|
proofQuote OptionalChallengeHero5 |
string |
Default ''
|
proofName OptionalChallengeHero5 |
string |
Default ''
|
backdrop OptionalChallengeHero5 |
string |
Default track
|
reminders OptionalChallengeHero5 |
boolean |
Default false
|
disabled OptionalChallengeHero5 |
boolean |
Default false
|
state OptionalChallengeHero5 |
ChallengeHero5State |
Default 'default'
|
onSubmit OptionalChallengeHero5 |
(values: Record<string, string>) => void | Promise<void> |
|
className OptionalChallengeHero5 |
string |
|
style OptionalChallengeHero5 |
React.CSSProperties |
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- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--field-border--field-focus--field-ink--field-radius- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
presenter- A photo of the host, coach or founder.
-
0d114386aa55e8d2.webp
image/webp · 15.6 KB
-
0e5c13174fe9e7d9.webp
image/webp · 165 KB
-
2ac05b6dbe1839fe.webp
image/webp · 106 KB
-
5602e47ebdb81810.webp
image/webp · 35.6 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB