Quiz Start 4
Starts a quiz as a free consult. The host stands on a lit stage and asks question 1 in their own voice. The visitor answers with one big pill (or number keys 1–4), then presses one full-width start button.
Use it in a prompt
Use forms/quiz-start-4 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/forms/quiz-start-4.tsx. - Import it and pass your copy and images (Props tab):
import { QuizStart4 } from "@/components/funneldna/forms/quiz-start-4"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/quiz-start-4/component.tsx 670 lines
// layout: presenter-cutout
// Starts a quiz as a free consult. The host stands on a lit stage and asks question 1 in their own voice. The visitor answers with one big pill (or number keys 1–4), then presses one full-width start button.
'use client'
import { useEffect, useId, useRef, useState, type CSSProperties, type FormEvent, type ReactNode } from 'react'
import { AlertCircle, Check, Clock3, Loader2, Quote } from 'lucide-react'
import { FX_HOST, Spotlight } from '../fx/fx'
export type QuizStart4Choice = {
value: string
label: string
}
/** 'hover' and 'active' pre-pick the first answer and force the button look. 'error' shows the pick-an-answer message. */
export type QuizStart4State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type QuizStart4Props = {
/** The host who asks the question in their own voice. */
hostName?: string
/** Plain role line under the name. Leave empty unless supplied; never invent credentials. */
hostRole?: string
/** presenter-cutout slot: a transparent cut-out of the host. Without it the speech bubble stands alone. */
presenterImage?: string
/** Alt text for the cut-out. Defaults to the host name. */
presenterAlt?: string
/** First line in the host's voice. {hostName} is replaced as text. */
greeting?: string
/** Question 1. */
question?: string
/** One continuous phrase inside the question that gets the marker stroke. */
highlight?: string
/** Bold lead-in of the why line. */
whyLead?: string
/** Why the host asks, in one short sentence. */
why?: string
/** Answers. The first nine get number-key shortcuts. */
choices?: QuizStart4Choice[]
/** The real number of questions in the quiz. */
questionCount?: number
ctaLabel?: string
/** Button label while a promise returned by onSubmit is pending. */
loadingLabel?: string
/** Line under the button. {count} is replaced as text. */
reassurance?: string
/** Shown when the visitor presses start before picking. */
errorText?: string
disabled?: boolean
/** Replaces the reassurance line while the quiz is closed. */
disabledText?: string
/** Optional proof quote under the host. Empty by default, so a page shows only proof it is given. */
quote?: ReactNode
/** Who said the quote. */
quoteName?: string
state?: QuizStart4State
/** Receives the validated first answer. A returned promise shows the loading label. */
onSubmit?: (answer: string) => void | Promise<void>
/** Called with the answer after onSubmit settles (for example, to go to question 2). */
onAction?: (answer: string) => void
className?: string
}
export function QuizStart4({
hostName = 'Maya',
hostRole = '',
presenterImage,
presenterAlt,
greeting = 'Hi, I’m {hostName}. Before we start, one honest question:',
question = 'What is really holding your training back?',
highlight = 'really holding',
whyLead = 'Why I ask:',
why = 'your answer tells me where to start, so every question after this one fits you.',
choices = DEFAULT_CHOICES,
questionCount = 5,
ctaLabel = 'Yes! Start My Training Check',
loadingLabel = 'Starting your check…',
reassurance = 'Question 1 of {count} · One tap each',
errorText = 'Pick the answer that fits you best, then start.',
disabled = false,
disabledText = 'This quiz isn’t open right now.',
quote,
quoteName = '',
state = 'default',
onSubmit,
onAction,
className = '',
}: QuizStart4Props) {
const uid = useId().replace(/:/g, '')
const qId = `${uid}-q`
const whyId = `${uid}-why`
const errId = `${uid}-err`
const noteId = `${uid}-note`
const group = `${uid}-answer`
const count = Number.isFinite(questionCount) ? Math.max(1, Math.round(questionCount)) : 5
const firstChoice = choices[0]?.value ?? ''
const [answer, setAnswer] = useState(state === 'hover' || state === 'active' ? firstChoice : '')
const [invalid, setInvalid] = useState(state === 'error')
const [loading, setLoading] = useState(false)
const rootRef = useRef<HTMLElement>(null)
const radios = useRef<(HTMLInputElement | null)[]>([])
const inView = useRef(false)
const mounted = useRef(true)
useEffect(() => {
setAnswer(state === 'hover' || state === 'active' ? firstChoice : '')
setInvalid(state === 'error')
setLoading(false)
}, [state, firstChoice])
useEffect(() => {
mounted.current = true
return () => {
mounted.current = false
}
}, [])
const isDisabled = disabled || state === 'disabled'
const picked = choices.some((choice) => choice.value === answer)
const hasHost = Boolean(presenterImage)
const hasQuote = quote !== undefined && quote !== null && quote !== '' && quote !== false
const showError = invalid && !isDisabled
// The number keys only answer while this block is on screen.
useEffect(() => {
const el = rootRef.current
if (!el || typeof IntersectionObserver === 'undefined') {
inView.current = true
return
}
const io = new IntersectionObserver(
(entries) => {
inView.current = entries.some((entry) => entry.isIntersecting)
},
{ threshold: 0.2 },
)
io.observe(el)
return () => io.disconnect()
}, [])
// Signature: press 1–4 to pick an answer. Ignored while typing in a field or working in another form.
useEffect(() => {
if (isDisabled || loading) return
function onKey(event: KeyboardEvent) {
if (event.defaultPrevented || event.repeat || event.altKey || event.ctrlKey || event.metaKey) return
if (!/^[1-9]$/.test(event.key)) return
const index = Number(event.key) - 1
const choice = choices[index]
const root = rootRef.current
if (!choice || !root || !inView.current) return
const target = event.target instanceof HTMLElement ? event.target : null
if (target && target.isContentEditable) return
if (target && target.closest('textarea, select, input:not([type=radio])')) return
if (target && !root.contains(target) && target.closest('form, [role=dialog]')) return
event.preventDefault()
setAnswer(choice.value)
setInvalid(false)
radios.current[index]?.focus({ preventScroll: true })
}
document.addEventListener('keydown', onKey)
return () => document.removeEventListener('keydown', onKey)
}, [choices, isDisabled, loading])
async function submit(event: FormEvent<HTMLFormElement>) {
event.preventDefault()
if (isDisabled || loading) return
if (!picked) {
setInvalid(true)
radios.current[0]?.focus()
return
}
setInvalid(false)
try {
const result: unknown = onSubmit?.(answer)
if (isThenable(result)) {
setLoading(true)
await result
}
onAction?.(answer)
} catch {
// The caller reports failures. This piece only resets its button.
} finally {
if (mounted.current) setLoading(false)
}
}
const greetLine = fill(greeting, { hostName })
const note = isDisabled ? disabledText : fill(reassurance, { count })
const btnClass = `qs4-btn${state === 'hover' ? ' is-hover' : ''}${state === 'active' ? ' is-press' : ''}`
const describedBy = [why ? whyId : '', showError ? errId : ''].filter(Boolean).join(' ') || undefined
return (
<section
ref={rootRef}
className={`cf-quiz-start-4 ${className}`.trim()}
style={FX_HOST}
data-host={hasHost ? '' : undefined}
aria-labelledby={qId}
>
<style>{CSS}</style>
<form className='qs4-wrap' onSubmit={submit} noValidate aria-busy={loading || undefined}>
{hasHost || hasQuote ? (
<div className={`qs4-host${hasQuote ? ' has-quote' : ''}`}>
{hasHost ? (
<>
<div className='qs4-stage qs4-rise'>
<div className='qs4-light' aria-hidden='true'>
<Spotlight />
</div>
<div className='qs4-disc' aria-hidden='true' />
<img
className='qs4-cutout'
src={presenterImage}
alt={presenterAlt ?? hostName}
width={640}
height={640}
decoding='async'
/>
</div>
<p className='qs4-name'>
{hostName}
{hostRole ? <span className='qs4-role'>{hostRole}</span> : null}
</p>
</>
) : null}
{hasQuote ? (
<figure className='qs4-proof'>
<Quote aria-hidden='true' strokeWidth={2.5} />
<blockquote>{quote}</blockquote>
{quoteName ? <figcaption>{quoteName}</figcaption> : null}
</figure>
) : null}
</div>
) : null}
<div className='qs4-talk'>
<div className='qs4-bubble qs4-rise' style={{ '--i': 1 } as CSSProperties}>
{hasHost ? (
<div className='qs4-head'>
<span className='qs4-mini' aria-hidden='true'>
<img src={presenterImage} alt='' width={64} height={64} decoding='async' />
</span>
<p className='qs4-who-m'>
<strong>{hostName}</strong>
{hostRole ? <span>{hostRole}</span> : null}
</p>
</div>
) : null}
<p className='qs4-greet'>{greetLine}</p>
<h2 id={qId} className='qs4-q'>
{renderQuestion(question, highlight)}
</h2>
{why ? (
<p id={whyId} className='qs4-why'>
{whyLead ? <strong>{whyLead} </strong> : null}
{why}
</p>
) : null}
</div>
<div
className='qs4-pills'
role='radiogroup'
aria-labelledby={qId}
aria-describedby={describedBy}
aria-invalid={showError ? true : undefined}
data-invalid={showError ? '' : undefined}
>
{choices.map((choice, index) => {
const key = index < 9 ? String(index + 1) : undefined
return (
<label
key={choice.value}
className={`qs4-pill qs4-rise${state === 'hover' && index === 1 ? ' is-hover' : ''}`}
style={{ '--i': index + 2 } as CSSProperties}
>
<input
ref={(node) => {
radios.current[index] = node
}}
type='radio'
name={group}
value={choice.value}
checked={answer === choice.value}
disabled={isDisabled}
aria-keyshortcuts={key}
onChange={() => {
setAnswer(choice.value)
setInvalid(false)
}}
/>
{key ? (
<kbd className='qs4-key' aria-hidden='true'>
{key}
</kbd>
) : null}
<span className='qs4-pill-label'>{choice.label}</span>
<span className='qs4-tick' aria-hidden='true'>
<Check strokeWidth={3} />
</span>
</label>
)
})}
</div>
{showError ? (
<p id={errId} className='qs4-err' role='alert'>
<AlertCircle aria-hidden='true' strokeWidth={2.5} />
{errorText}
</p>
) : null}
<div className='qs4-act'>
<button
type='submit'
className={btnClass}
disabled={isDisabled}
aria-describedby={noteId}
>
{loading ? (
<>
<Loader2 className='qs4-spin' aria-hidden='true' strokeWidth={2.5} />
<span>{loadingLabel}</span>
</>
) : (
ctaLabel
)}
</button>
<p id={noteId} className='qs4-note'>
<Clock3 aria-hidden='true' strokeWidth={2.5} />
{note}
</p>
</div>
</div>
</form>
</section>
)
}
export default QuizStart4
const DEFAULT_CHOICES: QuizStart4Choice[] = [
{ value: 'plan', label: 'I don’t have a plan I trust' },
{ value: 'consistency', label: 'I can’t stay consistent' },
{ value: 'stalled', label: 'My progress has stalled' },
{ value: 'pain', label: 'Pain or an old injury' },
]
function fill(template: string, values: Record<string, string | number>) {
return Object.keys(values).reduce((out, key) => out.split('{' + key + '}').join(String(values[key])), template)
}
function renderQuestion(text: string, phrase: string): ReactNode {
const at = phrase ? text.indexOf(phrase) : -1
if (at < 0) return text
return (
<>
{text.slice(0, at)}
<span className='qs4-mark'>{phrase}</span>
{text.slice(at + phrase.length)}
</>
)
}
function isThenable(value: unknown): value is PromiseLike<unknown> {
return typeof value === 'object' && value !== null && typeof (value as PromiseLike<unknown>).then === 'function'
}
const CSS = `
.cf-quiz-start-4 {
--qs4-soft: color-mix(in oklab, var(--band-ink) 80%, var(--band));
--qs4-pill: color-mix(in oklab, var(--band-ink) 9%, var(--band));
--qs4-pill-hover: color-mix(in oklab, var(--band-ink) 16%, var(--band));
--qs4-wait: color-mix(in oklab, var(--band-ink) 13%, var(--band));
--qs4-wait-ink: color-mix(in oklab, var(--band-ink) 74%, var(--band));
--qs4-marker: var(--marker, color-mix(in oklch, var(--warning) 36%, transparent));
--qs4-shadow: var(--shadow, oklch(0.22 0.03 260));
--qs4-btn: var(--button-bg, var(--cta));
--qs4-btn-2: var(--button-bg-2, var(--cta-2));
position: relative;
isolation: isolate;
overflow: hidden;
background: var(--band, oklch(0.27 0.067 256));
color: var(--band-ink, oklch(1 0 0));
font-family: var(--font-body);
padding: clamp(56px, 8vw, 112px) clamp(16px, 5vw, 48px) clamp(64px, 8.5vw, 120px);
}
.cf-quiz-start-4 *, .cf-quiz-start-4 *::before, .cf-quiz-start-4 *::after { box-sizing: border-box; }
.cf-quiz-start-4 :where(p, h2, figure, blockquote) { margin: 0; }
.qs4-wrap {
position: relative;
z-index: 1;
max-width: 1120px;
margin: 0 auto;
display: grid;
grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
gap: clamp(32px, 5vw, 72px);
align-items: start;
}
.cf-quiz-start-4:not([data-host]) .qs4-wrap { grid-template-columns: minmax(0, 46rem); justify-content: center; }
.cf-quiz-start-4:not([data-host]) .qs4-host { order: 2; }
.qs4-host { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.qs4-stage { position: relative; isolation: isolate; width: 100%; aspect-ratio: 4 / 5; max-height: 560px; }
.qs4-light { position: absolute; inset: -18% -24% 0; z-index: 0; pointer-events: none; }
.qs4-disc {
position: absolute;
z-index: 1;
left: 7%;
right: 7%;
bottom: 14%;
aspect-ratio: 1;
border-radius: 50%;
background: radial-gradient(circle at 50% 32%, color-mix(in oklch, var(--band-ink) 16%, var(--band)), color-mix(in oklch, var(--band-ink) 6%, var(--band)) 72%);
box-shadow: inset 0 0 0 2px oklch(from var(--accent-fill, var(--accent)) l c h / 0.55), inset 0 1px 0 oklch(from var(--band-ink) l c h / 0.18);
}
.qs4-cutout {
position: absolute;
z-index: 2;
inset: 0;
width: 100%;
height: 100%;
object-fit: contain;
object-position: 50% 100%;
-webkit-mask-image: linear-gradient(to bottom, var(--band-ink) 86%, transparent);
mask-image: linear-gradient(to bottom, var(--band-ink) 86%, transparent);
filter: drop-shadow(0 2px 3px oklch(from var(--qs4-shadow) calc(l - 0.08) c h / 0.4)) drop-shadow(0 14px 18px oklch(from var(--qs4-shadow) calc(l - 0.08) c h / 0.35));
}
.qs4-name {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
text-align: center;
font-family: var(--font-display);
font-weight: var(--display-weight, 800);
font-size: clamp(1.3125rem, 1.8vw, 1.625rem);
line-height: 1.15;
letter-spacing: -0.01em;
color: var(--band-ink);
}
.qs4-role { font-family: var(--font-body); font-weight: 600; font-size: 0.9375rem; line-height: 1.4; letter-spacing: 0; color: var(--qs4-soft); }
.qs4-proof { display: grid; justify-items: center; gap: 8px; padding: 0 8px; text-align: center; }
.qs4-proof svg { width: 20px; height: 20px; color: var(--qs4-soft); }
.qs4-proof blockquote { font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5; font-weight: 500; color: var(--band-ink); text-wrap: pretty; }
.qs4-proof figcaption { font-size: 0.9375rem; line-height: 1.4; font-weight: 700; color: var(--qs4-soft); }
.qs4-talk { min-width: 0; display: flex; flex-direction: column; }
.qs4-bubble {
position: relative;
background: var(--card);
color: var(--ink);
border: 1px solid var(--card-border, oklch(from var(--ink) l c h / 0.12));
border-radius: var(--card-radius, var(--radius, 14px));
box-shadow: var(--card-shadow, var(--shadow-lg, 0 2px 4px oklch(0.22 0.03 260 / 0.22), 0 12px 24px -8px oklch(0.22 0.03 260 / 0.32)));
padding: clamp(24px, 3vw, 40px);
}
.cf-quiz-start-4[data-host] .qs4-bubble::before {
content: '';
position: absolute;
left: -15px;
top: 88px;
width: 16px;
height: 30px;
background: var(--card);
clip-path: polygon(100% 0, 0 50%, 100% 100%);
}
.qs4-head { display: none; }
.qs4-mini {
display: block;
flex: none;
width: 56px;
height: 56px;
border-radius: 50%;
overflow: hidden;
background: color-mix(in oklch, var(--ink) 8%, var(--card));
box-shadow: inset 0 0 0 2px oklch(from var(--accent-fill, var(--accent)) l c h / 0.55);
}
.qs4-mini img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transform: scale(1.4); transform-origin: 50% 6%; }
.qs4-who-m { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--muted); }
.qs4-who-m strong {
font-family: var(--font-display);
font-weight: var(--display-weight, 800);
font-size: clamp(1.3125rem, 1.8vw, 1.625rem);
line-height: 1.15;
letter-spacing: -0.01em;
color: var(--ink);
}
.qs4-greet { margin-bottom: 12px; font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.4; font-weight: 500; color: var(--muted); text-wrap: pretty; }
.qs4-q {
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;
}
.qs4-mark {
background: linear-gradient(transparent 56%, var(--qs4-marker) 56%, var(--qs4-marker) 92%, transparent 92%);
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
padding: 0 0.06em;
border-radius: 0.14em 0.08em 0.16em 0.06em;
}
.qs4-why { margin-top: 16px; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.qs4-why strong { color: var(--ink); font-weight: 700; }
.qs4-pills { display: grid; gap: 12px; margin-top: 24px; }
.qs4-pill {
position: relative;
display: flex;
align-items: center;
gap: 14px;
min-height: 64px;
padding: 10px 16px 10px 24px;
border-radius: 999px;
background: var(--qs4-pill);
border: 2px solid oklch(from var(--band-ink) l c h / 0.18);
color: var(--band-ink);
font-size: clamp(1.125rem, 1.5vw, 1.375rem);
font-weight: 700;
line-height: 1.25;
cursor: pointer;
user-select: none;
-webkit-tap-highlight-color: transparent;
box-shadow: 0 1px 2px oklch(from var(--qs4-shadow) calc(l - 0.08) c h / 0.35);
transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.qs4-pill input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.qs4-pill-label { flex: 1; min-width: 0; text-wrap: pretty; }
.qs4-key {
display: none;
flex: none;
place-items: center;
min-width: 30px;
height: 30px;
padding: 0 8px;
border-radius: 8px;
font: 800 0.875rem/1 var(--font-body);
font-variant-numeric: tabular-nums;
color: inherit;
border: 1px solid color-mix(in oklch, currentColor 36%, transparent);
background: color-mix(in oklch, currentColor 8%, transparent);
}
.qs4-tick {
flex: none;
display: grid;
place-items: center;
width: 28px;
height: 28px;
border-radius: 50%;
border: 2px solid color-mix(in oklch, currentColor 42%, transparent);
color: transparent;
}
.qs4-tick svg { width: 16px; height: 16px; }
.qs4-pill:has(input:checked) {
background: var(--accent-fill, var(--accent));
color: var(--accent-fill-ink, var(--card));
border-color: var(--band-ink);
box-shadow: inset 0 1px 0 oklch(from var(--accent-fill, var(--accent)) calc(l + 0.12) c h / 0.6), inset 0 -2px 0 oklch(from var(--accent-fill, var(--accent)) calc(l - 0.12) c h), 0 6px 14px -6px oklch(from var(--qs4-shadow) calc(l - 0.1) c h / 0.6);
}
.qs4-pill:has(input:checked) .qs4-tick {
background: var(--accent-fill-ink, var(--card));
border-color: transparent;
color: var(--accent-fill, var(--accent));
animation: qs4-pop 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.qs4-pill:has(input:focus-visible) { outline: 3px solid var(--band-ink); outline-offset: 3px; }
.qs4-pill:has(input:disabled) { cursor: not-allowed; opacity: 0.55; box-shadow: none; }
.qs4-pills[data-invalid] .qs4-pill { border-color: var(--danger); }
.qs4-pill.is-hover:not(:has(input:checked)) { background: var(--qs4-pill-hover); border-color: oklch(from var(--band-ink) l c h / 0.36); }
@media (hover: hover) {
.qs4-pill:hover:not(:has(input:checked)):not(:has(input:disabled)) { background: var(--qs4-pill-hover); border-color: oklch(from var(--band-ink) l c h / 0.36); }
}
.qs4-err {
align-self: flex-start;
margin-top: 16px;
padding: 8px 14px;
border-radius: 10px;
background: var(--danger-soft);
color: var(--danger);
font-size: 0.9375rem;
font-weight: 700;
line-height: 1.4;
text-wrap: pretty;
}
.qs4-err svg, .qs4-note svg { display: inline-block; width: 16px; height: 16px; vertical-align: -0.15em; margin-inline-end: 0.4em; }
.qs4-act { margin-top: 32px; display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.qs4-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 10px;
width: 100%;
min-height: 72px;
padding: 12px 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;
color: var(--button-ink, var(--cta-ink));
text-shadow: var(--button-text-shadow, none);
background: linear-gradient(oklch(from var(--qs4-btn) calc(l + 0.04) c h), oklch(from var(--qs4-btn-2) calc(l - 0.02) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--qs4-btn) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--qs4-btn) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--qs4-shadow) calc(l - 0.08) c h / 0.45), 0 8px 16px -6px oklch(from var(--qs4-shadow) calc(l - 0.08) c h / 0.55));
cursor: pointer;
transition: background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.qs4-btn:not(:disabled):not([aria-disabled=true]):hover, .qs4-btn.is-hover {
background: linear-gradient(oklch(from var(--qs4-btn) calc(l - 0.01) c h), oklch(from var(--qs4-btn-2) calc(l - 0.07) c h));
box-shadow: inset 0 1px 0 oklch(from var(--qs4-btn) calc(l + 0.12) c h / 0.6), inset 0 -3px 0 oklch(from var(--qs4-btn) calc(l - 0.18) c h), 0 1px 2px oklch(from var(--qs4-shadow) calc(l - 0.08) c h / 0.5), 0 10px 18px -6px oklch(from var(--qs4-shadow) calc(l - 0.08) c h / 0.65);
}
.qs4-btn:not(:disabled):not([aria-disabled=true]):active, .qs4-btn.is-press {
background: linear-gradient(oklch(from var(--qs4-btn) calc(l - 0.04) c h), oklch(from var(--qs4-btn-2) calc(l - 0.08) c h));
box-shadow: inset 0 2px 4px oklch(from var(--qs4-btn) calc(l - 0.22) c h / 0.55), inset 0 -2px 0 oklch(from var(--qs4-btn) calc(l - 0.16) c h), 0 1px 1px oklch(from var(--qs4-shadow) calc(l - 0.08) c h / 0.4);
}
.qs4-btn:focus-visible { outline: 3px solid var(--band-ink); outline-offset: 3px; }
.qs4-btn[aria-disabled=true], .qs4-btn:disabled {
background: var(--qs4-wait);
color: var(--qs4-wait-ink);
text-shadow: none;
box-shadow: inset 0 0 0 1px oklch(from var(--band-ink) l c h / 0.16);
cursor: not-allowed;
}
.qs4-spin { width: 20px; height: 20px; flex: none; animation: qs4-spin 0.8s linear infinite; }
.qs4-note { text-align: center; font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: var(--qs4-soft); text-wrap: pretty; }
.qs4-rise { animation: qs4-rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: min(calc(var(--i, 0) * 0.07s), 0.28s); }
@keyframes qs4-rise { from { opacity: 0.82; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes qs4-pop { from { transform: scale(0.9); } to { transform: scale(1); } }
@keyframes qs4-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) {
.qs4-pill.is-hover:not(:has(input:checked)) { transform: translateY(-1px); }
.qs4-pill:active:not(:has(input:disabled)) { transform: scale(0.985); }
.qs4-btn:not(:disabled):not([aria-disabled=true]):active, .qs4-btn.is-press { transform: translateY(1px); }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
.qs4-pill:hover:not(:has(input:checked)):not(:has(input:disabled)) { transform: translateY(-1px); }
.qs4-btn:not(:disabled):not([aria-disabled=true]):hover { transform: translateY(-1px); }
}
@media (hover: hover) and (pointer: fine) and (min-width: 760px) {
.qs4-key { display: inline-grid; }
.qs4-pill { padding-left: 14px; }
}
@media (max-width: 759px) {
.qs4-wrap { grid-template-columns: minmax(0, 1fr); gap: 32px; }
.qs4-host { order: 2; }
.qs4-host:not(.has-quote) { display: none; }
.qs4-stage, .qs4-name { display: none; }
.cf-quiz-start-4[data-host] .qs4-bubble::before { display: none; }
.qs4-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.qs4-pill { min-height: 60px; padding: 10px 14px 10px 20px; }
.qs4-act { margin-top: 24px; }
.qs4-btn { min-height: 64px; padding: 12px 20px; }
}
@media (prefers-reduced-motion: reduce) {
.cf-quiz-start-4 .qs4-rise, .cf-quiz-start-4 .qs4-tick, .cf-quiz-start-4 .qs4-spin { animation: none; }
.cf-quiz-start-4 .qs4-pill, .cf-quiz-start-4 .qs4-btn { transition: none; }
}
`
pieces/forms/quiz-start-4/specimen.tsx 38 lines
import __studioImage0da6f751 from "../assets/d197f4a0d6808141.webp";
// Specimen: Northgate Fitness. Coach Maya asks question 1 herself, so the quiz feels like a free consult.
import { QuizStart4, type QuizStart4State } from '../quiz-start-4'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function QuizStart4Specimen({ state = 'default' }: { state?: QuizStart4State }) {
return (
<QuizStart4
state={state}
presenterImage={slot(
'presenter-cutout',
__studioImage0da6f751,
)}
presenterAlt='Maya, a coach at Northgate Fitness'
hostName='Maya'
hostRole='Coach at Northgate Fitness'
greeting='Hi, I’m {hostName}. Before we plan a single workout, one honest question:'
question='What is really holding your training back?'
highlight='really holding'
whyLead='Why I ask:'
why='your answer tells me where we start, so the next four questions are about you, not a template.'
choices={[
{ value: 'plan', label: 'I don’t have a plan I trust' },
{ value: 'consistency', label: 'I can’t stay consistent' },
{ value: 'stalled', label: 'My progress has stalled' },
{ value: 'pain', label: 'Pain or an old injury' },
]}
questionCount={5}
ctaLabel='Yes! Start My Training Check'
reassurance='Question 1 of {count} · About 2 minutes · Free'
errorText='Pick the answer that fits you best, then start.'
quote='I thought I needed more willpower. Her first question showed me I needed a plan I could actually follow.'
quoteName='Dana R., Northgate member'
/>
)
}
| Name | Type | Details |
|---|---|---|
hostName OptionalQuizStart4 |
string |
Default 'Maya'
|
hostRole OptionalQuizStart4 |
string |
Default ''
|
presenterImage OptionalQuizStart4 |
string |
|
presenterAlt OptionalQuizStart4 |
string |
|
greeting OptionalQuizStart4 |
string |
Default 'Hi, I’m {hostName}. Before we start, one honest question:'
|
question OptionalQuizStart4 |
string |
Default 'What is really holding your training back?'
|
highlight OptionalQuizStart4 |
string |
Default 'really holding'
|
whyLead OptionalQuizStart4 |
string |
Default 'Why I ask:'
|
why OptionalQuizStart4 |
string |
Default 'your answer tells me where to start, so every question after this one fits you.'
|
choices OptionalQuizStart4 |
QuizStart4Choice[] |
Default DEFAULT_CHOICES
|
questionCount OptionalQuizStart4 |
number |
Default 5
|
ctaLabel OptionalQuizStart4 |
string |
Default 'Yes! Start My Training Check'
|
loadingLabel OptionalQuizStart4 |
string |
Default 'Starting your check…'
|
reassurance OptionalQuizStart4 |
string |
Default 'Question 1 of {count} · One tap each'
|
errorText OptionalQuizStart4 |
string |
Default 'Pick the answer that fits you best, then start.'
|
disabled OptionalQuizStart4 |
boolean |
Default false
|
disabledText OptionalQuizStart4 |
string |
Default 'This quiz isn’t open right now.'
|
quote OptionalQuizStart4 |
ReactNode |
|
quoteName OptionalQuizStart4 |
string |
Default ''
|
state OptionalQuizStart4 |
QuizStart4State |
Default 'default'
|
onSubmit OptionalQuizStart4 |
(answer: string) => void | Promise<void> |
|
onAction OptionalQuizStart4 |
(answer: string) => void |
|
className OptionalQuizStart4 |
string |
Default ''
|
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
presenter-cutout- The presenter on a transparent background.
-
d197f4a0d6808141.webp
image/webp · 147 KB