Quiz Start 2
Starts a quiz with a self-identifying first tap. A full-bleed lifestyle photo sits behind a start card that breaks its lower edge. The card carries the time and question-count promise and opens question 1 as big photo tiles. Picking a tile lifts it and wakes the start button.
Use it in a prompt
Use forms/quiz-start-2 from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/forms/quiz-start-2.tsx. - Import it and pass your copy and images (Props tab):
import { QuizStart2 } from "@/components/funneldna/forms/quiz-start-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/quiz-start-2/component.tsx 599 lines
// layout: photo-overlap-card
// Starts a quiz with a self-identifying first tap. A full-bleed lifestyle photo sits behind a start card that breaks its lower edge. The card carries the time and question-count promise and opens question 1 as big photo tiles. Picking a tile lifts it and wakes the start button.
"use client"
import { useEffect, useId, useRef, useState, type CSSProperties, type FormEvent, type MouseEvent, type ReactNode } from "react"
import { AlertCircle, Check, Clock3, Loader2, Lock, MousePointerClick } from "lucide-react"
export type QuizStart2Cell = "top-left" | "top-right" | "bottom-left" | "bottom-right"
export type QuizStart2Choice = {
value: string
label: string
/** Tile photo (item-n slot). Layout media only, never proof. */
image?: string
/** Alt text for the tile photo. Empty by default because the label under it names the choice. */
imageAlt?: string
/** Set this when image is a 2x2 sheet of four photos. It picks the cell this tile shows. Omit it for a single photo. */
imageCell?: QuizStart2Cell
}
/** Preview states this piece implements. "hover" and "active" pick the first tile and force the button look. */
export type QuizStart2State = "default" | "hover" | "active" | "disabled" | "error"
/** Generated labels. Named placeholders in braces are replaced as text. */
export type QuizStart2Copy = {
/** Placeholder: {count} */
stepLabel: string
/** Accessible name of the progress pips. Placeholder: {count} */
progressLabel: string
questionSingular: string
questionPlural: string
/** Line under the button after a pick. Placeholders: {count}, {unit}, {durationValue}, {durationUnit} */
reassurance: string
/** Used when durationValue is empty. Placeholders: {count}, {unit} */
reassuranceShort: string
}
export type QuizStart2Props = {
/** Templated labels; placeholders are replaced as text. */
copy?: Partial<QuizStart2Copy>
/** scene slot: the full-bleed lifestyle photo the card overlaps. Without it the card sits on the band. */
sceneImage?: string
sceneAlt?: string
/** object-position for the photo, e.g. "center 35%". */
sceneFocus?: string
headline?: string
/** One continuous phrase inside the headline, shown in the accent colour. */
highlight?: string
subheadline?: string
/** The duration number shown in the big stat and in the reassurance line. Leave it empty to hide the stat. */
durationValue?: string
durationUnit?: string
/** The real number of questions. Drives the stat, the step label and the progress pips. */
questionCount?: number
/** Subhead above the find-out list. */
findOutTitle?: string
/** What the visitor finds out (three short lines reads best). */
findOut?: ReactNode[]
/** The first question, already open. */
question?: string
/** One short line under the question. */
nudge?: string
/** Four reads best: 4 across on desktop, 2x2 on phones. */
choices?: QuizStart2Choice[]
ctaLabel?: string
/** Button label while a promise returned by onSubmit is pending. */
loadingLabel?: string
/** Line under the sleeping button before a pick. */
hintText?: string
/** Overrides copy.reassurance. */
reassurance?: string
/** Inline error shown when the visitor presses start without a pick. */
errorText?: string
disabled?: boolean
/** Line under the button while the quiz is disabled. */
disabledText?: string
state?: QuizStart2State
/** Called each time a tile is picked. */
onSelect?: (answer: string) => void
/** Validated first answer. A returned promise shows the loading label. */
onSubmit?: (answer: string) => void | Promise<void>
/** Called with the answer after onSubmit settles (e.g. show question 2). */
onAction?: (answer: string) => void
className?: string
}
export function QuizStart2({
copy: copyOverrides,
sceneImage,
sceneAlt = "",
sceneFocus = "center 35%",
headline = "Find your best next step in 60 seconds",
highlight = "in 60 seconds",
subheadline = "Answer a few quick questions and get a simple plan matched to where you are right now.",
durationValue = "60",
durationUnit = "seconds",
questionCount = 5,
findOutTitle = "When you finish, you’ll know:",
findOut = DEFAULT_FIND_OUT,
question = "Which one sounds like you?",
nudge = "Tap the one that sounds most like you right now.",
choices = DEFAULT_CHOICES,
ctaLabel = "Send Me My Plan",
loadingLabel = "Opening your quiz…",
hintText = "Pick the one that sounds like you to start.",
reassurance,
errorText = "Pick the one that sounds most like you first.",
disabled = false,
disabledText = "This quiz isn’t open right now.",
state = "default",
onSelect,
onSubmit,
onAction,
className = "",
}: QuizStart2Props) {
const copy: QuizStart2Copy = { ...DEFAULT_COPY, ...copyOverrides }
const uid = useId().split(":").join("")
const titleId = `${uid}-title`
const qId = `${uid}-q`
const nudgeId = `${uid}-nudge`
const errId = `${uid}-err`
const count = Number.isFinite(questionCount) ? Math.max(1, Math.round(questionCount)) : 5
const unit = count === 1 ? copy.questionSingular : copy.questionPlural
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 radios = useRef<(HTMLInputElement | null)[]>([])
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 asleep = !picked && !isDisabled
const showError = invalid && !isDisabled && !picked
const showDuration = Boolean(durationValue)
const pipCount = Math.min(count, 12)
const cols = Math.min(Math.max(choices.length, 1), 4)
const reassureLine =
reassurance ??
(showDuration
? fill(copy.reassurance, { count, unit, durationValue, durationUnit })
: fill(copy.reassuranceShort, { count, unit }))
const describedBy = [nudge ? nudgeId : "", showError ? errId : ""].filter(Boolean).join(" ") || undefined
function flagMissing() {
setInvalid(true)
radios.current[0]?.focus()
}
function choose(value: string) {
setAnswer(value)
setInvalid(false)
onSelect?.(value)
}
function onButton(event: MouseEvent<HTMLButtonElement>) {
if (loading) {
event.preventDefault()
return
}
if (asleep) {
event.preventDefault()
flagMissing()
}
}
async function submit(event: FormEvent<HTMLFormElement>) {
event.preventDefault()
if (isDisabled || loading) return
if (!picked) {
flagMissing()
return
}
setInvalid(false)
try {
const result = onSubmit?.(answer)
if (isThenable(result)) {
setLoading(true)
await result
}
onAction?.(answer)
} catch {
// No failure UI here; the caller reports errors.
} finally {
if (mounted.current) setLoading(false)
}
}
let note: ReactNode
if (isDisabled) {
note = (
<>
<Lock className="qs2-ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{disabledText}
</>
)
} else if (picked) {
note = (
<>
<Clock3 className="qs2-ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{reassureLine}
</>
)
} else {
note = (
<>
<MousePointerClick className="qs2-ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{hintText}
</>
)
}
const btnClass = `qs2-btn${picked && !isDisabled ? " is-awake" : ""}${state === "hover" ? " is-hover" : ""}${state === "active" ? " is-press" : ""}`
return (
<section
className={`cf-quiz-start-2 ${className}`.trim()}
aria-labelledby={titleId}
data-photo={sceneImage ? "" : undefined}
>
<style>{CSS}</style>
{sceneImage ? (
<div className="qs2-photo">
<img src={sceneImage} alt={sceneAlt} width={1600} height={900} decoding="async" style={{ objectPosition: sceneFocus }} />
</div>
) : null}
<div className="qs2-wrap">
<form className="qs2-card" onSubmit={submit} noValidate aria-busy={loading || undefined}>
<div className="qs2-head">
<div className="qs2-intro">
<h2 id={titleId} className="qs2-title">
{renderHeadline(headline, highlight)}
</h2>
{subheadline ? <p className="qs2-sub">{subheadline}</p> : null}
</div>
<div className="qs2-facts">
<div className={`qs2-stats${showDuration ? "" : " is-single"}`}>
{showDuration ? (
<p className="qs2-stat">
<span className="qs2-num">{durationValue}</span>
<span className="qs2-unit">{durationUnit}</span>
</p>
) : null}
<p className="qs2-stat">
<span className="qs2-num">{count}</span>
<span className="qs2-unit">{unit}</span>
</p>
</div>
{findOut.length ? (
<>
{findOutTitle ? <h3 className="qs2-find">{findOutTitle}</h3> : null}
<ul className="qs2-list">
{findOut.map((item, index) => (
<li key={index}>
<span className="qs2-tick" aria-hidden="true">
<Check size={14} strokeWidth={3} />
</span>
<span>{item}</span>
</li>
))}
</ul>
</>
) : null}
</div>
</div>
<div className="qs2-q">
<div className="qs2-meta">
<p className="qs2-step">{fill(copy.stepLabel, { count })}</p>
<div className="qs2-pips" role="img" aria-label={fill(copy.progressLabel, { count })}>
{Array.from({ length: pipCount }, (_, index) => (
<span
key={index}
className={`qs2-pip${index === 0 ? " is-now" : ""}${index === 0 && picked ? " is-done" : ""}`}
/>
))}
</div>
</div>
<h3 id={qId} className="qs2-question">
{question}
</h3>
{nudge ? (
<p id={nudgeId} className="qs2-nudge">
{nudge}
</p>
) : null}
<fieldset
className="qs2-tiles"
disabled={isDisabled}
aria-labelledby={qId}
aria-describedby={describedBy}
aria-invalid={showError || undefined}
data-picked={picked ? "" : undefined}
style={{ "--qs2-cols": String(cols) } as CSSProperties}
>
{choices.map((choice, index) => {
const id = `${uid}-c${index}`
const isPicked = choice.value === answer
return (
<label
key={choice.value}
htmlFor={id}
className={`qs2-tile${isPicked ? " is-picked" : ""}${choice.image ? "" : " no-media"}`}
style={{ "--i": index } as CSSProperties}
>
<input
ref={(element) => {
radios.current[index] = element
}}
id={id}
className="qs2-radio"
type="radio"
name={`${uid}-answer`}
value={choice.value}
checked={isPicked}
onChange={() => choose(choice.value)}
/>
{choice.image ? (
<span className="qs2-media">
<img
src={choice.image}
alt={choice.imageAlt ?? ""}
decoding="async"
data-cell={choice.imageCell}
style={choice.imageCell ? { transformOrigin: CELL_ORIGIN[choice.imageCell] } : undefined}
/>
</span>
) : null}
<span className="qs2-label">{choice.label}</span>
<span className="qs2-dot" aria-hidden="true">
<Check size={16} strokeWidth={3} />
</span>
</label>
)
})}
</fieldset>
<div className="qs2-live" aria-live="polite">
{showError ? (
<p id={errId} className="qs2-error">
<AlertCircle className="qs2-ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{errorText}
</p>
) : null}
</div>
<div className="qs2-actions">
<button
type="submit"
className={btnClass}
disabled={isDisabled}
aria-disabled={asleep || loading ? true : undefined}
data-asleep={asleep ? "" : undefined}
onClick={onButton}
>
{loading ? (
<>
<Loader2 className="qs2-spin" size={20} strokeWidth={2.5} aria-hidden="true" />
{loadingLabel}
</>
) : (
ctaLabel
)}
</button>
<p className="qs2-note">{note}</p>
</div>
</div>
</form>
</div>
</section>
)
}
export default QuizStart2
const DEFAULT_COPY: QuizStart2Copy = {
stepLabel: "Question 1 of {count}",
progressLabel: "Question 1 of {count}",
questionSingular: "question",
questionPlural: "questions",
reassurance: "{count} {unit} · About {durationValue} {durationUnit}",
reassuranceShort: "{count} {unit}",
}
const DEFAULT_FIND_OUT: ReactNode[] = [
"Where you’re starting from, in plain words",
"The one change that matters most right now",
"What to skip so you stop losing time",
]
const DEFAULT_CHOICES: QuizStart2Choice[] = [
{ value: "starting", label: "I’m just getting started" },
{ value: "stuck", label: "I’ve tried things that didn’t stick" },
{ value: "growing", label: "It works, I want more from it" },
{ value: "simple", label: "I need it simple and fast" },
]
const CELL_ORIGIN: Record<QuizStart2Cell, string> = {
"top-left": "0% 0%",
"top-right": "100% 0%",
"bottom-left": "0% 100%",
"bottom-right": "100% 100%",
}
function fill(template: string, values: Record<string, string | number>): string {
return Object.keys(values).reduce((out, key) => out.split(`{${key}}`).join(String(values[key])), template)
}
function renderHeadline(text: string, phrase?: string): ReactNode {
if (!phrase) return text
const at = text.indexOf(phrase)
if (at < 0) return text
return (
<>
{text.slice(0, at)}
<span className="qs2-hl">{phrase}</span>
{text.slice(at + phrase.length)}
</>
)
}
function isThenable(value: unknown): value is Promise<void> {
return typeof value === "object" && value !== null && typeof (value as { then?: unknown }).then === "function"
}
const CSS = `
.cf-quiz-start-2{
--qs2-ink:var(--ink, oklch(0.21 0.034 263));
--qs2-card:var(--card, #ffffff);
--qs2-muted:var(--muted, oklch(0.45 0.03 258));
--qs2-accent:var(--accent, oklch(0.5 0.17 257));
--qs2-shade:var(--shadow, oklch(0.22 0.03 256));
--qs2-line:oklch(from var(--qs2-ink) l c h / 0.12);
--qs2-well:color-mix(in oklch, var(--qs2-ink) 4%, var(--qs2-card));
--qs2-tile:color-mix(in oklch, var(--qs2-ink) 5%, var(--qs2-card));
--qs2-tile-hover:color-mix(in oklch, var(--qs2-ink) 8%, var(--qs2-card));
--qs2-pick:color-mix(in oklch, var(--qs2-accent) 12%, var(--qs2-card));
--qs2-ring:oklch(from var(--field-focus, var(--qs2-accent)) l c h / 0.6);
--qs2-gutter:clamp(16px, 5vw, 48px);
position:relative;isolation:isolate;width:100%;box-sizing:border-box;
padding-bottom:clamp(64px, 8.5vw, 120px);
background:var(--surface, #ffffff);color:var(--qs2-ink);
font-family:var(--font-body, system-ui, sans-serif);
overflow-x:clip;
}
.cf-quiz-start-2 *,.cf-quiz-start-2 *::before,.cf-quiz-start-2 *::after{box-sizing:border-box}
.cf-quiz-start-2 .qs2-photo{position:relative;height:clamp(360px, 42vw, 600px);overflow:hidden;background:var(--qs2-well)}
.cf-quiz-start-2 .qs2-photo img{display:block;width:100%;height:100%;object-fit:cover}
.cf-quiz-start-2 .qs2-photo::after{content:'';position:absolute;inset:auto 0 0 0;height:45%;pointer-events:none;
background:linear-gradient(to bottom, oklch(from var(--band, oklch(0.27 0.067 256)) l c h / 0), oklch(from var(--band, oklch(0.27 0.067 256)) l c h / 0.3))}
.cf-quiz-start-2 .qs2-wrap{position:relative;z-index:1;max-width:calc(1120px + 2 * var(--qs2-gutter));margin:calc(-1 * clamp(96px, 11vw, 200px)) auto 0;padding:0 var(--qs2-gutter)}
.cf-quiz-start-2:not([data-photo]) .qs2-wrap{margin-top:0;padding-top:clamp(56px, 8vw, 112px)}
.cf-quiz-start-2 .qs2-card{position:relative;margin:0;padding:clamp(20px, 3.6vw, 48px);
background:var(--qs2-card);color:var(--qs2-ink);
border:1px solid var(--card-border, oklch(from var(--qs2-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(from var(--qs2-shade) l c h / 0.22), 0 12px 24px -8px oklch(from var(--qs2-shade) l c h / 0.32)));
animation:qs2-rise .45s cubic-bezier(.2,.7,.2,1) backwards}
.cf-quiz-start-2 .qs2-head{display:grid;grid-template-columns:minmax(0, 1.25fr) minmax(0, 1fr);gap:clamp(24px, 4.5vw, 64px);align-items:start}
.cf-quiz-start-2 .qs2-title{margin:0;font-family:var(--font-display, inherit);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(--qs2-ink);text-wrap:balance}
.cf-quiz-start-2 .qs2-hl{color:var(--qs2-accent)}
.cf-quiz-start-2 .qs2-sub{margin:16px 0 0;max-width:60ch;font-size:clamp(1.125rem, 1.5vw, 1.375rem);line-height:1.4;font-weight:500;color:var(--qs2-muted);text-wrap:pretty}
.cf-quiz-start-2 .qs2-facts{padding:clamp(20px, 2.4vw, 28px);border-radius:10px;background:var(--qs2-well)}
.cf-quiz-start-2 .qs2-stats{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin:0}
.cf-quiz-start-2 .qs2-stats.is-single{grid-template-columns:1fr}
.cf-quiz-start-2 .qs2-stat{display:flex;flex-direction:column;gap:20px;margin:0;min-width:0}
.cf-quiz-start-2 .qs2-num{font-family:var(--font-display, inherit);font-weight:var(--display-weight, 800);font-size:clamp(2.5rem, 4.2vw, 3.75rem);line-height:1.1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--qs2-ink)}
.cf-quiz-start-2 .qs2-unit{font-size:15px;line-height:1.4;font-weight:600;color:var(--qs2-muted)}
.cf-quiz-start-2 .qs2-find{margin:24px 0 12px;font-family:var(--font-display, inherit);font-weight:var(--display-weight, 800);text-transform:var(--display-case, none);
font-size:clamp(1.3125rem, 1.8vw, 1.625rem);line-height:1.15;letter-spacing:-0.01em;color:var(--qs2-ink);text-wrap:balance}
.cf-quiz-start-2 .qs2-list{display:grid;gap:12px;margin:0;padding:0;list-style:none}
.cf-quiz-start-2 .qs2-list li{display:flex;align-items:flex-start;gap:12px;font-size:clamp(1.0625rem, 1.25vw, 1.125rem);line-height:1.45;font-weight:500;color:var(--qs2-ink);text-wrap:pretty}
.cf-quiz-start-2 .qs2-tick{flex:none;display:grid;place-items:center;width:24px;height:24px;margin-top:1px;border-radius:999px;background:var(--success, oklch(0.5 0.14 150));color:var(--success-ink, #ffffff)}
.cf-quiz-start-2 .qs2-q{margin-top:clamp(32px, 4.5vw, 56px)}
.cf-quiz-start-2 .qs2-meta{display:flex;align-items:center;flex-wrap:wrap;gap:12px 16px;margin:0 0 12px}
.cf-quiz-start-2 .qs2-step{margin:0;font-size:15px;line-height:1.4;font-weight:700;color:var(--qs2-muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.cf-quiz-start-2 .qs2-pips{display:flex;gap:6px;flex:0 1 240px;min-width:96px}
.cf-quiz-start-2 .qs2-pip{flex:1;height:6px;border-radius:999px;overflow:hidden;background:oklch(from var(--qs2-ink) l c h / 0.12)}
.cf-quiz-start-2 .qs2-pip.is-now::after{content:'';display:block;height:100%;background:var(--accent-fill, var(--qs2-accent));transform:scaleX(.2);transform-origin:left center;transition:transform .45s cubic-bezier(.2,.7,.2,1)}
.cf-quiz-start-2 .qs2-pip.is-done::after{transform:scaleX(1)}
.cf-quiz-start-2 .qs2-question{margin:0;font-family:var(--font-display, inherit);font-weight:var(--display-weight, 800);text-transform:var(--display-case, none);
font-size:clamp(1.3125rem, 1.8vw, 1.625rem);line-height:1.15;letter-spacing:-0.01em;color:var(--qs2-ink);text-wrap:balance}
.cf-quiz-start-2 .qs2-nudge{margin:8px 0 0;font-size:15px;line-height:1.4;font-weight:500;color:var(--qs2-muted);text-wrap:pretty}
.cf-quiz-start-2 .qs2-tiles{display:grid;grid-template-columns:repeat(var(--qs2-cols, 4), minmax(0, 1fr));gap:clamp(12px, 1.6vw, 20px);min-width:0;margin:24px 0 0;padding:0;border:0}
.cf-quiz-start-2 .qs2-tile{position:relative;display:flex;flex-direction:column;gap:12px;min-width:0;padding:8px 8px 16px;
border-radius:var(--radius, 12px);background:var(--qs2-tile);box-shadow:inset 0 0 0 1px var(--qs2-line);
color:var(--qs2-ink);text-align:center;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;
transition:transform .16s ease, box-shadow .16s ease, background-color .16s ease;
animation:qs2-rise .45s cubic-bezier(.2,.7,.2,1) backwards;animation-delay:min(calc(var(--i, 0) * .07s), .28s)}
.cf-quiz-start-2 .qs2-tile.no-media{justify-content:center;min-height:120px;padding:20px 52px 20px 20px;text-align:start}
.cf-quiz-start-2 .qs2-radio{position:absolute;top:8px;left:8px;width:1px;height:1px;margin:0;opacity:0;pointer-events:none}
.cf-quiz-start-2 .qs2-media{position:relative;display:block;aspect-ratio:1 / 1;overflow:hidden;border-radius:calc(var(--radius, 12px) - 4px);background:var(--qs2-well)}
.cf-quiz-start-2 .qs2-media img{display:block;width:100%;height:100%;object-fit:cover;transition:filter .2s ease}
.cf-quiz-start-2 .qs2-media img[data-cell]{transform:scale(2.06)}
.cf-quiz-start-2 .qs2-label{display:block;padding:0 4px;font-size:clamp(1.0625rem, 1.25vw, 1.125rem);line-height:1.25;font-weight:700;text-wrap:balance}
.cf-quiz-start-2 .qs2-dot{position:absolute;top:16px;right:16px;display:grid;place-items:center;width:28px;height:28px;border-radius:999px;
background:var(--qs2-card);color:transparent;
box-shadow:inset 0 0 0 2px oklch(from var(--qs2-ink) l c h / 0.32), 0 1px 2px oklch(from var(--qs2-shade) l c h / 0.3);
transition:background-color .16s ease, color .16s ease}
.cf-quiz-start-2 .qs2-tile.no-media .qs2-dot{top:50%;margin-top:-14px}
@media (hover: hover){
.cf-quiz-start-2 .qs2-tiles:not(:disabled) .qs2-tile:not(.is-picked):hover{transform:translateY(-2px);background:var(--qs2-tile-hover);
box-shadow:inset 0 0 0 1px oklch(from var(--qs2-ink) l c h / 0.22), 0 1px 2px oklch(from var(--qs2-shade) l c h / 0.2), 0 8px 14px -8px oklch(from var(--qs2-shade) l c h / 0.32)}
}
.cf-quiz-start-2 .qs2-tiles:not(:disabled) .qs2-tile:active{transform:translateY(0) scale(.985)}
.cf-quiz-start-2 .qs2-tile:has(.qs2-radio:focus-visible){outline:3px solid var(--qs2-ring);outline-offset:3px}
.cf-quiz-start-2 .qs2-tile.is-picked{transform:translateY(-6px);background:var(--qs2-pick);
box-shadow:inset 0 0 0 2px var(--qs2-accent), 0 2px 4px oklch(from var(--qs2-shade) l c h / 0.22), 0 16px 24px -12px oklch(from var(--qs2-shade) l c h / 0.4)}
.cf-quiz-start-2 .qs2-tile.is-picked .qs2-dot{background:var(--accent-fill, var(--qs2-accent));color:var(--accent-fill-ink, var(--qs2-card));
box-shadow:0 1px 2px oklch(from var(--qs2-shade) l c h / 0.3);animation:qs2-pop .3s cubic-bezier(.2,.7,.2,1)}
.cf-quiz-start-2 .qs2-tiles[data-picked] .qs2-tile:not(.is-picked) .qs2-media img{filter:saturate(.7)}
.cf-quiz-start-2 .qs2-tiles[aria-invalid='true'] .qs2-tile{box-shadow:inset 0 0 0 2px var(--danger, oklch(0.5 0.17 27))}
.cf-quiz-start-2 .qs2-tiles:disabled .qs2-tile{cursor:not-allowed;animation:none}
.cf-quiz-start-2 .qs2-tiles:disabled .qs2-media img{filter:grayscale(1)}
.cf-quiz-start-2 .qs2-tiles:disabled .qs2-label{color:var(--qs2-muted)}
.cf-quiz-start-2 .qs2-error{display:block;margin:16px 0 0;font-size:15px;line-height:1.4;font-weight:700;color:var(--danger, oklch(0.5 0.17 27));text-wrap:pretty}
.cf-quiz-start-2 .qs2-ico{display:inline-block;width:16px;height:16px;vertical-align:-0.15em;margin-inline-end:.4em}
.cf-quiz-start-2 .qs2-actions{display:flex;flex-direction:column;align-items:flex-start;gap:12px;margin-top:clamp(28px, 3.4vw, 40px)}
.cf-quiz-start-2 .qs2-note{margin:0;font-size:15px;line-height:1.4;font-weight:600;color:var(--qs2-muted);text-wrap:pretty}
.cf-quiz-start-2 .qs2-btn{--qs2-b:var(--button-bg, var(--cta, oklch(0.58 0.21 29)));--qs2-b2:var(--button-bg-2, var(--cta-2, oklch(0.51 0.21 29)));
appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:10px;width:min(100%, 440px);min-height:64px;margin:0;padding:0 28px;border:0;
border-radius:var(--button-radius, var(--radius, 12px));
font-family:var(--button-font, var(--font-display, inherit));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;letter-spacing:-0.005em;text-align:center;
color:var(--button-ink, var(--cta-ink, #ffffff));text-shadow:var(--button-text-shadow, none);
background:linear-gradient(oklch(from var(--qs2-b) calc(l + 0.04) c h), oklch(from var(--qs2-b2) calc(l - 0.02) c h));
box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--qs2-b) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--qs2-b) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--qs2-shade) l c h / 0.3), 0 8px 16px -6px oklch(from var(--qs2-shade) l c h / 0.42));
cursor:pointer;transition:transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease}
.cf-quiz-start-2 .qs2-btn:not([data-asleep]):not(:disabled):hover,.cf-quiz-start-2 .qs2-btn.is-hover{transform:translateY(-1px);
background:linear-gradient(oklch(from var(--qs2-b) calc(l - 0.01) c h), oklch(from var(--qs2-b2) calc(l - 0.07) c h));
box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--qs2-b) calc(l + 0.1) c h / 0.6), inset 0 -3px 0 oklch(from var(--qs2-b) calc(l - 0.2) c h), 0 1px 2px oklch(from var(--qs2-shade) l c h / 0.32), 0 10px 18px -6px oklch(from var(--qs2-shade) l c h / 0.5))}
.cf-quiz-start-2 .qs2-btn:not([data-asleep]):not(:disabled):active,.cf-quiz-start-2 .qs2-btn.is-press{transform:translateY(1px);
background:linear-gradient(oklch(from var(--qs2-b) calc(l - 0.05) c h), oklch(from var(--qs2-b2) calc(l - 0.08) c h));
box-shadow:inset 0 2px 4px oklch(from var(--qs2-shade) l c h / 0.35), inset 0 -2px 0 oklch(from var(--qs2-b) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--qs2-shade) l c h / 0.3)}
.cf-quiz-start-2 .qs2-btn:focus-visible{outline:3px solid var(--qs2-ring);outline-offset:3px}
.cf-quiz-start-2 .qs2-btn[data-asleep],.cf-quiz-start-2 .qs2-btn:disabled{transform:none;text-shadow:none;
background:var(--button-2-bg, var(--secondary, oklch(0.93 0.015 263)));color:var(--qs2-muted);box-shadow:inset 0 0 0 1px var(--qs2-line)}
.cf-quiz-start-2 .qs2-btn[data-asleep]{cursor:default}
.cf-quiz-start-2 .qs2-btn:disabled{cursor:not-allowed}
.cf-quiz-start-2 .qs2-btn.is-awake{animation:qs2-wake .34s cubic-bezier(.2,.7,.2,1)}
.cf-quiz-start-2 .qs2-spin{flex:none;animation:qs2-spin .8s linear infinite}
@keyframes qs2-rise{from{opacity:.82;transform:translateY(8px)}}
@keyframes qs2-pop{from{transform:scale(.9)}}
@keyframes qs2-wake{from{transform:scale(.95)}}
@keyframes qs2-spin{to{transform:rotate(360deg)}}
@media (max-width: 900px){
.cf-quiz-start-2 .qs2-head{grid-template-columns:minmax(0, 1fr)}
}
@media (max-width: 760px){
.cf-quiz-start-2 .qs2-tiles{grid-template-columns:repeat(2, minmax(0, 1fr));gap:12px}
}
@media (max-width: 640px){
.cf-quiz-start-2 .qs2-photo{height:200px}
.cf-quiz-start-2 .qs2-wrap{margin-top:-48px}
.cf-quiz-start-2 .qs2-card{padding:20px}
.cf-quiz-start-2 .qs2-tile{gap:10px;padding:6px 6px 12px}
.cf-quiz-start-2 .qs2-tile.no-media{min-height:104px;padding:16px 44px 16px 16px}
.cf-quiz-start-2 .qs2-tile.is-picked{transform:translateY(-4px)}
.cf-quiz-start-2 .qs2-label{font-size:16px}
.cf-quiz-start-2 .qs2-dot{top:12px;right:12px;width:24px;height:24px}
.cf-quiz-start-2 .qs2-tile.no-media .qs2-dot{margin-top:-12px}
.cf-quiz-start-2 .qs2-actions{align-items:stretch;text-align:center}
.cf-quiz-start-2 .qs2-btn{width:100%}
}
@media (prefers-reduced-motion: reduce){
.cf-quiz-start-2 .qs2-card,.cf-quiz-start-2 .qs2-tile,.cf-quiz-start-2 .qs2-btn,.cf-quiz-start-2 .qs2-dot,.cf-quiz-start-2 .qs2-tile.is-picked .qs2-dot{animation:none;transition:none}
.cf-quiz-start-2 .qs2-pip.is-now::after,.cf-quiz-start-2 .qs2-media img{transition:none}
.cf-quiz-start-2 .qs2-spin{animation:none}
}
`
pieces/forms/quiz-start-2/specimen.tsx 59 lines
import __studioImage3b6f8d67 from "../assets/04820d7fbf07272e.webp";
import __studioImage892d617c from "../assets/ce1784c79086ef25.webp";
import { QuizStart2, type QuizStart2Cell, type QuizStart2State } from "../quiz-start-2"
import { slot } from "../../slots"
const SCENE = __studioImage3b6f8d67
const SHEET = __studioImage892d617c
const CHOICES: { value: string; label: string; cell: QuizStart2Cell }[] = [
{ value: "oily", label: "Shiny by lunch", cell: "top-left" },
{ value: "dry", label: "Tight and flaky", cell: "top-right" },
{ value: "combination", label: "Shiny T-zone, dry cheeks", cell: "bottom-left" },
{ value: "sensitive", label: "Red and easily upset", cell: "bottom-right" },
]
export const states = ["default", "hover", "active", "disabled", "error"]
export default function QuizStart2Specimen({ state = "default" }: { state?: QuizStart2State }) {
const choices = CHOICES.map((choice, index) => {
const image = slot(`item-${index + 1}`, SHEET)
return {
value: choice.value,
label: choice.label,
image,
imageCell: image === SHEET ? choice.cell : undefined,
}
})
return (
<QuizStart2
state={state}
sceneImage={slot("scene", SCENE)}
sceneAlt="A woman patting moisturiser into her cheek beside a sunlit bathroom window"
sceneFocus="center 30%"
headline="Find the routine your skin actually wants in 60 seconds"
highlight="in 60 seconds"
subheadline="Six quick taps and the Larkspur Skin Routine Finder matches you to a simple morning and night routine. No 10-step shelf."
durationValue="60"
durationUnit="seconds"
questionCount={6}
findOutTitle="When you finish, you’ll know:"
findOut={[
"Your skin type, in plain words",
"The 3 steps your routine actually needs",
"Which product to stop using tonight",
]}
question="Which one sounds like you?"
nudge="Think about your skin at 3pm on a normal day."
choices={choices}
ctaLabel="Send Me My Routine"
loadingLabel="Opening question 2…"
hintText="Tap the one that sounds like you to start."
reassurance="Free · 6 questions · About 60 seconds"
errorText="Pick the one that sounds most like your skin first."
disabledText="The Routine Finder is closed for a quick update."
/>
)
}
| Name | Type | Details |
|---|---|---|
copy OptionalQuizStart2 |
Partial<QuizStart2Copy> |
|
sceneImage OptionalQuizStart2 |
string |
|
sceneAlt OptionalQuizStart2 |
string |
Default ""
|
sceneFocus OptionalQuizStart2 |
string |
Default "center 35%"
|
headline OptionalQuizStart2 |
string |
Default "Find your best next step in 60 seconds"
|
highlight OptionalQuizStart2 |
string |
Default "in 60 seconds"
|
subheadline OptionalQuizStart2 |
string |
Default "Answer a few quick questions and get a simple plan matched to where you are right now."
|
durationValue OptionalQuizStart2 |
string |
Default "60"
|
durationUnit OptionalQuizStart2 |
string |
Default "seconds"
|
questionCount OptionalQuizStart2 |
number |
Default 5
|
findOutTitle OptionalQuizStart2 |
string |
Default "When you finish, you’ll know:"
|
findOut OptionalQuizStart2 |
ReactNode[] |
Default DEFAULT_FIND_OUT
|
question OptionalQuizStart2 |
string |
Default "Which one sounds like you?"
|
nudge OptionalQuizStart2 |
string |
Default "Tap the one that sounds most like you right now."
|
choices OptionalQuizStart2 |
QuizStart2Choice[] |
Default DEFAULT_CHOICES
|
ctaLabel OptionalQuizStart2 |
string |
Default "Send Me My Plan"
|
loadingLabel OptionalQuizStart2 |
string |
Default "Opening your quiz…"
|
hintText OptionalQuizStart2 |
string |
Default "Pick the one that sounds like you to start."
|
reassurance OptionalQuizStart2 |
string |
|
errorText OptionalQuizStart2 |
string |
Default "Pick the one that sounds most like you first."
|
disabled OptionalQuizStart2 |
boolean |
Default false
|
disabledText OptionalQuizStart2 |
string |
Default "This quiz isn’t open right now."
|
state OptionalQuizStart2 |
QuizStart2State |
Default "default"
|
onSelect OptionalQuizStart2 |
(answer: string) => void |
|
onSubmit OptionalQuizStart2 |
(answer: string) => void | Promise<void> |
|
onAction OptionalQuizStart2 |
(answer: string) => void |
|
className OptionalQuizStart2 |
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- 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.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
item-*- One image per offer item (item-1, item-2…), shown in stacks and lists.
scene- A wide atmosphere photo behind or beside the copy.
-
04820d7fbf07272e.webp
image/webp · 69.4 KB
-
ce1784c79086ef25.webp
image/webp · 161 KB