Quiz Start 5
Starts a quiz like a magazine spread: a colour-blocked photo page that states the time it takes, two short reason-why columns, then question 1 as one easy slider whose label rewrites as it moves.
Use it in a prompt
Use forms/quiz-start-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/forms/quiz-start-5.tsx. - Import it and pass your copy and images (Props tab):
import { QuizStart5 } from "@/components/funneldna/forms/quiz-start-5"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/quiz-start-5/component.tsx 472 lines
// layout: magazine-spread
// Starts a quiz like a magazine spread: a colour-blocked photo page that states the time it takes, two short reason-why columns, then question 1 as one easy slider whose label rewrites as it moves.
"use client"
import { useEffect, useId, useRef, useState, type CSSProperties, type FormEvent, type KeyboardEvent, type ReactNode } from "react"
import { AlertCircle, Clock3, Loader2 } from "lucide-react"
import { FX_HOST, Texture } from "../fx/fx"
import linen from "../fx/textures/linen"
export type QuizStart5Stop = {
/** Answer submitted when the slider rests here. */
value: string
/** Big live readout, e.g. "2 hours". */
amount: string
/** What that much time looks like, e.g. "a single sorting shift". */
label: string
/** Short mark under the track, e.g. "2". */
tick: string
}
export type QuizStart5Column = {
/** A selling subhead, set in the accent like a printed sales letter. */
title: ReactNode
body: ReactNode
}
/** "hover" and "active" show the slider as moved, with the button hovered or pressed. */
export type QuizStart5State = "default" | "hover" | "active" | "disabled" | "error"
/** Generated labels. Placeholders {count}, {unit}, {durationValue} and {durationUnit} are replaced as text. */
export type QuizStart5Copy = {
/** Small line above question 1. */
questionLabel: string
/** Shown in place of the live label until the slider is moved. */
prompt: string
/** Large pull line on the photo page. */
pullLine: string
/** One short line under the button. */
note: string
questionSingular: string
questionPlural: string
}
export type QuizStart5Props = {
/** Templated labels; placeholders are replaced as text. */
copy?: Partial<QuizStart5Copy>
headline?: string
/** One continuous phrase inside the headline that gets the marker stroke. */
highlight?: string
lead?: string
/** The reason-why: two short columns read best. */
columns?: QuizStart5Column[]
/** scene slot: the photo on the colour-blocked page. Layout media only, never proof. */
sceneImage?: string
sceneAlt?: string
/** Plain caption under the photo. */
caption?: string
/** The real number of questions in the quiz. */
questionCount?: number
/** The real time the quiz takes, e.g. "2". */
durationValue?: string
durationUnit?: string
/** Overrides copy.pullLine. */
pullLine?: string
/** Question 1, answered with the slider. */
question?: string
/** Slider positions, low to high. Every label shown comes from these. */
stops?: QuizStart5Stop[]
/** Where the thumb rests before the visitor moves it. */
initialIndex?: number
/** Field name for the answer. */
name?: string
ctaLabel?: string
/** Button label while a promise returned by onSubmit is pending. */
loadingLabel?: string
/** Shown when the visitor starts before moving the slider. */
errorText?: string
disabled?: boolean
/** Replaces the note under the button while the quiz is closed. */
disabledText?: string
state?: QuizStart5State
/** Validated answer (the chosen stop's value). A returned promise shows the loading label. */
onSubmit?: (answer: string) => void | Promise<void>
/** Called with the answer after onSubmit settles, e.g. to show question 2. */
onAction?: (answer: string) => void
className?: string
}
export function QuizStart5({
copy: copyOverrides,
headline = "Find the way to help that fits your month",
highlight = "fits your month",
lead = "A few quick questions match you to one volunteer role that suits the time you really have.",
columns = DEFAULT_COLUMNS,
sceneImage,
sceneAlt = "",
caption,
questionCount = 5,
durationValue = "2",
durationUnit = "minutes",
pullLine,
question = "How many hours could you give a month?",
stops = DEFAULT_STOPS,
initialIndex = 1,
name = "hours",
ctaLabel = "Find my way to help",
loadingLabel = "Finding your way to help…",
errorText = "Move the slider to the hours you could give, then start.",
disabled = false,
disabledText = "This quiz isn’t open right now.",
state = "default",
onSubmit,
onAction,
className = "",
}: QuizStart5Props) {
const copy: QuizStart5Copy = { ...DEFAULT_COPY, ...copyOverrides }
const uid = useId().replace(/:/g, "")
const titleId = `${uid}-title`
const rangeId = `${uid}-range`
const labelId = `${uid}-label`
const errId = `${uid}-err`
const list = stops.length ? stops : DEFAULT_STOPS
const last = list.length - 1
const start = Math.min(Math.max(Math.round(Number.isFinite(initialIndex) ? initialIndex : 0), 0), last)
const forcedMoved = state === "hover" || state === "active"
const [index, setIndex] = useState(start)
const [moved, setMoved] = useState(forcedMoved)
const [invalid, setInvalid] = useState(state === "error")
const [loading, setLoading] = useState(false)
const rangeRef = useRef<HTMLInputElement>(null)
const mounted = useRef(true)
useEffect(() => {
setIndex(start)
setMoved(state === "hover" || state === "active")
setInvalid(state === "error")
setLoading(false)
}, [state, start])
useEffect(() => {
mounted.current = true
return () => {
mounted.current = false
}
}, [])
const isDisabled = disabled || state === "disabled"
const count = Number.isFinite(questionCount) ? Math.max(1, Math.round(questionCount)) : 5
const unit = count === 1 ? copy.questionSingular : copy.questionPlural
const vars = { count, unit, durationValue, durationUnit }
const stop = list[index] ?? list[0]
const p = last > 0 ? index / last : 0
function touch() {
if (isDisabled) return
setMoved(true)
setInvalid(false)
}
function onKey(event: KeyboardEvent<HTMLInputElement>) {
if (STEP_KEYS.has(event.key)) touch()
}
async function submit(event: FormEvent<HTMLFormElement>) {
event.preventDefault()
if (isDisabled || loading) return
if (!moved) {
setInvalid(true)
rangeRef.current?.focus()
return
}
setInvalid(false)
try {
const result = onSubmit?.(stop.value)
if (isThenable(result)) {
setLoading(true)
await result
}
onAction?.(stop.value)
} catch {
// The caller reports failures; this piece only resets its button.
} finally {
if (mounted.current) setLoading(false)
}
}
const rangeClass = ["qs5-range", moved ? "is-moved" : "", invalid && !isDisabled ? "is-invalid" : "", state === "hover" ? "is-hover" : "", isDisabled ? "is-off" : ""].filter(Boolean).join(" ")
const btnClass = ["qs5-btn", isDisabled ? "is-off" : "", state === "hover" ? "is-hover" : "", state === "active" ? "is-press" : ""].filter(Boolean).join(" ")
const describedBy = [invalid && !isDisabled ? errId : "", labelId].filter(Boolean).join(" ")
return (
<section className={`cf-quiz-start-5 ${className}`.trim()} aria-labelledby={titleId}>
<style>{CSS}</style>
<form className="qs5-spread" onSubmit={submit} noValidate aria-busy={loading || undefined}>
<header className="qs5-head qs5-reveal" style={cssVars({ "--i": 0 })}>
<h2 id={titleId} className="qs5-title">
{renderHeadline(headline, highlight)}
</h2>
{lead ? <p className="qs5-lead">{lead}</p> : null}
</header>
<div className="qs5-page" style={FX_HOST}>
<Texture src={linen} tone="band-ink" />
{sceneImage ? (
<figure className="qs5-fig qs5-reveal" style={cssVars({ "--i": 1 })}>
<div className="qs5-frame">
<img src={sceneImage} alt={sceneAlt} decoding="async" />
</div>
{caption ? <figcaption className="qs5-caption">{caption}</figcaption> : null}
</figure>
) : null}
<p className="qs5-pull qs5-reveal" style={cssVars({ "--i": 2 })}>
{pullLine ?? fill(copy.pullLine, vars)}
</p>
</div>
<div className="qs5-body">
{columns.length ? (
<div className="qs5-cols">
{columns.map((column, i) => (
<div className="qs5-col qs5-reveal" key={i} style={cssVars({ "--i": i + 2 })}>
<h3 className="qs5-sub">{column.title}</h3>
<p className="qs5-copy">{column.body}</p>
</div>
))}
</div>
) : null}
<div className="qs5-quiz qs5-reveal" style={cssVars({ "--i": 4 })}>
<p className="qs5-qlabel">{fill(copy.questionLabel, vars)}</p>
<h3 className="qs5-question">
<label htmlFor={rangeId}>{question}</label>
</h3>
<div className={`qs5-readout${moved ? " is-moved" : ""}`}>
<span className="qs5-amount">{stop.amount}</span>
<span key={moved ? `stop-${index}` : "prompt"} id={labelId} className="qs5-label qs5-swap">
{moved ? stop.label : copy.prompt}
</span>
</div>
<div className={rangeClass} style={cssVars({ "--qs5-p": p })}>
<input
ref={rangeRef}
id={rangeId}
className="qs5-input"
type="range"
name={name}
min={0}
max={last}
step={1}
value={index}
disabled={isDisabled}
aria-valuetext={`${stop.amount}: ${stop.label}`}
aria-describedby={describedBy}
aria-invalid={invalid && !isDisabled ? true : undefined}
onChange={(event) => {
setIndex(Number(event.target.value))
touch()
}}
onPointerUp={touch}
onKeyDown={onKey}
/>
<div className="qs5-ticks" aria-hidden="true">
{list.map((item, i) => (
<span key={`${item.value}-${i}`} className={`qs5-tick${i === index ? " is-on" : ""}`} style={cssVars({ "--t": last > 0 ? i / last : 0 })}>
{item.tick}
</span>
))}
</div>
</div>
{invalid && !isDisabled ? (
<p className="qs5-err" id={errId} role="alert">
<AlertCircle className="qs5-inline" strokeWidth={2.5} aria-hidden="true" />
{errorText}
</p>
) : null}
<button type="submit" className={btnClass} disabled={isDisabled || loading}>
{loading ? (
<>
<Loader2 className="qs5-spin" strokeWidth={2.5} aria-hidden="true" />
{loadingLabel}
</>
) : (
ctaLabel
)}
</button>
<p className="qs5-note">
{isDisabled ? (
disabledText
) : (
<>
<Clock3 className="qs5-inline" strokeWidth={2.5} aria-hidden="true" />
{fill(copy.note, vars)}
</>
)}
</p>
</div>
</div>
</form>
</section>
)
}
export default QuizStart5
const STEP_KEYS = new Set(["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End", "PageUp", "PageDown"])
const DEFAULT_COPY: QuizStart5Copy = {
questionLabel: "Question 1 of {count}",
prompt: "Drag the slider to the hours you could give",
pullLine: "{count} {unit}. About {durationValue} {durationUnit}. One role made for your month.",
note: "{count} {unit} · about {durationValue} {durationUnit}",
questionSingular: "question",
questionPlural: "questions",
}
const DEFAULT_COLUMNS: QuizStart5Column[] = [
{
title: "Stop guessing where you fit",
body: "Most people who want to help never sign up, because every role looks like a big commitment. This quiz starts with the hours you have, not the hours we need.",
},
{
title: "Leave with one role made for your month",
body: "Your answers point to one volunteer role, what a shift looks like, and how to book your first one.",
},
]
const DEFAULT_STOPS: QuizStart5Stop[] = [
{ value: "1", amount: "1 hour", label: "a one-off shift welcoming people at the door", tick: "1" },
{ value: "2", amount: "2 hours", label: "a single sorting shift", tick: "2" },
{ value: "4", amount: "4 hours", label: "two sorting shifts, or one delivery run", tick: "4" },
{ value: "8", amount: "8 hours", label: "a regular weekly slot on the packing line", tick: "8" },
{ value: "12+", amount: "12+ hours", label: "a shift lead role that keeps one evening running", tick: "12+" },
]
function cssVars(values: Record<string, string | number>) {
return values as CSSProperties
}
function fill(template: string, values: Record<string, string | number>) {
return template.replace(/\{(\w+)\}/g, (match, key: string) => (key in values ? String(values[key]) : match))
}
function renderHeadline(headline: string, highlight?: string): ReactNode {
if (!highlight) return headline
const at = headline.indexOf(highlight)
if (at < 0) return headline
return (
<>
{headline.slice(0, at)}
<span className="qs5-mark">{highlight}</span>
{headline.slice(at + highlight.length)}
</>
)
}
function isThenable(value: unknown): value is Promise<void> {
return !!value && typeof (value as Promise<void>).then === "function"
}
const CSS = `
.cf-quiz-start-5{--qs5-gutter:clamp(16px,5vw,48px);--qs5-shadow:var(--shadow,oklch(0.22 0.03 260));--qs5-fill:var(--accent-fill,var(--accent));--qs5-marker:var(--marker,#fae37c);--qs5-thumb:44px;--qs5-track:14px;--qs5-ease:cubic-bezier(.2,.7,.2,1);position:relative;background:color-mix(in oklch,var(--ink) 4%,var(--surface));color:var(--ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) var(--qs5-gutter) clamp(64px,8.5vw,120px);overflow-x:clip}
.cf-quiz-start-5 *,.cf-quiz-start-5 *::before,.cf-quiz-start-5 *::after{box-sizing:border-box}
.cf-quiz-start-5 :where(h2,h3,p,figure){margin:0}
.cf-quiz-start-5 .qs5-spread{max-width:1120px;margin:0 auto;display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);grid-template-rows:auto 1fr;grid-template-areas:"page head" "page body";background:var(--card);border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(from var(--qs5-shadow) l c h / .22),0 12px 24px -8px oklch(from var(--qs5-shadow) l c h / .32)));overflow:hidden}
.cf-quiz-start-5 .qs5-head{grid-area:head;padding:clamp(28px,4.5vw,56px) clamp(24px,4.5vw,56px) 0}
.cf-quiz-start-5 .qs5-title{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}
.cf-quiz-start-5 .qs5-mark{background-image:linear-gradient(to bottom,transparent 50%,color-mix(in oklab,var(--qs5-marker) 62%,var(--card)) 50%,color-mix(in oklab,var(--qs5-marker) 62%,var(--card)) 94%,transparent 94%);padding:0 .1em;margin:0 -.04em;border-radius:.1em .32em .16em .36em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.cf-quiz-start-5 .qs5-lead{margin-top:16px;max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-quiz-start-5 .qs5-page{grid-area:page;position:relative;display:flex;flex-direction:column;justify-content:flex-end;gap:28px;background:var(--band);color:var(--band-ink);padding:clamp(20px,2.4vw,28px) clamp(20px,2.4vw,28px) clamp(28px,3.5vw,44px)}
.cf-quiz-start-5 .qs5-fig,.cf-quiz-start-5 .qs5-pull{position:relative;z-index:1}
.cf-quiz-start-5 .qs5-fig{flex:1 1 auto;display:flex;flex-direction:column;gap:12px;min-height:0}
.cf-quiz-start-5 .qs5-frame{position:relative;flex:1 1 auto;min-height:320px;border-radius:12px;overflow:hidden;background:oklch(from var(--band-ink) l c h / .08)}
.cf-quiz-start-5 .qs5-frame img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:center 40%}
.cf-quiz-start-5 .qs5-caption{font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--band-ink);text-wrap:pretty}
.cf-quiz-start-5 .qs5-pull{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(1.75rem,2.8vw,2.5rem);line-height:1.1;color:var(--band-ink);font-variant-numeric:tabular-nums;text-wrap:balance}
.cf-quiz-start-5 .qs5-body{grid-area:body;container-type:inline-size;padding:clamp(24px,3vw,32px) clamp(24px,4.5vw,56px) clamp(28px,4.5vw,56px)}
.cf-quiz-start-5 .qs5-cols{display:grid;gap:24px 32px}
@container (min-width:520px){.cf-quiz-start-5 .qs5-cols{grid-template-columns:repeat(2,minmax(0,1fr))}}
.cf-quiz-start-5 .qs5-sub{margin-bottom:8px;font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;color:var(--accent);text-wrap:balance}
.cf-quiz-start-5 .qs5-copy{font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--ink);text-wrap:pretty}
.cf-quiz-start-5 .qs5-quiz{margin-top:clamp(28px,3.5vw,40px);padding:clamp(20px,3vw,32px);border-radius:var(--radius,12px);background:color-mix(in oklch,var(--ink) 4%,var(--card))}
.cf-quiz-start-5 .qs5-qlabel{margin-bottom:12px;font-size:.875rem;line-height:1.2;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.cf-quiz-start-5 .qs5-question{font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;color:var(--ink);text-wrap:balance}
.cf-quiz-start-5 .qs5-question label{cursor:pointer}
.cf-quiz-start-5 .qs5-readout{display:flex;flex-direction:column;margin-top:20px}
.cf-quiz-start-5 .qs5-amount{margin-bottom:20px;font-family:var(--font-display);font-weight:800;font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--muted)}
.cf-quiz-start-5 .qs5-readout.is-moved .qs5-amount{color:var(--accent)}
.cf-quiz-start-5 .qs5-label{display:block;min-height:2.8em;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-quiz-start-5 .qs5-readout.is-moved .qs5-label{color:var(--ink)}
.cf-quiz-start-5 .qs5-range{position:relative;margin-top:8px;padding-bottom:32px;--qs5-stop:calc(var(--qs5-thumb) / 2 + (100% - var(--qs5-thumb)) * var(--qs5-p,0));--qs5-on:color-mix(in oklch,var(--ink) 30%,var(--card));--qs5-rest:color-mix(in oklch,var(--ink) 14%,var(--card))}
.cf-quiz-start-5 .qs5-range.is-moved{--qs5-on:var(--qs5-fill)}
.cf-quiz-start-5 .qs5-range.is-invalid{--qs5-rest:color-mix(in oklch,var(--danger) 24%,var(--card))}
.cf-quiz-start-5 .qs5-input{-webkit-appearance:none;appearance:none;display:block;width:100%;height:var(--qs5-thumb);margin:0;background:transparent;cursor:grab;touch-action:pan-y}
.cf-quiz-start-5 .qs5-input:active{cursor:grabbing}
.cf-quiz-start-5 .qs5-input:focus{outline:none}
.cf-quiz-start-5 .qs5-input:disabled{cursor:not-allowed}
.cf-quiz-start-5 .qs5-input::-webkit-slider-runnable-track{height:var(--qs5-track);border-radius:999px;background:linear-gradient(to right,var(--qs5-on) 0,var(--qs5-on) var(--qs5-stop),var(--qs5-rest) var(--qs5-stop),var(--qs5-rest) 100%);box-shadow:inset 0 1px 2px oklch(from var(--qs5-shadow) l c h / .22)}
.cf-quiz-start-5 .qs5-input::-moz-range-track{height:var(--qs5-track);border-radius:999px;background:var(--qs5-rest);box-shadow:inset 0 1px 2px oklch(from var(--qs5-shadow) l c h / .22)}
.cf-quiz-start-5 .qs5-input::-moz-range-progress{height:var(--qs5-track);border-radius:999px;background:var(--qs5-on)}
.cf-quiz-start-5 .qs5-input::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:var(--qs5-thumb);height:var(--qs5-thumb);margin-top:calc((var(--qs5-track) - var(--qs5-thumb)) / 2);border-radius:50%;border:3px solid var(--qs5-fill);background:radial-gradient(circle,var(--qs5-fill) 0 5px,transparent 5.5px),var(--card);box-shadow:var(--shadow-md,0 1px 2px oklch(from var(--qs5-shadow) l c h / .22),0 4px 10px -2px oklch(from var(--qs5-shadow) l c h / .2))}
.cf-quiz-start-5 .qs5-input::-moz-range-thumb{width:var(--qs5-thumb);height:var(--qs5-thumb);border-radius:50%;border:3px solid var(--qs5-fill);background:radial-gradient(circle,var(--qs5-fill) 0 5px,transparent 5.5px),var(--card);box-shadow:var(--shadow-md,0 1px 2px oklch(from var(--qs5-shadow) l c h / .22),0 4px 10px -2px oklch(from var(--qs5-shadow) l c h / .2))}
.cf-quiz-start-5 .qs5-input:hover::-webkit-slider-thumb{transform:scale(1.06);box-shadow:0 0 0 6px oklch(from var(--qs5-fill) l c h / .18),var(--shadow-md,0 1px 2px oklch(from var(--qs5-shadow) l c h / .22),0 4px 10px -2px oklch(from var(--qs5-shadow) l c h / .2))}
.cf-quiz-start-5 .qs5-input:hover::-moz-range-thumb{transform:scale(1.06);box-shadow:0 0 0 6px oklch(from var(--qs5-fill) l c h / .18),var(--shadow-md,0 1px 2px oklch(from var(--qs5-shadow) l c h / .22),0 4px 10px -2px oklch(from var(--qs5-shadow) l c h / .2))}
.cf-quiz-start-5 .qs5-range.is-hover .qs5-input::-webkit-slider-thumb{transform:scale(1.06);box-shadow:0 0 0 6px oklch(from var(--qs5-fill) l c h / .18),var(--shadow-md,0 1px 2px oklch(from var(--qs5-shadow) l c h / .22),0 4px 10px -2px oklch(from var(--qs5-shadow) l c h / .2))}
.cf-quiz-start-5 .qs5-range.is-hover .qs5-input::-moz-range-thumb{transform:scale(1.06);box-shadow:0 0 0 6px oklch(from var(--qs5-fill) l c h / .18),var(--shadow-md,0 1px 2px oklch(from var(--qs5-shadow) l c h / .22),0 4px 10px -2px oklch(from var(--qs5-shadow) l c h / .2))}
.cf-quiz-start-5 .qs5-input:active::-webkit-slider-thumb{transform:scale(1.1)}
.cf-quiz-start-5 .qs5-input:active::-moz-range-thumb{transform:scale(1.1)}
.cf-quiz-start-5 .qs5-input:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 5px oklch(from var(--field-focus,var(--accent)) l c h / .45),var(--shadow-md,0 1px 2px oklch(from var(--qs5-shadow) l c h / .22),0 4px 10px -2px oklch(from var(--qs5-shadow) l c h / .2))}
.cf-quiz-start-5 .qs5-input:focus-visible::-moz-range-thumb{box-shadow:0 0 0 5px oklch(from var(--field-focus,var(--accent)) l c h / .45),var(--shadow-md,0 1px 2px oklch(from var(--qs5-shadow) l c h / .22),0 4px 10px -2px oklch(from var(--qs5-shadow) l c h / .2))}
.cf-quiz-start-5 .qs5-range.is-invalid .qs5-input::-webkit-slider-thumb{border-color:var(--danger)}
.cf-quiz-start-5 .qs5-range.is-invalid .qs5-input::-moz-range-thumb{border-color:var(--danger)}
.cf-quiz-start-5 .qs5-range.is-off{--qs5-fill:color-mix(in oklch,var(--ink) 30%,var(--card))}
.cf-quiz-start-5 .qs5-range.is-off .qs5-input::-webkit-slider-thumb{transform:none;box-shadow:none}
.cf-quiz-start-5 .qs5-range.is-off .qs5-input::-moz-range-thumb{transform:none;box-shadow:none}
.cf-quiz-start-5 .qs5-ticks{position:absolute;left:0;right:0;bottom:0;height:24px}
.cf-quiz-start-5 .qs5-tick{position:absolute;top:2px;left:calc(var(--qs5-thumb) / 2 + (100% - var(--qs5-thumb)) * var(--t,0));transform:translateX(-50%);font-size:.9375rem;line-height:1.2;font-weight:600;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.cf-quiz-start-5 .qs5-range.is-moved .qs5-tick.is-on{color:var(--ink);font-weight:800}
.cf-quiz-start-5 .qs5-inline{display:inline-block;width:16px;height:16px;vertical-align:-0.15em;margin-inline-end:.4em}
.cf-quiz-start-5 .qs5-err{margin-top:12px;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--danger);text-wrap:pretty}
.cf-quiz-start-5 .qs5-btn{--qs5-b:var(--button-bg,var(--cta));--qs5-b2:var(--button-bg-2,var(--cta-2));display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:64px;margin-top:24px;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);cursor:pointer;background:linear-gradient(oklch(from var(--qs5-b) calc(l + .04) c h),oklch(from var(--qs5-b2) calc(l - .02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--qs5-b) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--qs5-b) calc(l - .16) c h),0 1px 2px oklch(from var(--qs5-shadow) l c h / .3),0 8px 16px -6px oklch(from var(--qs5-shadow) l c h / .35))}
.cf-quiz-start-5 .qs5-btn:not(.is-off):hover,.cf-quiz-start-5 .qs5-btn.is-hover:not(.is-off){background:linear-gradient(oklch(from var(--qs5-b) calc(l - .01) c h),oklch(from var(--qs5-b2) calc(l - .07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--qs5-b) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--qs5-b) calc(l - .18) c h),0 1px 2px oklch(from var(--qs5-shadow) l c h / .32),0 10px 18px -6px oklch(from var(--qs5-shadow) l c h / .42))}
.cf-quiz-start-5 .qs5-btn:not(.is-off):active,.cf-quiz-start-5 .qs5-btn.is-press:not(.is-off){transform:translateY(1px);background:linear-gradient(oklch(from var(--qs5-b) calc(l - .04) c h),oklch(from var(--qs5-b2) calc(l - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--qs5-b) calc(l - .22) c h / .6),inset 0 -2px 0 oklch(from var(--qs5-b) calc(l - .16) c h),0 1px 2px oklch(from var(--qs5-shadow) l c h / .3)}
.cf-quiz-start-5 .qs5-btn:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .6);outline-offset:3px}
.cf-quiz-start-5 .qs5-btn.is-off{background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));text-shadow:none;box-shadow:inset 0 0 0 1px oklch(from var(--ink) l c h / .16);cursor:not-allowed}
.cf-quiz-start-5 .qs5-btn[aria-busy],.cf-quiz-start-5 form[aria-busy] .qs5-btn{cursor:progress}
.cf-quiz-start-5 .qs5-spin{width:20px;height:20px;flex:none}
.cf-quiz-start-5 .qs5-note{margin-top:12px;text-align:center;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
@media (max-width:860px){
.cf-quiz-start-5 .qs5-spread{grid-template-columns:minmax(0,1fr);grid-template-rows:auto;grid-template-areas:"head" "page" "body"}
.cf-quiz-start-5 .qs5-head{padding:clamp(24px,5vw,40px) clamp(20px,5vw,40px) clamp(24px,5vw,32px)}
.cf-quiz-start-5 .qs5-page{gap:20px;padding:20px 20px 28px}
.cf-quiz-start-5 .qs5-fig{flex:none}
.cf-quiz-start-5 .qs5-frame{flex:none;min-height:0;aspect-ratio:16 / 10}
.cf-quiz-start-5 .qs5-body{padding:28px clamp(20px,5vw,40px) clamp(24px,5vw,40px)}
}
@media (max-width:420px){
.cf-quiz-start-5 .qs5-quiz{padding:20px 16px}
.cf-quiz-start-5 .qs5-btn{padding-inline:20px}
}
@media (prefers-reduced-motion:no-preference){
.cf-quiz-start-5 .qs5-reveal{animation:qs5-in .45s var(--qs5-ease) both;animation-delay:min(calc(var(--i,0) * .07s),.28s)}
.cf-quiz-start-5 .qs5-swap{animation:qs5-in .22s var(--qs5-ease) both}
.cf-quiz-start-5 .qs5-spin{animation:qs5-spin .8s linear infinite}
.cf-quiz-start-5 .qs5-btn{transition:transform .16s ease,box-shadow .16s ease,background .16s ease,color .16s ease}
.cf-quiz-start-5 .qs5-input::-webkit-slider-thumb{transition:transform .16s ease,box-shadow .16s ease}
.cf-quiz-start-5 .qs5-input::-moz-range-thumb{transition:transform .16s ease,box-shadow .16s ease}
}
@keyframes qs5-in{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes qs5-spin{to{transform:rotate(360deg)}}
@media (forced-colors:active){
.cf-quiz-start-5 .qs5-spread{border:1px solid CanvasText}
.cf-quiz-start-5 .qs5-btn{border:2px solid ButtonText}
}
`
pieces/forms/quiz-start-5/specimen.tsx 48 lines
import __studioImaged229c38d from "../assets/6984be64fc16f715.webp";
import { QuizStart5, type QuizStart5State } from "../quiz-start-5"
import { slot } from "../../slots"
export const states = ["default", "hover", "active", "disabled", "error"]
export default function QuizStart5Specimen({ state = "default" }: { state?: QuizStart5State }) {
return (
<QuizStart5
state={state}
headline="Find the way to help that fits your month"
highlight="fits your month"
lead="Five quick questions match you to one Riverbend Food Collective role that suits the time you really have."
columns={[
{
title: "Stop guessing where you fit",
body: "Most people who want to help never sign up, because every food bank role looks like a big commitment. This quiz starts with the hours you have, not the hours we need.",
},
{
title: "Leave with one role made for your month",
body: "Riverbend matches your answers to one volunteer role, shows you what a shift looks like, and tells you how to book your first one.",
},
]}
sceneImage={slot(
"scene",
__studioImaged229c38d,
)}
sceneAlt="Two volunteers sorting fresh vegetables into crates in a bright warehouse"
caption="Sorting, packing, delivery: every role starts with the hours you pick."
questionCount={5}
durationValue="2"
durationUnit="minutes"
question="How many hours could you give a month?"
stops={[
{ value: "1", amount: "1 hour", label: "a one-off shift welcoming neighbours at the pantry door", tick: "1" },
{ value: "2", amount: "2 hours", label: "a single sorting shift", tick: "2" },
{ value: "4", amount: "4 hours", label: "two sorting shifts, or one delivery run", tick: "4" },
{ value: "8", amount: "8 hours", label: "a regular weekly slot on the packing line", tick: "8" },
{ value: "12+", amount: "12+ hours", label: "a shift lead role that keeps one evening running", tick: "12+" },
]}
initialIndex={1}
ctaLabel="Find my way to help"
loadingLabel="Finding your way to help…"
errorText="Move the slider to the hours you could give, then start."
disabledText="The Riverbend quiz isn’t open right now."
/>
)
}
| Name | Type | Details |
|---|---|---|
copy OptionalQuizStart5 |
Partial<QuizStart5Copy> |
|
headline OptionalQuizStart5 |
string |
Default "Find the way to help that fits your month"
|
highlight OptionalQuizStart5 |
string |
Default "fits your month"
|
lead OptionalQuizStart5 |
string |
Default "A few quick questions match you to one volunteer role that suits the time you really have."
|
columns OptionalQuizStart5 |
QuizStart5Column[] |
Default DEFAULT_COLUMNS
|
sceneImage OptionalQuizStart5 |
string |
|
sceneAlt OptionalQuizStart5 |
string |
Default ""
|
caption OptionalQuizStart5 |
string |
|
questionCount OptionalQuizStart5 |
number |
Default 5
|
durationValue OptionalQuizStart5 |
string |
Default "2"
|
durationUnit OptionalQuizStart5 |
string |
Default "minutes"
|
pullLine OptionalQuizStart5 |
string |
|
question OptionalQuizStart5 |
string |
Default "How many hours could you give a month?"
|
stops OptionalQuizStart5 |
QuizStart5Stop[] |
Default DEFAULT_STOPS
|
initialIndex OptionalQuizStart5 |
number |
Default 1
|
name OptionalQuizStart5 |
string |
Default "hours"
|
ctaLabel OptionalQuizStart5 |
string |
Default "Find my way to help"
|
loadingLabel OptionalQuizStart5 |
string |
Default "Finding your way to help…"
|
errorText OptionalQuizStart5 |
string |
Default "Move the slider to the hours you could give, then start."
|
disabled OptionalQuizStart5 |
boolean |
Default false
|
disabledText OptionalQuizStart5 |
string |
Default "This quiz isn’t open right now."
|
state OptionalQuizStart5 |
QuizStart5State |
Default "default"
|
onSubmit OptionalQuizStart5 |
(answer: string) => void | Promise<void> |
|
onAction OptionalQuizStart5 |
(answer: string) => void |
|
className OptionalQuizStart5 |
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.
--button-2-bg--button-2-ink- 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.
-
2c539f422023a290.webp
image/webp · 115 KB
-
6984be64fc16f715.webp
image/webp · 124 KB