Giveaway Entry 3
Giveaway entry block that sells a fair draw: the prize lit centre stage over a themed backdrop, a one-email entry, and a three-stop path that says exactly when entries close, how the winner is picked and how they are told.
Use it in a prompt
Use forms/giveaway-entry-3 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/giveaway-entry-3.tsx. - Import it and pass your copy and images (Props tab):
import { GiveawayEntry3 } from "@/components/funneldna/forms/giveaway-entry-3"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/giveaway-entry-3/component.tsx 501 lines
// layout: product-stage
// Giveaway entry block that sells a fair draw: the prize lit centre stage over a themed backdrop, a one-email entry, and a three-stop path that says exactly when entries close, how the winner is picked and how they are told.
import React, { useEffect, useId, useRef, useState } from 'react';
import { AlertCircle, Check, ChevronDown, Loader2, Lock, Mail } from 'lucide-react';
import { Backdrop, FX_HOST, Spot } from '../fx/fx';
import studio from '../fx/backdrops/studio';
import calendar from '../fx/spots/calendar';
import star from '../fx/spots/star';
import phone from '../fx/spots/phone';
/** What the form passes to onSubmit once the email is valid. */
export type GiveawayEntry3Values = { email: string };
/** One thing the winner gets, set beside the prize image. */
export type GiveawayPrizeNote = { title: string; text?: string };
/** One stop on the how-the-draw-works path. Supplied facts only: no invented odds, counts or dates. */
export type GiveawayDrawStep = {
title: string;
text?: string;
/** fx Spot illustration asset, imported from ../fx/spots/<name>. */
spot?: string;
};
export type GiveawayEntry3Copy = {
/** The question the button answers. */
question: string;
emailLabel: string;
emailPlaceholder: string;
emailEmptyError: string;
emailError: string;
/** The answer to the question, one line. */
buttonLabel: string;
pendingLabel: string;
submitError: string;
/** One line under the button; empty hides it. */
reassurance: string;
eligibilityLabel: string;
/** Line under the eligibility list; empty hides it. */
eligibilityNote: string;
rulesLabel: string;
pathHeading: string;
/** Accessible name for the prize notes. */
notesLabel: string;
};
export type GiveawayEntry3Props = {
headline?: React.ReactNode;
/** A phrase inside a string headline that gets the marker stroke. */
highlight?: string;
lead?: React.ReactNode;
/** Slot product: the prize or course materials on a transparent background. Empty hides it. */
prizeImage?: string;
prizeImageAlt?: string;
/** What the winner gets, split either side of the prize image. */
prizeNotes?: GiveawayPrizeNote[];
/** When it closes, how the winner is picked, how they are told. */
drawSteps?: GiveawayDrawStep[];
/** Who can enter, from the official rules. Empty hides the expander. */
eligibility?: string[];
/** Official rules page; empty hides the link. */
rulesHref?: string;
/** fx backdrop asset behind the band (imported from ../fx/backdrops/<name>); a page scene image replaces it. */
backdrop?: string;
headingLevel?: 'h1' | 'h2';
initialEmail?: string;
copy?: Partial<GiveawayEntry3Copy>;
/** Validated email. Return false or throw to show the retry message. */
onSubmit?: (values: GiveawayEntry3Values) => void | boolean | Promise<void | boolean>;
state?: 'default' | 'hover' | 'active' | 'disabled' | 'error';
className?: string;
};
export function GiveawayEntry3(props: GiveawayEntry3Props) {
const {
headline = 'Win a free seat in our next cohort',
highlight = 'a free seat',
lead = 'Enter with one email. Every step of the draw is spelled out below, so you know exactly what happens next.',
prizeImage = '',
prizeImageAlt = '',
prizeNotes = [],
drawSteps = DEFAULT_STEPS,
eligibility = [],
rulesHref = '#official-rules',
backdrop = studio,
headingLevel = 'h2',
initialEmail = '',
onSubmit,
state = 'default',
className = '',
} = props;
const copy: GiveawayEntry3Copy = { ...DEFAULT_COPY, ...props.copy };
const uid = useId().replace(/[^a-zA-Z0-9_-]/g, '');
const id = (key: string) => `gwe3-${key}-${uid}`;
const [email, setEmail] = useState(() => startEmail(state, initialEmail));
const [touched, setTouched] = useState(state === 'error');
const [pending, setPending] = useState(state === 'disabled');
const [failed, setFailed] = useState(false);
const [open, setOpen] = useState(false);
const mounted = useRef(true);
const inputRef = useRef<HTMLInputElement>(null);
useEffect(() => {
mounted.current = true;
return () => {
mounted.current = false;
};
}, []);
useEffect(() => {
setEmail(startEmail(state, initialEmail));
setTouched(state === 'error');
setPending(state === 'disabled');
setFailed(false);
}, [state, initialEmail]);
const problem = emailProblem(email);
const errorText = touched && problem ? (problem === 'empty' ? copy.emailEmptyError : copy.emailError) : '';
const handleSubmit = async (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
if (pending) return;
setTouched(true);
setFailed(false);
if (emailProblem(email)) {
inputRef.current?.focus();
return;
}
setPending(true);
try {
const result = await onSubmit?.({ email: email.trim() });
if (result === false && mounted.current) setFailed(true);
} catch {
if (mounted.current) setFailed(true);
} finally {
if (mounted.current) setPending(false);
}
};
const Title = headingLevel;
const Sub: 'h2' | 'h3' = headingLevel === 'h1' ? 'h2' : 'h3';
const Leaf: 'h3' | 'h4' = headingLevel === 'h1' ? 'h3' : 'h4';
const half = Math.ceil(prizeNotes.length / 2);
const leftNotes = prizeNotes.slice(0, half);
const rightNotes = prizeNotes.slice(half);
const showStage = Boolean(prizeImage) || prizeNotes.length > 0;
const buttonClass = `gwe3-btn${state === 'hover' ? ' is-hover' : ''}${state === 'active' ? ' is-active' : ''}`;
const renderNotes = (list: GiveawayPrizeNote[], side: 'left' | 'right') =>
list.length ? (
<ul className={`gwe3-notes gwe3-notes-${side}`}>
{list.map((note, i) => (
<li key={`${side}-${i}`} className="gwe3-note">
<strong className="gwe3-note-title">{note.title}</strong>
{note.text ? <span className="gwe3-note-text">{note.text}</span> : null}
</li>
))}
</ul>
) : null;
return (
<section className={`cf-gwe3 ${className}`.trim()} style={FX_HOST} aria-labelledby={id('title')}>
<style>{CSS}</style>
<Backdrop src={backdrop} treatment="scrim-dark" />
<div className="gwe3-inner">
<header className="gwe3-head">
<Title id={id('title')} className="gwe3-title gwe3-rise" style={rise(0)}>
{withMarker(headline, highlight)}
</Title>
{lead ? (
<p className="gwe3-lead gwe3-rise" style={rise(1)}>
{lead}
</p>
) : null}
</header>
{showStage ? (
<div
className={`gwe3-stage gwe3-rise${prizeImage ? '' : ' is-bare'}`}
style={rise(2)}
role="group"
aria-label={copy.notesLabel}
>
{renderNotes(leftNotes, 'left')}
{prizeImage ? (
<img
className="gwe3-prize"
src={prizeImage}
alt={prizeImageAlt}
width={760}
height={760}
decoding="async"
/>
) : null}
{renderNotes(rightNotes, 'right')}
</div>
) : null}
<form
className="gwe3-card gwe3-rise"
style={rise(3)}
noValidate
onSubmit={handleSubmit}
aria-labelledby={id('ask')}
aria-busy={pending || undefined}
>
<Sub id={id('ask')} className="gwe3-ask">
{copy.question}
</Sub>
<label className="gwe3-label" htmlFor={id('email')}>
{copy.emailLabel}
</label>
<div className={`gwe3-field${errorText ? ' is-invalid' : ''}`}>
<Mail className="gwe3-field-icon" size={20} strokeWidth={2.5} aria-hidden="true" />
<input
ref={inputRef}
id={id('email')}
className="gwe3-input"
type="email"
name="email"
inputMode="email"
autoComplete="email"
placeholder={copy.emailPlaceholder}
required
aria-required="true"
aria-invalid={errorText ? true : undefined}
aria-describedby={errorText ? id('err') : undefined}
value={email}
disabled={pending}
onChange={(event) => {
setEmail(event.target.value);
if (failed) setFailed(false);
}}
onBlur={() => {
if (email.trim()) setTouched(true);
}}
/>
</div>
{errorText ? (
<p id={id('err')} className="gwe3-error" role="alert">
<AlertCircle className="gwe3-inline" size={16} strokeWidth={2.5} aria-hidden="true" />
{errorText}
</p>
) : null}
<button type="submit" className={buttonClass} disabled={pending}>
{pending ? <Loader2 className="gwe3-spin" size={20} strokeWidth={2.5} aria-hidden="true" /> : null}
<span>{pending ? copy.pendingLabel : copy.buttonLabel}</span>
</button>
{failed ? (
<p className="gwe3-error gwe3-error-submit" role="alert">
<AlertCircle className="gwe3-inline" size={16} strokeWidth={2.5} aria-hidden="true" />
{copy.submitError}
</p>
) : null}
{copy.reassurance ? (
<p className="gwe3-assure">
<Lock className="gwe3-inline" size={16} strokeWidth={2.5} aria-hidden="true" />
{copy.reassurance}
</p>
) : null}
{eligibility.length || rulesHref ? (
<div className="gwe3-foot-row">
{eligibility.length ? (
<button
type="button"
className="gwe3-toggle"
aria-expanded={open}
aria-controls={id('who')}
onClick={() => setOpen((value) => !value)}
>
<span>{copy.eligibilityLabel}</span>
<ChevronDown className="gwe3-chev" size={18} strokeWidth={2.5} aria-hidden="true" />
</button>
) : null}
{rulesHref ? (
<a className="gwe3-link" href={rulesHref}>
{copy.rulesLabel}
</a>
) : null}
</div>
) : null}
{eligibility.length ? (
<div id={id('who')} className={`gwe3-who${open ? ' is-open' : ''}`}>
<div className="gwe3-who-clip">
<div className="gwe3-well">
<ul className="gwe3-who-list">
{eligibility.map((rule, i) => (
<li key={i}>
<span className="gwe3-badge" aria-hidden="true">
<Check size={16} strokeWidth={3} />
</span>
<span>{rule}</span>
</li>
))}
</ul>
{copy.eligibilityNote ? <p className="gwe3-who-note">{copy.eligibilityNote}</p> : null}
</div>
</div>
</div>
) : null}
</form>
{drawSteps.length ? (
<div className="gwe3-path">
<Sub className="gwe3-path-title gwe3-rise" style={rise(4)}>
{copy.pathHeading}
</Sub>
<ol
className="gwe3-stops"
style={{ '--gwe3-cols': Math.min(drawSteps.length, 4) } as React.CSSProperties}
>
{drawSteps.map((step, i) => (
<li key={i} className="gwe3-stop gwe3-rise" style={rise(5 + i)}>
<div className="gwe3-spot">
{step.spot ? (
<Spot src={step.spot} size={64} shade="band" light="band-ink" />
) : (
<span className="gwe3-num">{i + 1}</span>
)}
</div>
<div className="gwe3-stop-copy">
<Leaf className="gwe3-stop-title">{step.title}</Leaf>
{step.text ? <p className="gwe3-stop-text">{step.text}</p> : null}
</div>
</li>
))}
</ol>
</div>
) : null}
</div>
</section>
);
}
export default GiveawayEntry3;
const DEFAULT_COPY: GiveawayEntry3Copy = {
question: 'Ready to be in the draw?',
emailLabel: 'Your best email',
emailPlaceholder: 'you@example.com',
emailEmptyError: 'Add your email so we can tell you if you win.',
emailError: 'That email looks incomplete. Try one like you@example.com.',
buttonLabel: 'Yes, enter me in the draw',
pendingLabel: 'Entering you in the draw…',
submitError: 'We couldn’t save your entry. Please try again.',
reassurance: 'Free to enter. We respect your inbox.',
eligibilityLabel: 'Who can enter',
eligibilityNote: 'The official rules have the full terms.',
rulesLabel: 'Official rules',
pathHeading: 'Here’s exactly how the draw works',
notesLabel: 'What the winner gets',
};
const DEFAULT_STEPS: GiveawayDrawStep[] = [
{
title: 'Entries close at the time set in the official rules',
text: 'Every entry received before then goes into the draw.',
spot: calendar,
},
{
title: 'One winner is picked from every valid entry',
text: 'The official rules spell out exactly how.',
spot: star,
},
{
title: 'The winner hears from us by email',
text: 'Watch the inbox you enter with.',
spot: phone,
},
];
function startEmail(state: GiveawayEntry3Props['state'], initial: string) {
if (state === 'error') return 'maya@studio';
if (state === 'disabled') return 'maya@example.com';
return initial;
}
function emailProblem(value: string): 'empty' | 'invalid' | null {
const text = value.trim();
if (!text) return 'empty';
if (text.includes(' ')) return 'invalid';
const at = text.indexOf('@');
if (at < 1 || at !== text.lastIndexOf('@')) return 'invalid';
const domain = text.slice(at + 1);
const dot = domain.lastIndexOf('.');
if (dot < 1 || domain.length - dot - 1 < 2) return 'invalid';
return null;
}
function withMarker(text: React.ReactNode, phrase: string) {
if (typeof text !== 'string' || !phrase) return text;
const at = text.indexOf(phrase);
if (at < 0) return text;
return (
<>
{text.slice(0, at)}
<span className="gwe3-mark">{phrase}</span>
{text.slice(at + phrase.length)}
</>
);
}
function rise(index: number) {
return { '--i': index } as React.CSSProperties;
}
const CSS = `
.cf-gwe3{position:relative;isolation:isolate;overflow:hidden;background:var(--band);color:var(--band-ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px)}
.cf-gwe3 *,.cf-gwe3 *::before,.cf-gwe3 *::after{box-sizing:border-box}
.cf-gwe3 .gwe3-inner{position:relative;z-index:1;max-width:1120px;margin:0 auto;display:flex;flex-direction:column;align-items:center;text-align:center}
.cf-gwe3 .gwe3-head{width:100%;max-width:46rem}
.cf-gwe3 .gwe3-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(--band-ink)}
.cf-gwe3 h1.gwe3-title{font-size:clamp(2.5rem,5.4vw,4.875rem);line-height:1.04}
.cf-gwe3 .gwe3-mark{color:var(--marker-ink,oklch(0.21 0.034 263));background:linear-gradient(transparent 12%,oklch(from var(--marker,#fae37c) max(l,0.86) c h / 1) 12% 94%,transparent 94%);padding:0 .12em;margin:0 -.04em;border-radius:.1em .34em .14em .3em / .34em .12em .3em .16em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.cf-gwe3 .gwe3-lead{margin:16px auto 0;max-width:40rem;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;text-wrap:pretty;color:color-mix(in oklch,var(--band-ink) 90%,var(--band))}
.cf-gwe3 .gwe3-stage{width:100%;margin-top:clamp(32px,4vw,48px);display:grid;grid-template-columns:minmax(0,1fr) clamp(240px,30vw,380px) minmax(0,1fr);grid-template-areas:'left img right';align-items:center;column-gap:clamp(24px,4vw,56px)}
.cf-gwe3 .gwe3-stage.is-bare{max-width:46rem;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:'left right'}
.cf-gwe3 .gwe3-prize{grid-area:img;display:block;width:100%;height:auto;aspect-ratio:1/1;object-fit:contain;object-position:center;filter:drop-shadow(0 2px 3px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .45)) drop-shadow(0 16px 18px oklch(from var(--shadow,oklch(0.22 0.03 260)) calc(l - .08) c h / .5))}
.cf-gwe3 .gwe3-notes{list-style:none;margin:0;padding:0;display:grid;gap:24px;align-content:center}
.cf-gwe3 .gwe3-notes-left{grid-area:left;justify-items:end;text-align:right}
.cf-gwe3 .gwe3-notes-right{grid-area:right;justify-items:start;text-align:left}
.cf-gwe3 .gwe3-note{max-width:19rem;min-width:0}
.cf-gwe3 .gwe3-note-title{display:block;font-family:var(--font-display);font-weight:800;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.3;color:var(--band-ink);text-wrap:balance}
.cf-gwe3 .gwe3-note-text{display:block;margin-top:4px;font-size:.9375rem;line-height:1.4;font-weight:500;color:color-mix(in oklch,var(--band-ink) 84%,var(--band));text-wrap:pretty}
.cf-gwe3 .gwe3-card{width:100%;max-width:34rem;margin:clamp(24px,3vw,40px) auto 0;padding:clamp(20px,3vw,32px);background:var(--card);color:var(--ink);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(0.22 0.03 260 / .22),0 12px 24px -8px oklch(0.22 0.03 260 / .32)));text-align:center}
.cf-gwe3 .gwe3-ask{margin:0 0 20px;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;color:var(--ink);text-wrap:balance}
.cf-gwe3 .gwe3-label{display:block;margin:0 0 8px;text-align:left;font-size:1.0625rem;line-height:1.3;font-weight:700;color:var(--label-ink,var(--ink))}
.cf-gwe3 .gwe3-field{position:relative}
.cf-gwe3 .gwe3-field-icon{position:absolute;left:16px;top:50%;transform:translateY(-50%);color:color-mix(in oklch,var(--field-ink) 62%,var(--field));pointer-events:none}
.cf-gwe3 .gwe3-input{display:block;width:100%;height:56px;margin:0;padding:0 16px 0 48px;font-family:var(--font-body);font-size:1.0625rem;color:var(--field-ink);background:var(--field);border:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));box-shadow:inset 0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .08);outline:none;appearance:none;-webkit-appearance:none;transition:border-color .16s ease,box-shadow .16s ease}
.cf-gwe3 .gwe3-input::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
.cf-gwe3 .gwe3-input:hover:not(:disabled){border-color:color-mix(in oklch,var(--field-ink) 40%,var(--field))}
.cf-gwe3 .gwe3-input:focus{border-color:var(--field-focus,var(--accent));box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent)) l c h / .35)}
.cf-gwe3 .gwe3-field.is-invalid .gwe3-input{border-color:var(--danger)}
.cf-gwe3 .gwe3-field.is-invalid .gwe3-input:focus{box-shadow:0 0 0 3px oklch(from var(--danger) l c h / .3)}
.cf-gwe3 .gwe3-input:disabled{cursor:not-allowed;background:color-mix(in oklch,var(--field-ink) 5%,var(--field))}
.cf-gwe3 .gwe3-error{margin:8px 0 0;text-align:left;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--danger);text-wrap:pretty}
.cf-gwe3 .gwe3-error-submit{margin-top:12px;text-align:center}
.cf-gwe3 .gwe3-inline{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em}
.cf-gwe3 .gwe3-btn{--gwe3-bg:var(--button-bg,var(--cta));--gwe3-bg2:var(--button-bg-2,var(--cta-2));--gwe3-sh:var(--shadow,oklch(0.22 0.03 260));position:relative;display:inline-flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:64px;margin-top:16px;padding:0 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;color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow,none);background:linear-gradient(oklch(from var(--gwe3-bg) calc(l + .04) c h),oklch(from var(--gwe3-bg2) calc(l - .02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--gwe3-bg) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--gwe3-bg) calc(l - .16) c h),0 1px 2px oklch(from var(--gwe3-sh) l c h / .3),0 8px 16px -6px oklch(from var(--gwe3-sh) l c h / .45));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease;-webkit-tap-highlight-color:transparent}
.cf-gwe3 .gwe3-btn:hover:not(:disabled),.cf-gwe3 .gwe3-btn.is-hover{transform:translateY(-1px);background:linear-gradient(oklch(from var(--gwe3-bg) calc(l - .01) c h),oklch(from var(--gwe3-bg2) calc(l - .07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--gwe3-bg) calc(l + .1) c h / .7),inset 0 -3px 0 oklch(from var(--gwe3-bg) calc(l - .2) c h),0 1px 2px oklch(from var(--gwe3-sh) l c h / .34),0 12px 20px -8px oklch(from var(--gwe3-sh) l c h / .5))}
.cf-gwe3 .gwe3-btn:active:not(:disabled),.cf-gwe3 .gwe3-btn.is-active{transform:translateY(1px);background:linear-gradient(oklch(from var(--gwe3-bg) calc(l - .05) c h),oklch(from var(--gwe3-bg2) calc(l - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--gwe3-bg) calc(l - .22) c h / .55),inset 0 -2px 0 oklch(from var(--gwe3-bg) calc(l - .16) c h),0 1px 2px oklch(from var(--gwe3-sh) l c h / .3)}
.cf-gwe3 .gwe3-btn:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
.cf-gwe3 .gwe3-btn:disabled{cursor:progress;background:linear-gradient(oklch(from var(--gwe3-bg) calc(l - .02) calc(c * .7) h),oklch(from var(--gwe3-bg2) calc(l - .04) calc(c * .7) h));box-shadow:inset 0 -2px 0 oklch(from var(--gwe3-bg) calc(l - .16) c h),0 1px 2px oklch(from var(--gwe3-sh) l c h / .22)}
.cf-gwe3 .gwe3-spin{animation:gwe3-spin .8s linear infinite}
.cf-gwe3 .gwe3-assure{margin:12px 0 0;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-gwe3 .gwe3-foot-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px 20px;width:fit-content;max-width:100%;margin:20px auto 0}
.cf-gwe3 .gwe3-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 16px;border:0;border-radius:999px;background:color-mix(in oklch,var(--ink) 6%,var(--card));color:var(--ink);font-family:var(--font-body);font-size:.9375rem;font-weight:800;line-height:1.2;cursor:pointer;transition:background .16s ease}
.cf-gwe3 .gwe3-toggle:hover{background:color-mix(in oklch,var(--ink) 10%,var(--card))}
.cf-gwe3 .gwe3-toggle:active{background:color-mix(in oklch,var(--ink) 14%,var(--card))}
.cf-gwe3 .gwe3-toggle:focus-visible,.cf-gwe3 .gwe3-link:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:2px}
.cf-gwe3 .gwe3-chev{transition:transform .25s cubic-bezier(.2,.7,.2,1)}
.cf-gwe3 .gwe3-toggle[aria-expanded=true] .gwe3-chev{transform:rotate(180deg)}
.cf-gwe3 .gwe3-link{display:inline-flex;align-items:center;min-height:44px;border-radius:4px;font-size:.9375rem;font-weight:700;color:var(--link,var(--accent));text-decoration:underline;text-decoration-color:oklch(from var(--link,var(--accent)) l c h / .45);text-decoration-thickness:1.5px;text-underline-offset:.18em}
.cf-gwe3 .gwe3-link:hover{color:oklch(from var(--link,var(--accent)) calc(l - .08) c h);text-decoration-color:currentColor}
.cf-gwe3 .gwe3-who{display:grid;grid-template-rows:0fr;visibility:hidden;transition:grid-template-rows .32s cubic-bezier(.2,.7,.2,1),visibility 0s linear .32s}
.cf-gwe3 .gwe3-who.is-open{grid-template-rows:1fr;visibility:visible;transition:grid-template-rows .32s cubic-bezier(.2,.7,.2,1),visibility 0s linear 0s}
.cf-gwe3 .gwe3-who-clip{min-height:0;overflow:hidden}
.cf-gwe3 .gwe3-well{margin-top:12px;padding:16px 20px;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card));text-align:left}
.cf-gwe3 .gwe3-who-list{list-style:none;margin:0;padding:0;display:grid;gap:12px}
.cf-gwe3 .gwe3-who-list li{display:grid;grid-template-columns:24px minmax(0,1fr);gap:12px;align-items:start;font-size:1rem;line-height:1.45;color:var(--ink)}
.cf-gwe3 .gwe3-badge{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:var(--success);color:var(--success-ink,#fff)}
.cf-gwe3 .gwe3-who-note{margin:12px 0 0;font-size:.9375rem;line-height:1.4;color:var(--muted)}
.cf-gwe3 .gwe3-path{width:100%;margin-top:clamp(48px,6vw,80px)}
.cf-gwe3 .gwe3-path-title{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;color:var(--band-ink);text-wrap:balance}
.cf-gwe3 .gwe3-stops{list-style:none;margin:clamp(24px,3vw,32px) auto 0;padding:0;max-width:60rem;display:grid;grid-template-columns:repeat(var(--gwe3-cols,3),minmax(0,1fr));gap:24px}
.cf-gwe3 .gwe3-stop{position:relative;display:flex;flex-direction:column;align-items:center;text-align:center;min-width:0}
.cf-gwe3 .gwe3-spot{display:grid;place-items:center;width:64px;height:64px;flex:none}
.cf-gwe3 .gwe3-num{font-family:var(--font-display);font-weight:800;font-size:2.5rem;line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--band-ink)}
.cf-gwe3 .gwe3-stop-copy{margin-top:16px;min-width:0}
.cf-gwe3 .gwe3-stop-title{margin:0;font-family:var(--font-display);font-weight:800;font-size:1.125rem;line-height:1.3;color:var(--band-ink);text-wrap:balance}
.cf-gwe3 .gwe3-stop-text{margin:8px 0 0;font-size:1rem;line-height:1.5;color:color-mix(in oklch,var(--band-ink) 84%,var(--band));text-wrap:pretty}
.cf-gwe3 .gwe3-stop:not(:last-child)::after{content:'';position:absolute;top:31px;left:calc(50% + 44px);width:calc(100% - 64px);height:2px;border-radius:2px;background:oklch(from var(--band-ink) l c h / .4);transform-origin:left center;animation:gwe3-draw-x .6s cubic-bezier(.2,.7,.2,1) .35s both}
.cf-gwe3 .gwe3-rise{animation:gwe3-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:min(calc(var(--i,0) * 70ms),280ms)}
@media (max-width:760px){
.cf-gwe3 .gwe3-stage{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:'img img' 'left right';column-gap:16px;row-gap:24px;align-items:start}
.cf-gwe3 .gwe3-stage.is-bare{grid-template-areas:'left right'}
.cf-gwe3 .gwe3-prize{width:min(300px,80%);justify-self:center}
.cf-gwe3 .gwe3-notes-left,.cf-gwe3 .gwe3-notes-right{justify-items:center;text-align:center;gap:16px;align-content:start}
}
@media (max-width:480px){
.cf-gwe3 .gwe3-btn{padding:12px 16px;text-wrap:balance}
}
@media (max-width:640px){
.cf-gwe3 .gwe3-stops{grid-template-columns:minmax(0,1fr);max-width:26rem}
.cf-gwe3 .gwe3-stop{flex-direction:row;align-items:flex-start;text-align:left;gap:16px}
.cf-gwe3 .gwe3-stop-copy{margin-top:0;padding-top:8px}
.cf-gwe3 .gwe3-stop:not(:last-child)::after{top:72px;bottom:-16px;left:31px;width:2px;height:auto;transform-origin:center top;animation-name:gwe3-draw-y}
}
@media (prefers-reduced-motion:reduce){
.cf-gwe3 .gwe3-rise,.cf-gwe3 .gwe3-stop:not(:last-child)::after,.cf-gwe3 .gwe3-spin{animation:none}
.cf-gwe3 .gwe3-who,.cf-gwe3 .gwe3-who.is-open,.cf-gwe3 .gwe3-chev,.cf-gwe3 .gwe3-btn,.cf-gwe3 .gwe3-input,.cf-gwe3 .gwe3-toggle{transition:none}
.cf-gwe3 .gwe3-btn:hover:not(:disabled),.cf-gwe3 .gwe3-btn.is-hover{transform:none}
}
@keyframes gwe3-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes gwe3-draw-x{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes gwe3-draw-y{from{transform:scaleY(0)}to{transform:scaleY(1)}}
@keyframes gwe3-spin{to{transform:rotate(360deg)}}
`;
pieces/forms/giveaway-entry-3/specimen.tsx 63 lines
import __studioImage6a9e445e from "../assets/2db6f2a1670f4495.webp";
import React from 'react';
import { GiveawayEntry3 } from '../giveaway-entry-3';
import type { GiveawayEntry3Props } from '../giveaway-entry-3';
import defaults from '../../studio-defaults.json';
import { slot } from '../../slots';
import calendar from '../../fx/spots/calendar';
import star from '../../fx/spots/star';
import phone from '../../fx/spots/phone';
export const states = ['default', 'hover', 'active', 'disabled', 'error'];
export default function GiveawayEntry3Specimen({ state = 'default' }: { state?: GiveawayEntry3Props['state'] }) {
return (
<GiveawayEntry3
state={state}
headline="Win a free seat in the Studio Draw spring cohort"
highlight="a free seat"
lead="One winner joins the 8-week spring cohort free, starter materials kit included. Enter with your email, then see exactly how we pick them."
prizeImage={slot(
'product',
__studioImage6a9e445e
)}
prizeImageAlt="Studio Draw starter kit: sketchbooks, graphite pencils, charcoal and erasers"
prizeNotes={[
{ title: 'A full seat in the 8-week cohort', text: 'Every live class, start to finish.' },
{ title: 'Weekly feedback on your drawings', text: 'Clear notes from your instructor.' },
{ title: 'The starter materials kit', text: 'Shipped to your door before week one.' },
{ title: 'Replays of every session', text: 'Catch up whenever you miss one.' },
]}
drawSteps={[
{
title: 'Entries close Sunday, March 1 at 11:59 pm ET',
text: 'Every entry in by then is in the draw. No late adds, no second rounds.',
spot: calendar,
},
{
title: 'One winner, drawn at random on March 3',
text: 'Every valid entry gets one equal chance, and we keep a record of the draw.',
spot: star,
},
{
title: 'The winner gets an email the same day',
text: 'Reply within 7 days to claim the seat, or we draw again.',
spot: phone,
},
]}
eligibility={[
'You’re 18 or older',
'You live in the US or Canada',
'One entry per email address',
'No purchase needed to enter or win',
]}
rulesHref="#official-rules"
copy={{
question: 'Ready to draw with us this spring?',
buttonLabel: 'Yes, enter me in the draw',
reassurance: `Free to enter. ${defaults.sample.registration.privacy}`,
}}
onSubmit={() => undefined}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalGiveawayEntry3 |
React.ReactNode |
|
highlight OptionalGiveawayEntry3 |
string |
|
lead OptionalGiveawayEntry3 |
React.ReactNode |
|
prizeImage OptionalGiveawayEntry3 |
string |
|
prizeImageAlt OptionalGiveawayEntry3 |
string |
|
prizeNotes OptionalGiveawayEntry3 |
GiveawayPrizeNote[] |
|
drawSteps OptionalGiveawayEntry3 |
GiveawayDrawStep[] |
|
eligibility OptionalGiveawayEntry3 |
string[] |
|
rulesHref OptionalGiveawayEntry3 |
string |
|
backdrop OptionalGiveawayEntry3 |
string |
|
headingLevel OptionalGiveawayEntry3 |
'h1' | 'h2' |
|
initialEmail OptionalGiveawayEntry3 |
string |
|
copy OptionalGiveawayEntry3 |
Partial<GiveawayEntry3Copy> |
|
onSubmit OptionalGiveawayEntry3 |
(values: GiveawayEntry3Values) => void | boolean | Promise<void | boolean> |
|
state OptionalGiveawayEntry3 |
'default' | 'hover' | 'active' | 'disabled' | 'error' |
|
className OptionalGiveawayEntry3 |
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.
--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-border--field-focus--field-ink--field-radius- 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).
-
09bc3d4486616844.webp
image/webp · 23.2 KB
-
2db6f2a1670f4495.webp
image/webp · 96.9 KB
-
321240b3188e2da4.webp
image/webp · 18.7 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
c18141ad9dda999d.webp
image/webp · 14.4 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB
-
f6a8de367400456e.webp
image/webp · 14.6 KB