Prize Showcase 1
Prize showcase: one photographed flat-lay of every prize beside a matching item stack that builds the prize row by row, ending on the total value, a rules commitment and the enter action.
Use it in a prompt
Use content/prize-showcase from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/content/prize-showcase.tsx. - Import it and pass your copy and images (Props tab):
import { PrizeShowcase } from "@/components/funneldna/content/prize-showcase"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/prize-showcase/component.tsx 979 lines
// layout: unboxing-flatlay
// Prize showcase: one photographed flat-lay of every prize beside a matching item stack that builds the prize row by row, ending on the total value, a rules commitment and the enter action.
import React from "react";
import { AlertCircle, CalendarClock, Check } from "lucide-react";
import { FX_HOST, Texture } from "../fx/fx";
import topo from "../fx/textures/topo";
export type PrizeShowcaseItem = {
name: string;
/** What it is, in one short line. */
detail?: string;
/** Retail value, shown only when supplied. */
value?: string;
/** The item's own thumbnail (item-n slot). Without it the thumbnail is a crop of the flat-lay. */
image?: string;
/** Centre of this item inside the flat-lay, 0 to 1 on each axis. Defaults to a two-row grid. */
crop?: { x: number; y: number };
};
export type PrizeShowcaseState = "default" | "hover" | "active" | "disabled" | "error";
export type PrizeShowcaseProps = {
headline?: string;
/** The phrase inside the headline that gets the marker stroke. */
highlight?: string;
/** One-sentence lines; a final one-word line is set large for emphasis. */
punch?: string[];
/** Top-down flat-lay of every prize (product slot). */
flatLayImage?: string;
flatLayAlt?: string;
/** Width / height of the designed flat-lay, used for the thumbnail crops. */
flatLayAspect?: number;
/** How many thumbnail widths the flat-lay spans in a crop. Defaults from the grid. */
cropZoom?: number;
imageCaption?: string;
/** Heading over the stack. {count} is replaced by the number of items. */
listHeading?: string;
listLabel?: string;
items?: PrizeShowcaseItem[];
/** Total prize value, shown only when supplied. */
totalValue?: string;
totalLabel?: string;
entryPrice?: string;
entryLabel?: string;
vsLabel?: string;
/** Shown in place of the total when no total is supplied. */
countCaption?: string;
/** {count} is replaced by the number of items. */
countLabel?: string;
/** End date and time, already written in the giveaway's own time zone. Shown only when supplied. */
closes?: string;
commitLabel?: string;
commitError?: string;
label?: string;
/** One short reassurance line under the button. */
note?: string;
closed?: boolean;
closedLabel?: string;
rulesHref?: string;
rulesLabel?: string;
/** Short eligibility line after the rules link. */
legal?: string;
href?: string;
onAction?: () => void;
state?: PrizeShowcaseState;
className?: string;
};
const DEFAULT_PUNCH = [
"Pitch camp Friday night.",
"Cook breakfast at sunrise.",
"Hike out Sunday with nothing missing.",
"Packed.",
];
const DEFAULT_ITEMS: PrizeShowcaseItem[] = [
{ name: "Two-Person Backpacking Tent", detail: "Pitches in minutes and sleeps two with room for packs." },
{ name: "20° Down Sleeping Bag", detail: "Warm on cold nights, packs down to the size of a loaf." },
{ name: "Camp Stove & Cook Set", detail: "Stove, fuel and pot for coffee before the sun clears the ridge." },
{ name: "45L Hiking Backpack", detail: "Carries the whole kit on a frame that fits your back." },
{ name: "Lantern & Headlamp Pair", detail: "Rechargeable light for camp and the trail after dark." },
{ name: "Filter Bottle & Steel Mug", detail: "Clean water from any stream, hot coffee all morning." },
];
export function PrizeShowcase(props: PrizeShowcaseProps) {
const {
headline = "Win the whole weekend, packed and ready to go",
highlight = "the whole weekend",
punch = DEFAULT_PUNCH,
flatLayImage,
flatLayAlt = "Every prize in the kit laid out from above",
flatLayAspect = 1.5,
cropZoom,
imageCaption,
listHeading = "{count} pieces. One complete weekend.",
listLabel = "Prizes in the kit",
items = DEFAULT_ITEMS,
totalValue,
totalLabel = "Total value if you bought it all",
entryPrice = "Free",
entryLabel = "Your cost to enter today",
vsLabel = "vs.",
countCaption = "Everything in the kit",
countLabel = "{count} items",
closes,
commitLabel = "I’ve read the official rules and I’m eligible to enter.",
commitError = "Tick the box to confirm you’ve read the official rules.",
label = "Enter Me to Win the Kit",
note,
closed = false,
closedLabel = "Entries are closed",
rulesHref = "#official-rules",
rulesLabel = "Read the official rules",
legal,
href,
onAction,
state = "default",
className,
} = props;
const uid = React.useId();
const titleId = `${uid}-title`;
const listId = `${uid}-list`;
const checkId = `${uid}-commit`;
const errorId = `${uid}-error`;
const count = items.length;
const reduce = useReducedMotion();
const [pinned, setPinned] = React.useState(0);
const [hovered, setHovered] = React.useState<number | null>(state === "hover" ? Math.min(1, Math.max(0, count - 1)) : null);
const [agreed, setAgreed] = React.useState(false);
const [error, setError] = React.useState(state === "error");
React.useEffect(() => {
setError(state === "error");
if (state === "error") setAgreed(false);
setHovered(state === "hover" ? Math.min(1, Math.max(0, count - 1)) : null);
}, [state, count]);
const stripRef = React.useRef<HTMLDivElement | null>(null);
const thumbRefs = React.useRef<(HTMLDivElement | null)[]>([]);
const rowRefs = React.useRef<(HTMLButtonElement | null)[]>([]);
const checkRef = React.useRef<HTMLInputElement | null>(null);
const isClosed = closed || state === "disabled";
const active = hovered ?? pinned;
const hasImage = Boolean(flatLayImage);
const showValues = items.some((item) => Boolean(item.value));
const cols = Math.max(1, Math.ceil(count / 2));
const rows = count > 1 ? 2 : 1;
const zoom = Math.max(cropZoom ?? cols * 0.9, flatLayAspect * 1.05, 1.05);
const revealThumb = (i: number) => {
const strip = stripRef.current;
const el = thumbRefs.current[i];
if (!strip || !el || strip.scrollWidth <= strip.clientWidth + 1) return;
strip.scrollTo({ left: el.offsetLeft - (strip.clientWidth - el.offsetWidth) / 2, behavior: reduce ? "auto" : "smooth" });
};
const select = (i: number) => {
setPinned(i);
setHovered(null);
revealThumb(i);
};
const onRowKey = (event: React.KeyboardEvent<HTMLButtonElement>, i: number) => {
let next = -1;
if (event.key === "ArrowDown" || event.key === "ArrowRight") next = (i + 1) % count;
else if (event.key === "ArrowUp" || event.key === "ArrowLeft") next = (i - 1 + count) % count;
else if (event.key === "Home") next = 0;
else if (event.key === "End") next = count - 1;
if (next < 0) return;
event.preventDefault();
select(next);
rowRefs.current[next]?.focus();
};
const onEnter = (event: React.MouseEvent<HTMLElement>) => {
if (isClosed) {
event.preventDefault();
return;
}
if (!agreed) {
event.preventDefault();
setError(true);
checkRef.current?.focus();
return;
}
onAction?.();
};
const ctaClass = [
"cf-prize-showcase__cta",
state === "hover" ? "is-hover" : "",
state === "active" ? "is-active" : "",
].filter(Boolean).join(" ");
const ctaLabel = isClosed ? closedLabel : label;
const lastLine = punch.length - 1;
const aspectStyle = { ["--ps-aspect" as string]: String(flatLayAspect) } as React.CSSProperties;
return (
<section
className={["cf-prize-showcase", className].filter(Boolean).join(" ")}
style={FX_HOST}
aria-labelledby={titleId}
>
<style>{CSS}</style>
<Texture src={topo} tone="ink" />
<div className="cf-prize-showcase__inner">
<header className="cf-prize-showcase__head">
<h2 id={titleId} className="cf-prize-showcase__title">
{renderHeadline(headline, highlight)}
</h2>
{punch.length > 0 && (
<div className="cf-prize-showcase__punch">
{punch.map((line, i) => (
<p
key={`${i}-${line}`}
className={i === lastLine && isOneWord(line) ? "cf-prize-showcase__word" : undefined}
>
{line}
</p>
))}
</div>
)}
</header>
<div className={`cf-prize-showcase__grid${hasImage ? "" : " is-solo"}`}>
{hasImage && (
<div className="cf-prize-showcase__media">
<figure className="cf-prize-showcase__figure">
<div className="cf-prize-showcase__stage" style={aspectStyle}>
<img
src={flatLayImage}
alt={flatLayAlt}
width={1536}
height={Math.round(1536 / flatLayAspect)}
decoding="async"
/>
</div>
<div className="cf-prize-showcase__thumbs" ref={stripRef} aria-hidden="true">
{items.map((item, i) => {
const crop = item.crop ?? { x: ((i % cols) + 0.5) / cols, y: (Math.floor(i / cols) + 0.5) / rows };
return (
<div
key={`${i}-${item.name}`}
ref={(el) => {
thumbRefs.current[i] = el;
}}
className={`cf-prize-showcase__thumb${i === active ? " is-on" : ""}`}
onMouseEnter={() => setHovered(i)}
onMouseLeave={() => setHovered(null)}
onClick={() => select(i)}
>
<span className="cf-prize-showcase__frame">
{item.image ? (
<img className="cf-prize-showcase__own" src={item.image} alt="" loading="lazy" decoding="async" />
) : (
<CropImage src={flatLayImage as string} crop={crop} zoom={zoom} aspect={flatLayAspect} />
)}
</span>
<span className="cf-prize-showcase__num">{pad(i + 1)}</span>
</div>
);
})}
</div>
{imageCaption && <figcaption className="cf-prize-showcase__caption">{imageCaption}</figcaption>}
</figure>
</div>
)}
<div className="cf-prize-showcase__card">
<h3 id={listId} className="cf-prize-showcase__listhead">
{fill(listHeading, count)}
</h3>
<ol className="cf-prize-showcase__list" aria-label={listLabel} onMouseLeave={() => setHovered(null)}>
{items.map((item, i) => (
<li key={`${i}-${item.name}`}>
<button
type="button"
ref={(el) => {
rowRefs.current[i] = el;
}}
className={`cf-prize-showcase__row${i === active ? " is-on" : ""}${showValues ? "" : " is-plain"}`}
style={{ animationDelay: `${Math.min(i * 0.07, 0.28)}s` }}
tabIndex={i === pinned ? 0 : -1}
aria-current={i === active ? "true" : undefined}
onMouseEnter={() => setHovered(i)}
onFocus={() => select(i)}
onClick={() => select(i)}
onKeyDown={(event) => onRowKey(event, i)}
>
<span className="cf-prize-showcase__idx">{pad(i + 1)}</span>
<span className="cf-prize-showcase__body">
<span className="cf-prize-showcase__name">{item.name}</span>
{item.detail && <span className="cf-prize-showcase__detail">{item.detail}</span>}
</span>
{showValues && <span className="cf-prize-showcase__value">{item.value ?? ""}</span>}
</button>
</li>
))}
</ol>
<div className="cf-prize-showcase__offer">
{totalValue ? (
<div className="cf-prize-showcase__cell">
<span className="cf-prize-showcase__cell-label">{totalLabel}</span>
<span className="cf-prize-showcase__cell-value">{totalValue}</span>
</div>
) : (
<div className="cf-prize-showcase__cell">
<span className="cf-prize-showcase__cell-label">{countCaption}</span>
<span className="cf-prize-showcase__cell-value">{fill(countLabel, count)}</span>
</div>
)}
<span className="cf-prize-showcase__vs" aria-hidden="true">
{vsLabel}
</span>
<div className="cf-prize-showcase__cell is-featured">
<span className="cf-prize-showcase__cell-label">{entryLabel}</span>
<span className="cf-prize-showcase__cell-value cf-prize-showcase__cell-value--entry">{entryPrice}</span>
</div>
</div>
{closes && (
<p className="cf-prize-showcase__closes">
<CalendarClock className="cf-prize-showcase__inline" size={16} strokeWidth={2.5} aria-hidden="true" />
{closes}
</p>
)}
<label
htmlFor={checkId}
className={`cf-prize-showcase__commit${error ? " is-error" : ""}${isClosed ? " is-disabled" : ""}`}
>
<span className="cf-prize-showcase__box">
<input
ref={checkRef}
id={checkId}
type="checkbox"
checked={agreed}
disabled={isClosed}
aria-invalid={error ? true : undefined}
aria-describedby={error ? errorId : undefined}
onChange={(event) => {
setAgreed(event.target.checked);
if (event.target.checked) setError(false);
}}
/>
<Check size={18} strokeWidth={3} aria-hidden="true" />
</span>
<span className="cf-prize-showcase__commit-text">{commitLabel}</span>
</label>
{error && (
<p id={errorId} role="alert" className="cf-prize-showcase__error">
<AlertCircle className="cf-prize-showcase__inline" size={16} strokeWidth={2.5} aria-hidden="true" />
{commitError}
</p>
)}
<div className="cf-prize-showcase__action">
{href && !isClosed ? (
<a className={ctaClass} href={href} onClick={onEnter}>
{ctaLabel}
</a>
) : (
<button type="button" className={ctaClass} disabled={isClosed} onClick={onEnter}>
{ctaLabel}
</button>
)}
</div>
{note && !isClosed && <p className="cf-prize-showcase__note">{note}</p>}
<p className="cf-prize-showcase__rules">
<a href={rulesHref}>{rulesLabel}</a>
{legal ? <span className="cf-prize-showcase__legal">{legal}</span> : null}
</p>
</div>
</div>
</div>
</section>
);
}
export default PrizeShowcase;
function CropImage({ src, crop, zoom, aspect }: { src: string; crop: { x: number; y: number }; zoom: number; aspect: number }) {
const w = zoom * 100;
const h = (zoom / aspect) * 100;
const left = clamp(50 - crop.x * w, 100 - w, 0);
const top = clamp(50 - crop.y * h, 100 - h, 0);
return (
<img
className="cf-prize-showcase__crop"
src={src}
alt=""
loading="lazy"
decoding="async"
style={{ width: `${w}%`, height: `${h}%`, left: `${left}%`, top: `${top}%` }}
/>
);
}
function renderHeadline(text: string, phrase?: string) {
if (!phrase) return text;
const at = text.indexOf(phrase);
if (at < 0) return text;
return (
<>
{text.slice(0, at)}
<span className="cf-prize-showcase__mark">{phrase}</span>
{text.slice(at + phrase.length)}
</>
);
}
function useReducedMotion() {
const [reduce, setReduce] = React.useState(false);
React.useEffect(() => {
if (typeof window === "undefined" || !window.matchMedia) return;
const mq = window.matchMedia("(prefers-reduced-motion: reduce)");
const update = () => setReduce(mq.matches);
update();
mq.addEventListener?.("change", update);
return () => mq.removeEventListener?.("change", update);
}, []);
return reduce;
}
function isOneWord(line: string) {
const t = line.trim();
return t.length > 0 && t.indexOf(" ") === -1;
}
function fill(template: string, count: number) {
return template.split("{count}").join(String(count));
}
function pad(n: number) {
return String(n).padStart(2, "0");
}
function clamp(v: number, min: number, max: number) {
return Math.min(max, Math.max(min, v));
}
const CSS = `
.cf-prize-showcase,
.cf-prize-showcase * { box-sizing: border-box; }
.cf-prize-showcase {
--ps-well: color-mix(in oklch, var(--ink) 5%, var(--surface));
--ps-well-card: color-mix(in oklch, var(--ink) 4%, var(--card));
--ps-pick: color-mix(in oklch, var(--accent) 10%, var(--card));
--ps-ring: var(--field-focus, var(--accent));
--ps-shadow: var(--shadow, oklch(0.22 0.03 260));
--ps-marker: var(--marker, oklch(from var(--surface) calc(0.267 + l * 0.667) 0.13 95 / 0.85));
--ps-bg: var(--button-bg, var(--cta));
--ps-bg-2: var(--button-bg-2, var(--cta-2));
position: relative;
overflow: clip;
background: var(--surface);
color: var(--ink);
font-family: var(--font-body);
padding: clamp(56px, 8vw, 112px) clamp(16px, 5vw, 48px) clamp(64px, 8.5vw, 120px);
}
.cf-prize-showcase__inner {
position: relative;
z-index: 1;
max-width: 1120px;
margin: 0 auto;
}
.cf-prize-showcase__head {
display: grid;
grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
gap: 16px clamp(32px, 5vw, 72px);
align-items: start;
margin: 0 0 clamp(32px, 4vw, 48px);
}
.cf-prize-showcase__title {
margin: 0;
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;
text-wrap: balance;
color: var(--ink);
}
.cf-prize-showcase__mark {
color: inherit;
background-image: linear-gradient(var(--ps-marker), var(--ps-marker));
background-repeat: no-repeat;
background-size: 100% 0.46em;
background-position: 0 86%;
padding: 0 0.08em;
margin: 0 -0.04em;
border-radius: 0.12em 0.2em 0.14em 0.22em;
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
}
.cf-prize-showcase__punch {
display: grid;
gap: 4px;
padding-top: 6px;
}
.cf-prize-showcase__punch p {
margin: 0;
font-size: clamp(1.125rem, 1.5vw, 1.375rem);
line-height: 1.4;
font-weight: 500;
color: var(--ink);
text-wrap: pretty;
}
.cf-prize-showcase__punch .cf-prize-showcase__word {
margin-top: 8px;
font-family: var(--font-display);
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(--accent);
}
.cf-prize-showcase__grid {
display: grid;
grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
gap: clamp(32px, 5vw, 72px);
align-items: start;
}
.cf-prize-showcase__grid.is-solo {
grid-template-columns: minmax(0, 46rem);
}
.cf-prize-showcase__media {
position: sticky;
top: 24px;
min-width: 0;
}
.cf-prize-showcase__figure { margin: 0; }
.cf-prize-showcase__stage {
position: relative;
aspect-ratio: var(--ps-aspect, 1.5);
border-radius: 12px;
overflow: hidden;
background: var(--ps-well);
}
.cf-prize-showcase__stage img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
.cf-prize-showcase__thumbs {
position: relative;
display: flex;
gap: 12px;
margin: 6px -6px 0;
padding: 10px 6px 6px;
}
.cf-prize-showcase__thumb {
flex: 1 1 0;
min-width: 0;
display: grid;
justify-items: center;
gap: 8px;
cursor: pointer;
}
.cf-prize-showcase__frame {
position: relative;
display: block;
width: 100%;
aspect-ratio: 1;
border-radius: 8px;
overflow: hidden;
background: var(--ps-well);
outline: 3px solid transparent;
outline-offset: 2px;
opacity: 0.78;
filter: saturate(0.6);
transition: transform 0.16s ease, outline-color 0.16s ease, opacity 0.16s ease, filter 0.16s ease;
}
.cf-prize-showcase__crop {
position: absolute;
display: block;
max-width: none;
object-fit: cover;
}
.cf-prize-showcase__own {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
.cf-prize-showcase__num {
font-size: 14px;
font-weight: 800;
line-height: 1.2;
font-variant-numeric: tabular-nums;
color: var(--muted);
transition: color 0.16s ease;
}
.cf-prize-showcase__thumb:hover .cf-prize-showcase__frame {
opacity: 1;
filter: none;
transform: translateY(-2px);
}
.cf-prize-showcase__thumb.is-on .cf-prize-showcase__frame {
opacity: 1;
filter: none;
outline-color: var(--accent);
transform: translateY(-3px);
}
.cf-prize-showcase__thumb.is-on .cf-prize-showcase__num { color: var(--accent); }
.cf-prize-showcase__caption {
margin: 12px 0 0;
font-size: 15px;
line-height: 1.4;
font-weight: 500;
color: var(--muted);
text-wrap: pretty;
}
.cf-prize-showcase__card {
min-width: 0;
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-md, 0 1px 2px oklch(from var(--ps-shadow) l c h / 0.22), 0 4px 10px -2px oklch(from var(--ps-shadow) l c h / 0.2)));
padding: clamp(20px, 3vw, 32px);
}
.cf-prize-showcase__listhead {
margin: 0 0 16px;
font-family: var(--font-display);
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;
text-wrap: balance;
color: var(--ink);
}
.cf-prize-showcase__list {
list-style: none;
margin: 0 -12px;
padding: 0;
display: grid;
gap: 4px;
}
.cf-prize-showcase__row {
width: 100%;
display: grid;
grid-template-columns: 2.25rem minmax(0, 1fr) auto;
column-gap: 12px;
align-items: start;
padding: 12px;
margin: 0;
border: 0;
border-radius: 10px;
background: transparent;
color: var(--ink);
font: inherit;
text-align: left;
cursor: pointer;
transition: background 0.16s ease;
animation: cf-prize-showcase-rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.cf-prize-showcase__row.is-plain { grid-template-columns: 2.25rem minmax(0, 1fr); }
.cf-prize-showcase__row.is-on { background: var(--ps-pick); }
.cf-prize-showcase__row:active { background: color-mix(in oklch, var(--accent) 16%, var(--card)); }
.cf-prize-showcase__row:focus { outline: none; }
.cf-prize-showcase__row:focus-visible {
outline: 3px solid var(--ps-ring);
outline-offset: 2px;
}
.cf-prize-showcase__idx {
font-family: var(--font-display);
font-weight: 800;
font-size: 1.3125rem;
line-height: 1.1;
font-variant-numeric: tabular-nums;
color: var(--accent);
}
.cf-prize-showcase__body { min-width: 0; }
.cf-prize-showcase__name {
display: block;
font-family: var(--font-display);
font-weight: 800;
font-size: clamp(1.0625rem, 1.25vw, 1.125rem);
line-height: 1.3;
text-wrap: pretty;
}
.cf-prize-showcase__detail {
display: block;
margin-top: 4px;
font-size: 15px;
font-weight: 500;
line-height: 1.4;
color: var(--muted);
text-wrap: pretty;
}
.cf-prize-showcase__row.is-on .cf-prize-showcase__detail { color: var(--ink); }
.cf-prize-showcase__value {
font-family: var(--font-display);
font-weight: 800;
font-size: 1.125rem;
line-height: 1.3;
font-variant-numeric: tabular-nums;
white-space: nowrap;
color: var(--ink);
}
.cf-prize-showcase__offer {
margin-top: 24px;
display: grid;
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
gap: 8px;
align-items: stretch;
}
.cf-prize-showcase__cell {
display: grid;
gap: 12px;
align-content: space-between;
min-width: 0;
padding: 14px 16px 16px;
border-radius: 10px;
background: var(--ps-well-card);
}
.cf-prize-showcase__cell.is-featured { background: var(--ps-pick); }
.cf-prize-showcase__cell-label {
font-size: 15px;
font-weight: 600;
line-height: 1.3;
color: var(--muted);
text-wrap: pretty;
}
.cf-prize-showcase__cell.is-featured .cf-prize-showcase__cell-label { color: var(--ink); }
.cf-prize-showcase__cell-value {
font-family: var(--font-display);
font-weight: 800;
font-size: clamp(1.75rem, 3vw, 2.5rem);
line-height: 1;
letter-spacing: -0.03em;
font-variant-numeric: tabular-nums;
color: var(--ink);
overflow-wrap: anywhere;
}
.cf-prize-showcase__cell-value--entry { color: var(--accent); }
.cf-prize-showcase__vs {
align-self: center;
font-size: 14px;
font-weight: 800;
line-height: 1.2;
color: var(--muted);
}
.cf-prize-showcase__inline {
display: inline-block;
vertical-align: -0.15em;
margin-inline-end: 0.4em;
}
.cf-prize-showcase__closes {
margin: 20px 0 0;
font-size: 15px;
font-weight: 600;
line-height: 1.4;
color: var(--ink);
text-wrap: pretty;
}
.cf-prize-showcase__closes .cf-prize-showcase__inline { color: var(--accent); }
.cf-prize-showcase__commit {
margin-top: 20px;
display: flex;
align-items: flex-start;
gap: 12px;
padding: 12px 14px;
border-radius: 10px;
background: var(--ps-well-card);
font-size: 1rem;
font-weight: 600;
line-height: 1.4;
color: var(--ink);
cursor: pointer;
transition: background 0.16s ease;
}
.cf-prize-showcase__commit.is-error { background: var(--danger-soft); }
.cf-prize-showcase__commit.is-disabled { cursor: not-allowed; }
.cf-prize-showcase__commit-text { text-wrap: pretty; }
.cf-prize-showcase__box {
position: relative;
flex: 0 0 24px;
width: 24px;
height: 24px;
margin-top: -1px;
}
.cf-prize-showcase__box input {
-webkit-appearance: none;
appearance: none;
display: block;
margin: 0;
width: 24px;
height: 24px;
border-radius: 6px;
border: 2px solid oklch(from var(--ink) l c h / 0.45);
background: var(--field);
cursor: pointer;
transition: background 0.16s ease, border-color 0.16s ease;
}
.cf-prize-showcase__commit:hover .cf-prize-showcase__box input:not(:disabled):not(:checked) {
border-color: oklch(from var(--ink) l c h / 0.75);
}
.cf-prize-showcase__box input:checked {
background: var(--accent-fill, var(--accent));
border-color: var(--accent-fill, var(--accent));
}
.cf-prize-showcase__box input:focus { outline: none; }
.cf-prize-showcase__box input:focus-visible {
outline: 3px solid var(--ps-ring);
outline-offset: 2px;
}
.cf-prize-showcase__box input:disabled { cursor: not-allowed; opacity: 0.55; }
.cf-prize-showcase__commit.is-error .cf-prize-showcase__box input { border-color: var(--danger); }
.cf-prize-showcase__box svg {
position: absolute;
top: 3px;
left: 3px;
color: var(--accent-fill-ink, var(--card));
opacity: 0;
transform: scale(0.9);
pointer-events: none;
transition: opacity 0.16s ease, transform 0.16s ease;
}
.cf-prize-showcase__box input:checked + svg {
opacity: 1;
transform: scale(1);
}
.cf-prize-showcase__error {
margin: 8px 0 0;
font-size: 15px;
font-weight: 600;
line-height: 1.4;
color: var(--danger);
text-wrap: pretty;
}
.cf-prize-showcase__action { margin-top: 16px; }
.cf-prize-showcase__cta {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
min-height: 64px;
padding: 0 28px;
margin: 0;
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-decoration: none;
text-wrap: balance;
color: var(--button-ink, var(--cta-ink));
text-shadow: var(--button-text-shadow, none);
background: linear-gradient(oklch(from var(--ps-bg) calc(l + 0.04) c h), oklch(from var(--ps-bg-2) calc(l - 0.02) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--ps-bg) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--ps-bg) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--ps-shadow) l c h / 0.3), 0 8px 16px -6px oklch(from var(--ps-shadow) l c h / 0.45));
cursor: pointer;
transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.cf-prize-showcase__cta:hover:not(:disabled),
.cf-prize-showcase__cta.is-hover:not(:disabled) {
background: linear-gradient(oklch(from var(--ps-bg) calc(l - 0.01) c h), oklch(from var(--ps-bg-2) calc(l - 0.07) c h));
transform: translateY(-1px);
box-shadow: inset 0 1px 0 oklch(from var(--ps-bg) calc(l + 0.12) c h / 0.7), inset 0 -3px 0 oklch(from var(--ps-bg) calc(l - 0.2) c h), 0 1px 2px oklch(from var(--ps-shadow) l c h / 0.32), 0 12px 20px -8px oklch(from var(--ps-shadow) l c h / 0.5);
}
.cf-prize-showcase__cta:active:not(:disabled),
.cf-prize-showcase__cta.is-active:not(:disabled) {
background: linear-gradient(oklch(from var(--ps-bg) calc(l - 0.04) c h), oklch(from var(--ps-bg-2) calc(l - 0.08) c h));
transform: translateY(1px);
box-shadow: inset 0 2px 4px oklch(from var(--ps-bg) calc(l - 0.22) c h / 0.55), inset 0 -2px 0 oklch(from var(--ps-bg) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--ps-shadow) l c h / 0.28);
}
.cf-prize-showcase__cta:focus { outline: none; }
.cf-prize-showcase__cta:focus-visible {
outline: 3px solid var(--ps-ring);
outline-offset: 3px;
}
.cf-prize-showcase__cta:disabled {
background: var(--button-2-bg, var(--secondary));
color: var(--button-2-ink, var(--secondary-ink));
box-shadow: var(--button-2-shadow, var(--shadow-sm));
text-shadow: none;
cursor: not-allowed;
transform: none;
}
.cf-prize-showcase__note {
margin: 12px 0 0;
text-align: center;
font-size: 15px;
font-weight: 600;
line-height: 1.4;
color: var(--muted);
text-wrap: pretty;
}
.cf-prize-showcase__rules {
margin: 16px 0 0;
text-align: center;
font-size: 15px;
font-weight: 500;
line-height: 1.4;
color: var(--muted);
text-wrap: pretty;
}
.cf-prize-showcase__rules a {
font-weight: 700;
color: var(--link, var(--accent));
text-decoration: underline;
text-decoration-color: oklch(from var(--link, var(--accent)) l c h / 0.45);
text-underline-offset: 0.18em;
border-radius: 4px;
}
.cf-prize-showcase__rules a:hover {
color: oklch(from var(--link, var(--accent)) calc(l - 0.08) c h);
text-decoration-color: currentColor;
}
.cf-prize-showcase__rules a:focus { outline: none; }
.cf-prize-showcase__rules a:focus-visible {
outline: 3px solid var(--ps-ring);
outline-offset: 2px;
}
.cf-prize-showcase__legal { display: block; margin-top: 4px; }
@keyframes cf-prize-showcase-rise {
from { opacity: 0.82; transform: translateY(8px); }
to { opacity: 1; transform: none; }
}
@media (max-width: 899px) {
.cf-prize-showcase__head,
.cf-prize-showcase__grid { grid-template-columns: minmax(0, 1fr); }
.cf-prize-showcase__grid.is-solo { grid-template-columns: minmax(0, 1fr); }
.cf-prize-showcase__media { position: static; }
.cf-prize-showcase__thumbs {
overflow-x: auto;
scroll-snap-type: x proximity;
scrollbar-width: none;
-webkit-overflow-scrolling: touch;
}
.cf-prize-showcase__thumbs::-webkit-scrollbar { display: none; }
.cf-prize-showcase__thumb {
flex: 0 0 76px;
scroll-snap-align: center;
}
}
@media (max-width: 479px) {
.cf-prize-showcase__offer { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.cf-prize-showcase__vs { display: none; }
.cf-prize-showcase__cell { padding: 12px 12px 14px; }
}
@media (prefers-reduced-motion: reduce) {
.cf-prize-showcase .cf-prize-showcase__row { animation: none; transition: none; }
.cf-prize-showcase .cf-prize-showcase__frame,
.cf-prize-showcase .cf-prize-showcase__thumb:hover .cf-prize-showcase__frame,
.cf-prize-showcase .cf-prize-showcase__thumb.is-on .cf-prize-showcase__frame { transition: none; transform: none; }
.cf-prize-showcase .cf-prize-showcase__cta,
.cf-prize-showcase .cf-prize-showcase__cta:hover:not(:disabled),
.cf-prize-showcase .cf-prize-showcase__cta.is-hover:not(:disabled),
.cf-prize-showcase .cf-prize-showcase__cta:active:not(:disabled),
.cf-prize-showcase .cf-prize-showcase__cta.is-active:not(:disabled) { transition: none; transform: none; }
.cf-prize-showcase .cf-prize-showcase__box svg,
.cf-prize-showcase .cf-prize-showcase__box input:checked + svg { transition: none; transform: none; }
}
`;
pieces/content/prize-showcase/specimen.tsx 49 lines
import __studioImage699daaf7 from "../assets/81c85e5f9781368e.webp";
import { PrizeShowcase } from "../prize-showcase";
import { slot } from "../../slots";
export const states = ["default", "hover", "active", "disabled", "error"];
const ITEMS = [
{ name: "Two-Person Backpacking Tent", detail: "Pitches in minutes and sleeps two with room for packs.", value: "$389" },
{ name: "20° Down Sleeping Bag", detail: "Warm on cold nights, packs down to the size of a loaf.", value: "$279" },
{ name: "Camp Stove & Cook Set", detail: "Stove, fuel and pot for coffee before the sun clears the ridge.", value: "$129" },
{ name: "45L Hiking Backpack", detail: "Carries the whole kit on a frame that fits your back.", value: "$219" },
{ name: "Lantern & Headlamp Pair", detail: "Rechargeable light for camp and the trail after dark.", value: "$89" },
{ name: "Filter Bottle & Steel Mug", detail: "Clean water from any stream, hot coffee all morning.", value: "$69" },
];
export default function PrizeShowcaseSpecimen({ state = "default" }: { state?: "default" | "hover" | "active" | "disabled" | "error" }) {
return (
<PrizeShowcase
state={state}
headline="Win the whole weekend, packed and ready to go"
highlight="the whole weekend"
punch={[
"Pitch camp Friday night.",
"Cook breakfast at sunrise.",
"Hike out Sunday with nothing missing.",
"Packed.",
]}
flatLayImage={slot(
"product",
__studioImage699daaf7
)}
flatLayAlt="Top-down view of the Trailhead Outfitters weekend kit: tent, sleeping bag, stove set, backpack, lantern and headlamp, filter bottle and mug"
flatLayAspect={1.5}
imageCaption="The full Trailhead Outfitters weekend kit, exactly as the winner gets it."
listHeading="{count} pieces. One complete weekend."
items={ITEMS}
totalValue="$1,174"
totalLabel="Total value if you bought it all"
entryPrice="Free"
entryLabel="Your cost to enter today"
closes="Entries close Sunday, June 13, 2027 at 11:59 PM Pacific Time"
label="Enter Me to Win the Kit"
note="One entry per person · Winner drawn at random"
rulesHref="#official-rules"
rulesLabel="Read the official rules"
legal="No purchase necessary. Open to US residents 18 and older."
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalPrizeShowcase |
string |
|
highlight OptionalPrizeShowcase |
string |
|
punch OptionalPrizeShowcase |
string[] |
|
flatLayImage OptionalPrizeShowcase |
string |
|
flatLayAlt OptionalPrizeShowcase |
string |
|
flatLayAspect OptionalPrizeShowcase |
number |
|
cropZoom OptionalPrizeShowcase |
number |
|
imageCaption OptionalPrizeShowcase |
string |
|
listHeading OptionalPrizeShowcase |
string |
|
listLabel OptionalPrizeShowcase |
string |
|
items OptionalPrizeShowcase |
PrizeShowcaseItem[] |
|
totalValue OptionalPrizeShowcase |
string |
|
totalLabel OptionalPrizeShowcase |
string |
|
entryPrice OptionalPrizeShowcase |
string |
|
entryLabel OptionalPrizeShowcase |
string |
|
vsLabel OptionalPrizeShowcase |
string |
|
countCaption OptionalPrizeShowcase |
string |
|
countLabel OptionalPrizeShowcase |
string |
|
closes OptionalPrizeShowcase |
string |
|
commitLabel OptionalPrizeShowcase |
string |
|
commitError OptionalPrizeShowcase |
string |
|
label OptionalPrizeShowcase |
string |
|
note OptionalPrizeShowcase |
string |
|
closed OptionalPrizeShowcase |
boolean |
|
closedLabel OptionalPrizeShowcase |
string |
|
rulesHref OptionalPrizeShowcase |
string |
|
rulesLabel OptionalPrizeShowcase |
string |
|
legal OptionalPrizeShowcase |
string |
|
href OptionalPrizeShowcase |
string |
|
onAction OptionalPrizeShowcase |
() => void |
|
state OptionalPrizeShowcase |
PrizeShowcaseState |
|
className OptionalPrizeShowcase |
string |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-ink--button-2-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--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.
product- The main product shot or cover (ebook, kit, bottle).
-
81c85e5f9781368e.webp
image/webp · 130 KB
-
a57ca5c86a05001f.webp
image/webp · 108 KB