Email Course Days 2
Email course lesson block: today as a huge numeral on a rail of ticked days, today's homework as a checklist that
Use it in a prompt
Use content/email-course-days-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/content/email-course-days-2.tsx. - Import it and pass your copy and images (Props tab):
import { EmailCourseDays2 } from "@/components/funneldna/content/email-course-days-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/email-course-days-2/component.tsx 541 lines
// layout: number-rail
// Email course lesson block: today as a huge numeral on a rail of ticked days, today's homework as a checklist that
// reports every tick to the host, then tomorrow's teaser (or the paid class on the final day), so each small win leads on.
import * as React from 'react'
import { Check, Mail, ShieldCheck } from 'lucide-react'
import { FX_HOST, Spot, Texture } from '../fx/fx'
import linen from '../fx/textures/linen'
import checklistSpot from '../fx/spots/checklist'
export type CourseDay = {
title: string
/** Short rail label; falls back to the title. */
short?: string
/** One-line teaser shown the day before this lesson. */
teaser?: string
}
export type HomeworkItem = {
label: string
/** Small time chip, e.g. '2 min'. */
detail?: string
}
export type CourseLesson = {
greeting?: string
paragraphs?: React.ReactNode[]
homework?: HomeworkItem[]
/** Sign-off line before the signature, e.g. 'See you tomorrow,'. */
closing?: string
signature?: string
signatureRole?: string
}
export type CourseOffer = {
headline: string
text?: React.ReactNode
regularPrice?: string
price?: string
priceNote?: string
/** Button label: a delivery verb works best ('Send me the full class'). */
label: string
reassurance?: string
href?: string
}
export type EmailCourseDays2Copy = {
day: string
today: string
railLabel: string
doneSr: string
upcomingSr: string
/** {done} and {total} are replaced with digits. */
daysDone: string
/** {done} and {total} are replaced with number words. */
count: string
/** {total} is replaced with a number word. */
allDone: string
emptyTitle: string
emptyText: string
/** {day} and {title} are replaced. */
teaserHeading: string
teaserNote: string
regularSr: string
todaySr: string
/** Words for 0, 1, 2… used by the homework count; digits beyond the list. */
numberWords: string[]
}
export type EmailCourseDays2Props = {
courseName?: string
days?: CourseDay[]
/** Today's day, 1-based. */
currentDay?: number
lesson?: CourseLesson
homeworkTitle?: string
/** Scene slot photo beside the homework (the starter jar). */
image?: string
imageAlt?: string
imageCaption?: string
/** 'auto' shows tomorrow's teaser on days 1 to n-1 and the offer on the final day. */
nextStep?: 'auto' | 'teaser' | 'offer' | 'none'
offer?: CourseOffer
/** Homework indexes ticked when the lesson opens (the host passes any saved ticks here). */
defaultDone?: number[]
/** Called with the ticked indexes after every change, so the host can save them. */
onToggle?: (done: number[]) => void
/** Called when the offer button is clicked. */
onAction?: () => void
disabled?: boolean
state?: 'default' | 'hover' | 'active' | 'disabled'
copy?: Partial<EmailCourseDays2Copy>
className?: string
}
const DEFAULT_DAYS: CourseDay[] = [
{ title: 'Wake up your starter', short: 'Wake the starter', teaser: 'Flour, water and one jar, plus the single sign your starter is alive.' },
{ title: 'Feed it on a schedule you can keep', short: 'Set the feeds', teaser: 'Pick two feeding times that fit your day, and why the same time matters.' },
{ title: 'Learn to read the bubbles', short: 'Read the bubbles', teaser: 'A rubber band tells you exactly when your starter is ready.' },
{ title: 'Mix your first dough', short: 'Mix the dough', teaser: 'Four ingredients, one bowl, and the rest that does the kneading for you.' },
{ title: 'Stretch, fold and wait', short: 'Stretch & fold', teaser: 'Four sets of folds that build the open crumb you want.' },
{ title: 'Shape a loaf that holds', short: 'Shape the loaf', teaser: 'The tension trick that keeps your loaf tall in the oven.' },
{ title: 'Bake your first real loaf', short: 'Bake the loaf', teaser: 'Lid on, lid off, and the two-hour wait before the first slice.' },
]
const DEFAULT_LESSON: CourseLesson = {
greeting: 'Hi baker,',
paragraphs: [
'Two days in and your starter is already changing. Today you learn to read it.',
'You need a jar, a rubber band and about ten minutes. Tick each win as you go.',
],
homework: [
{ label: 'Feed your starter at the same time as yesterday', detail: '2 min' },
{ label: 'Mark its level with a rubber band', detail: '1 min' },
{ label: 'Check the rise at 4 and 8 hours', detail: '2 min' },
{ label: 'Note how high it climbed', detail: '1 min' },
],
closing: 'See you tomorrow,',
signature: 'Rye & Salt',
}
const DEFAULT_OFFER: CourseOffer = {
headline: 'Bake a week of bread with us',
text: 'You showed up seven days in a row. The full Rye & Salt class turns that habit into a week of bread: rye, seeded and a weekend boule.',
label: 'Send me the full class',
}
const DEFAULT_COPY: EmailCourseDays2Copy = {
day: 'Day',
today: 'Today',
railLabel: 'Your course days',
doneSr: 'done',
upcomingSr: 'coming up',
daysDone: '{done} of {total} days done',
count: '{done} of {total} done',
allDone: 'All {total} done. That’s today’s win.',
emptyTitle: 'Rest day: let your starter do the work',
emptyText: 'No homework today. Feed it once, then watch your inbox for the next lesson.',
teaserHeading: 'Tomorrow, Day {day}: {title}',
teaserNote: 'Lands in your inbox tomorrow morning.',
regularSr: 'Regular price',
todaySr: 'Today’s price',
numberWords: ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve'],
}
export function EmailCourseDays2(props: EmailCourseDays2Props) {
const {
courseName = 'Rye & Salt Sourdough · 7 days',
days = DEFAULT_DAYS,
currentDay = 3,
lesson = DEFAULT_LESSON,
homeworkTitle = 'Your small wins for today',
image,
imageAlt = '',
imageCaption,
nextStep = 'auto',
offer = DEFAULT_OFFER,
defaultDone,
onToggle,
onAction,
disabled = false,
state = 'default',
copy: copyProp,
className,
} = props
const copy: EmailCourseDays2Copy = { ...DEFAULT_COPY, ...copyProp }
const total = days.length
const current = clamp(Math.round(currentDay), 1, Math.max(total, 1))
const homework = lesson.homework ?? []
const count = homework.length
const uid = 'ecd2' + React.useId().replace(/[^a-zA-Z0-9_-]/g, '')
const [done, setDone] = React.useState<number[]>(() => tidy(defaultDone ?? [], count))
const toggle = (i: number) => {
const next = done.includes(i) ? done.filter((n) => n !== i) : tidy([...done, i], count)
setDone(next)
onToggle?.(next)
}
const word = (n: number) => copy.numberWords[n] ?? String(n)
const allDone = count > 0 && done.length >= count
const daysDone = current - 1 + (allDone ? 1 : 0)
const countText = capitalise(
allDone
? fill(copy.allDone, { total: word(count) })
: fill(copy.count, { done: word(done.length), total: word(count) }),
)
const pct = count ? Math.round((done.length / count) * 100) : 0
const today = days[current - 1]
const tomorrow = days[current]
const isFinal = current >= total
const mode = nextStep === 'auto' ? (isFinal ? 'offer' : 'teaser') : nextStep
const isDisabled = disabled || state === 'disabled'
const forced = state === 'hover' || state === 'active' ? state : undefined
const handleAction = onAction ? () => onAction() : undefined
const button =
offer.href && !isDisabled ? (
<a className='ecd2-btn' href={offer.href} data-state={forced} onClick={handleAction}>
{offer.label}
</a>
) : (
<button type='button' className='ecd2-btn' data-state={forced} disabled={isDisabled} onClick={handleAction}>
{offer.label}
</button>
)
return (
<section className={['cf-email-course-days-2', className].filter(Boolean).join(' ')} aria-labelledby={uid + '-title'}>
<style>{CSS}</style>
<div className='ecd2-wrap'>
<div className='ecd2-railwrap'>
<div className='ecd2-rail' style={FX_HOST}>
<Texture src={linen} tone='band-ink' />
<div className='ecd2-rail-in'>
<p className='ecd2-course'>{courseName}</p>
<ol className='ecd2-days' aria-label={copy.railLabel}>
{days.map((d, i) => {
const n = i + 1
const delay = { '--d': Math.min(i * 0.07, 0.28) + 's' } as React.CSSProperties
if (n === current) {
return (
<li key={n} className='ecd2-day is-current' aria-current='step' style={delay}>
<span className='ecd2-day-word' aria-hidden='true'>
{copy.day}
</span>
<span className='ecd2-big'>
<span className='ecd2-sr'>{copy.day} </span>
{n}
</span>
<span className='ecd2-today'>
<span className='ecd2-tag'>{copy.today}</span> {d.short ?? d.title}
</span>
{allDone ? (
<span className='ecd2-badge'>
<Check size={16} strokeWidth={3} aria-hidden='true' />
<span className='ecd2-sr'>, {copy.doneSr}</span>
</span>
) : null}
</li>
)
}
const isDone = n < current
return (
<li key={n} className={'ecd2-day ' + (isDone ? 'is-done' : 'is-next')} style={delay}>
<span className='ecd2-num'>
<span className='ecd2-sr'>{copy.day} </span>
{n}
</span>
<span className='ecd2-short'>{d.short ?? d.title}</span>
<span className='ecd2-mark'>
{isDone ? (
<span className='ecd2-badge'>
<Check size={16} strokeWidth={3} aria-hidden='true' />
</span>
) : null}
<span className='ecd2-sr'>, {isDone ? copy.doneSr : copy.upcomingSr}</span>
</span>
</li>
)
})}
</ol>
{total > 0 ? (
<div className='ecd2-meter'>
<p className='ecd2-meter-label'>{fill(copy.daysDone, { done: String(daysDone), total: String(total) })}</p>
<div className='ecd2-segs' aria-hidden='true'>
{days.map((_, i) => (
<span key={i} className={'ecd2-seg' + (i < daysDone ? ' is-done' : i === current - 1 ? ' is-cur' : '')} />
))}
</div>
</div>
) : null}
</div>
</div>
</div>
<div className='ecd2-main'>
<h2 id={uid + '-title'} className='ecd2-h2 ecd2-rise'>
{today?.title}
</h2>
{lesson.greeting || lesson.paragraphs?.length ? (
<div className='ecd2-letter ecd2-rise'>
{lesson.greeting ? <p className='ecd2-greet'>{lesson.greeting}</p> : null}
{(lesson.paragraphs ?? []).map((p, i) => (
<p key={i}>{p}</p>
))}
</div>
) : null}
<div className={'ecd2-work ecd2-rise' + (image ? ' has-photo' : '')}>
<div className='ecd2-card' role='group' aria-labelledby={uid + '-hw'}>
{count ? (
<>
<h3 id={uid + '-hw'} className='ecd2-h3'>
{homeworkTitle}
</h3>
<p className={'ecd2-count' + (allDone ? ' is-all' : '')} aria-live='polite'>
{countText}
</p>
<div className='ecd2-bar' aria-hidden='true'>
<span style={{ width: pct + '%' }} />
</div>
<ul className='ecd2-list'>
{homework.map((h, i) => {
const checked = done.includes(i)
const id = uid + '-task-' + i
return (
<li key={i}>
<label htmlFor={id} className={'ecd2-row' + (checked ? ' is-done' : '')}>
<input id={id} type='checkbox' className='ecd2-input' checked={checked} onChange={() => toggle(i)} />
<span className='ecd2-tick' aria-hidden='true'>
{checked ? <Check size={18} strokeWidth={3} /> : null}
</span>
<span className='ecd2-label'>{h.label}</span>
{h.detail ? <span className='ecd2-chip'>{h.detail}</span> : null}
</label>
</li>
)
})}
</ul>
</>
) : (
<div className='ecd2-empty'>
<Spot src={checklistSpot} size={72} />
<h3 id={uid + '-hw'} className='ecd2-h3'>
{copy.emptyTitle}
</h3>
<p>{copy.emptyText}</p>
</div>
)}
</div>
{image ? (
<figure className='ecd2-photo'>
<img src={image} alt={imageAlt} width={800} height={1000} loading='lazy' decoding='async' />
{imageCaption ? <figcaption>{imageCaption}</figcaption> : null}
</figure>
) : null}
</div>
{lesson.closing || lesson.signature ? (
<div className='ecd2-sign'>
{lesson.closing ? <p className='ecd2-closing'>{lesson.closing}</p> : null}
{lesson.signature ? <p className='ecd2-signame'>{lesson.signature}</p> : null}
{lesson.signatureRole ? <p className='ecd2-role'>{lesson.signatureRole}</p> : null}
</div>
) : null}
{mode === 'teaser' && tomorrow ? (
<div className='ecd2-next ecd2-rise' role='group' aria-labelledby={uid + '-next'}>
<span className='ecd2-disc' aria-hidden='true'>
<Mail size={20} strokeWidth={2.5} />
</span>
<div>
<h3 id={uid + '-next'} className='ecd2-h3'>
{fill(copy.teaserHeading, { day: String(current + 1), title: tomorrow.title })}
</h3>
{tomorrow.teaser ? <p className='ecd2-next-p'>{tomorrow.teaser}</p> : null}
<p className='ecd2-note'>{copy.teaserNote}</p>
</div>
</div>
) : null}
{mode === 'offer' ? (
<div className='ecd2-offer ecd2-rise' role='group' aria-labelledby={uid + '-offer'}>
<h3 id={uid + '-offer'} className='ecd2-h3'>
{offer.headline}
</h3>
{offer.text ? <p className='ecd2-offer-p'>{offer.text}</p> : null}
<div className='ecd2-offer-row'>
{offer.price ? (
<div className='ecd2-price'>
<p className='ecd2-price-line'>
{offer.regularPrice ? (
<>
<span className='ecd2-sr'>{copy.regularSr} </span>
<s className='ecd2-was'>{offer.regularPrice}</s>
</>
) : null}
<span className='ecd2-sr'> {copy.todaySr} </span>
<span className='ecd2-now'>{offer.price}</span>
</p>
{offer.priceNote ? <p className='ecd2-price-note'>{offer.priceNote}</p> : null}
</div>
) : null}
<div className='ecd2-act'>
{button}
{offer.reassurance ? (
<p className='ecd2-reassure'>
<ShieldCheck size={16} strokeWidth={2.5} aria-hidden='true' />
{offer.reassurance}
</p>
) : null}
</div>
</div>
</div>
) : null}
</div>
</div>
</section>
)
}
export default EmailCourseDays2
function clamp(n: number, min: number, max: number) {
return Math.min(Math.max(n, min), max)
}
function tidy(list: unknown[], count: number): number[] {
const out: number[] = []
for (const v of list) {
if (typeof v === 'number' && Number.isInteger(v) && v >= 0 && v < count && !out.includes(v)) out.push(v)
}
return out.sort((a, b) => a - b)
}
function fill(template: string, vars: Record<string, string>) {
return template.replace(/[{]([a-zA-Z]+)[}]/g, (match: string, k: string) => (k in vars ? vars[k] : match))
}
function capitalise(text: string) {
return text.charAt(0).toUpperCase() + text.slice(1)
}
const R = '.cf-email-course-days-2'
const SHADOW_MD = '0 1px 2px oklch(from var(--ecd2-shadow) l c h / .22), 0 4px 10px -2px oklch(from var(--ecd2-shadow) l c h / .2)'
const SHADOW_LG = '0 2px 4px oklch(from var(--ecd2-shadow) l c h / .22), 0 12px 24px -8px oklch(from var(--ecd2-shadow) l c h / .32)'
// The check glyph inside solid status fills is white by contract (theme-contract: status icon badges).
const CSS = `
${R}{--ecd2-shadow:var(--shadow, oklch(0.22 0.03 260));--ecd2-glyph:var(--on-status, #ffffff);position:relative;background:var(--surface, #ffffff);color:var(--ink, #101828);font-family:var(--font-body);padding:clamp(56px, 8vw, 112px) clamp(16px, 5vw, 48px) clamp(64px, 8.5vw, 120px);overflow-x:clip}
${R} *,${R} *::before,${R} *::after{box-sizing:border-box}
${R} .ecd2-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
${R} .ecd2-wrap{max-width:1120px;margin:0 auto;display:grid;grid-template-columns:minmax(220px, 264px) minmax(0, 1fr);gap:clamp(32px, 5vw, 72px);align-items:start}
${R} .ecd2-railwrap{position:sticky;top:24px}
${R} .ecd2-rail{overflow:hidden;background:var(--band);color:var(--band-ink);border-radius:var(--card-radius, var(--radius, 14px));padding:24px 14px 20px;box-shadow:var(--shadow-md, ${SHADOW_MD})}
${R} .ecd2-rail-in{position:relative;z-index:1}
${R} .ecd2-course{margin:0 8px 16px;font-size:.9375rem;font-weight:700;line-height:1.4;text-wrap:balance}
${R} .ecd2-days{list-style:none;margin:0;padding:0;display:grid;gap:2px}
${R} .ecd2-day{display:grid;grid-template-columns:2.25rem minmax(0, 1fr) 24px;align-items:center;gap:12px;padding:9px 8px;border-radius:10px;animation:ecd2-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:var(--d, 0s)}
${R} .ecd2-num{font-family:var(--font-display);font-weight:var(--display-weight, 800);font-size:clamp(1.3125rem, 1.8vw, 1.625rem);line-height:1;text-align:center;font-variant-numeric:tabular-nums;color:color-mix(in oklch, var(--band-ink) 72%, var(--band))}
${R} .ecd2-short{font-size:.9375rem;font-weight:600;line-height:1.3;text-wrap:pretty;color:color-mix(in oklch, var(--band-ink) 72%, var(--band))}
${R} .ecd2-day.is-done .ecd2-num,${R} .ecd2-day.is-done .ecd2-short{color:var(--band-ink)}
${R} .ecd2-mark{display:grid;place-items:center;min-height:24px}
${R} .ecd2-badge{width:24px;height:24px;border-radius:999px;display:grid;place-items:center;background:var(--success);color:var(--ecd2-glyph);animation:ecd2-pop .3s cubic-bezier(.2,.7,.2,1) both}
${R} .ecd2-day.is-current{display:block;position:relative;margin:6px 0;padding:16px 14px 18px;background:oklch(from var(--band-ink) l c h / .1)}
${R} .ecd2-day.is-current .ecd2-badge{position:absolute;top:14px;right:14px}
${R} .ecd2-day-word{display:block;margin-bottom:12px;font-size:.875rem;font-weight:800;line-height:1.2;letter-spacing:.08em;text-transform:uppercase}
${R} .ecd2-big{display:block;font-family:var(--font-display);font-weight:var(--display-weight, 800);font-size:clamp(5.5rem, 8.4vw, 8.5rem);line-height:.86;letter-spacing:-.04em;font-variant-numeric:tabular-nums}
${R} .ecd2-today{display:block;margin-top:14px;font-size:.9375rem;font-weight:600;line-height:1.5;text-wrap:pretty}
${R} .ecd2-tag{display:inline-block;margin-inline-end:6px;padding:2px 12px;border-radius:999px;background:var(--accent-fill, var(--accent));color:var(--accent-fill-ink, var(--card));font-size:.875rem;font-weight:800;line-height:1.6}
${R} .ecd2-meter{margin:20px 8px 0}
${R} .ecd2-meter-label{margin:0 0 12px;font-size:.9375rem;font-weight:700;line-height:1.4}
${R} .ecd2-segs{display:flex;gap:4px}
${R} .ecd2-seg{flex:1;height:8px;border-radius:999px;background:oklch(from var(--band-ink) l c h / .18);transition:background .3s ease}
${R} .ecd2-seg.is-done{background:oklch(from var(--success) calc(l + .12) c h)}
${R} .ecd2-seg.is-cur{background:var(--accent-fill, var(--accent))}
${R} .ecd2-main{min-width:0;container-type:inline-size}
${R} .ecd2-rise{animation:ecd2-rise .45s cubic-bezier(.2,.7,.2,1) both}
${R} .ecd2-letter.ecd2-rise{animation-delay:.07s}
${R} .ecd2-work.ecd2-rise{animation-delay:.14s}
${R} .ecd2-next.ecd2-rise,${R} .ecd2-offer.ecd2-rise{animation-delay:.21s}
${R} .ecd2-h2{margin:0 0 16px;font-family:var(--font-display);font-weight:var(--display-weight, 800);letter-spacing:var(--display-tracking, -.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)}
${R} .ecd2-h3{margin:0;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:-.01em;text-wrap:balance;color:var(--ink)}
${R} .ecd2-letter{max-width:64ch;font-size:clamp(1.0625rem, 1.25vw, 1.125rem);line-height:1.5}
${R} .ecd2-letter p{margin:0 0 12px;text-wrap:pretty}
${R} .ecd2-letter p:last-child{margin-bottom:0}
${R} .ecd2-greet{font-weight:700}
${R} .ecd2-work{margin-top:32px;display:grid;gap:24px;align-items:start}
${R} .ecd2-work.has-photo{grid-template-columns:minmax(0, 1.15fr) minmax(0, .85fr)}
${R} .ecd2-card{background:var(--card, #ffffff);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-md, ${SHADOW_MD}));padding:clamp(20px, 3vw, 32px)}
${R} .ecd2-count{margin:12px 0 10px;font-size:.9375rem;font-weight:700;line-height:1.4;text-wrap:pretty}
${R} .ecd2-count.is-all{color:var(--success)}
${R} .ecd2-bar{height:8px;border-radius:999px;overflow:hidden;background:color-mix(in oklch, var(--ink) 9%, var(--card))}
${R} .ecd2-bar > span{display:block;height:100%;border-radius:inherit;background:var(--success);transition:width .45s cubic-bezier(.2,.7,.2,1)}
${R} .ecd2-list{list-style:none;margin:20px 0 0;padding:0;display:grid;gap:8px}
${R} .ecd2-row{position:relative;display:grid;grid-template-columns:26px minmax(0, 1fr) auto;align-items:start;gap:14px;min-height:56px;padding:14px;border-radius:10px;background:color-mix(in oklch, var(--ink) 4%, var(--card));cursor:pointer;transition:background .16s ease, transform .16s ease}
${R} .ecd2-row:hover{background:color-mix(in oklch, var(--ink) 7%, var(--card))}
${R} .ecd2-row:active{transform:scale(.99)}
${R} .ecd2-row.is-done{background:var(--success-soft)}
${R} .ecd2-row:has(.ecd2-input:focus-visible){outline:2px solid var(--field-focus, var(--accent));outline-offset:2px}
${R} .ecd2-input{position:absolute;top:14px;left:14px;width:26px;height:26px;margin:0;opacity:0;cursor:pointer}
${R} .ecd2-tick{width:26px;height:26px;border-radius:7px;display:grid;place-items:center;background:var(--field, #ffffff);border:2px solid oklch(from var(--field-ink, var(--ink)) l c h / .4);color:var(--ecd2-glyph);transition:background .16s ease, border-color .16s ease}
${R} .ecd2-row:hover .ecd2-tick{border-color:oklch(from var(--field-ink, var(--ink)) l c h / .7)}
${R} .ecd2-row.is-done .ecd2-tick{background:var(--success);border-color:var(--success)}
${R} .ecd2-tick svg{animation:ecd2-pop .3s cubic-bezier(.2,.7,.2,1) both}
${R} .ecd2-label{padding-top:1px;font-size:clamp(1.0625rem, 1.25vw, 1.125rem);font-weight:600;line-height:1.4;text-wrap:pretty;text-decoration-line:line-through;text-decoration-thickness:2px;text-decoration-color:transparent;transition:text-decoration-color .2s ease}
${R} .ecd2-row.is-done .ecd2-label{text-decoration-color:oklch(from var(--ink) l c h / .5)}
${R} .ecd2-chip{padding:3px 12px;border-radius:999px;background:color-mix(in oklch, var(--ink) 7%, var(--card));color:var(--ink);font-size:.875rem;font-weight:800;line-height:1.5;white-space:nowrap;font-variant-numeric:tabular-nums}
${R} .ecd2-empty{display:grid;justify-items:start;gap:12px}
${R} .ecd2-empty p{margin:0;font-size:clamp(1.0625rem, 1.25vw, 1.125rem);line-height:1.5;color:var(--muted);text-wrap:pretty}
${R} .ecd2-photo{margin:0}
${R} .ecd2-photo img{display:block;width:100%;height:auto;aspect-ratio:4 / 5;object-fit:cover;object-position:center;border-radius:12px}
${R} .ecd2-photo figcaption{margin-top:12px;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted);text-wrap:pretty}
${R} .ecd2-sign{margin-top:32px}
${R} .ecd2-closing{margin:0;font-size:clamp(1.0625rem, 1.25vw, 1.125rem);line-height:1.5}
${R} .ecd2-signame{margin:8px 0 0;font-family:var(--font-display);font-weight:var(--display-weight, 800);font-size:clamp(1.3125rem, 1.8vw, 1.625rem);line-height:1.15;letter-spacing:-.01em;color:var(--signature-ink, var(--ink))}
${R} .ecd2-role{margin:12px 0 0;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted)}
${R} .ecd2-next{margin-top:32px;display:grid;grid-template-columns:40px minmax(0, 1fr);gap:16px;align-items:start;padding:clamp(20px, 3vw, 32px);border-radius:var(--card-radius, var(--radius, 14px));background:color-mix(in oklch, var(--ink) 4%, var(--surface))}
${R} .ecd2-disc{width:40px;height:40px;border-radius:999px;display:grid;place-items:center;background:var(--accent-fill, var(--accent));color:var(--accent-fill-ink, var(--card))}
${R} .ecd2-next-p{margin:12px 0 0;font-size:clamp(1.0625rem, 1.25vw, 1.125rem);line-height:1.5;text-wrap:pretty}
${R} .ecd2-note{margin:8px 0 0;font-size:.9375rem;font-weight:600;line-height:1.4}
${R} .ecd2-offer{margin-top:32px;background:var(--card, #ffffff);color:var(--ink);border:1px solid color-mix(in oklch, var(--accent) 40%, var(--card));border-radius:var(--card-radius, var(--radius, 14px));box-shadow:var(--shadow-lg, ${SHADOW_LG});padding:clamp(20px, 3vw, 32px)}
${R} .ecd2-offer-p{margin:12px 0 0;max-width:60ch;font-size:clamp(1.0625rem, 1.25vw, 1.125rem);line-height:1.5;text-wrap:pretty}
${R} .ecd2-offer-row{margin-top:24px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:20px 32px}
${R} .ecd2-price-line{margin:0;display:flex;flex-wrap:wrap;align-items:baseline;gap:12px;line-height:1}
${R} .ecd2-was{padding:0 6px;text-decoration:none;font-family:var(--font-display);font-weight:var(--display-weight, 800);font-size:clamp(1.3125rem, 1.8vw, 1.625rem);color:var(--muted);font-variant-numeric:tabular-nums;background:linear-gradient(to top right, transparent calc(50% - 1.5px), var(--danger) calc(50% - 1.5px), var(--danger) calc(50% + 1.5px), transparent calc(50% + 1.5px))}
${R} .ecd2-now{display:inline-block;font-family:var(--font-display);font-weight:var(--display-weight, 800);font-size:clamp(2.5rem, 4.2vw, 3.75rem);line-height:1;letter-spacing:-.03em;font-variant-numeric:tabular-nums;color:var(--ink)}
${R} .ecd2-price-note{margin:16px 0 0;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted)}
${R} .ecd2-act{display:grid;justify-items:center;gap:10px}
${R} .ecd2-reassure{margin:0;font-size:.9375rem;font-weight:500;line-height:1.4;text-align:center;color:var(--muted);text-wrap:pretty}
${R} .ecd2-reassure svg{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em;color:var(--success)}
${R} .ecd2-btn{appearance:none;border:0;display:inline-flex;align-items:center;justify-content:center;min-height:64px;padding:0 28px;border-radius:var(--button-radius, var(--radius, 12px));font-family:var(--button-font, var(--font-display));font-weight:var(--button-weight, 800);text-transform:var(--button-case, none);font-size:clamp(1.125rem, 1.55vw, 1.375rem);line-height:1.15;text-align:center;text-wrap:balance;text-decoration:none;color:var(--button-ink, var(--cta-ink));text-shadow:var(--button-text-shadow, none);background:linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l + .04) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - .02) c h));box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + .14) c h / .7), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - .16) c h), 0 1px 2px oklch(from var(--ecd2-shadow) l c h / .3), 0 8px 16px -6px oklch(from var(--ecd2-shadow) l c h / .45));cursor:pointer;transition:transform .16s ease, box-shadow .16s ease, background .16s ease}
${R} .ecd2-btn:hover:not(:disabled),${R} .ecd2-btn[data-state='hover']{transform:translateY(-1px);background:linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - .01) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - .07) c h));box-shadow:inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + .1) c h / .6), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - .2) c h), 0 1px 2px oklch(from var(--ecd2-shadow) l c h / .32), 0 12px 20px -8px oklch(from var(--ecd2-shadow) l c h / .55)}
${R} .ecd2-btn:active:not(:disabled),${R} .ecd2-btn[data-state='active']{transform:translateY(1px);background:linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - .05) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--button-bg-2, var(--cta-2)) calc(l - .22) c h / .55), inset 0 -2px 0 oklch(from var(--button-bg, var(--cta)) calc(l - .16) c h), 0 1px 2px oklch(from var(--ecd2-shadow) l c h / .3)}
${R} .ecd2-btn:focus-visible{outline:3px solid var(--field-focus, var(--accent));outline-offset:3px}
${R} .ecd2-btn:disabled{cursor:not-allowed;transform:none;background:var(--button-2-bg, var(--secondary));color:var(--button-2-ink, var(--secondary-ink));text-shadow:none;box-shadow:var(--button-2-shadow, var(--shadow-sm))}
@container (max-width: 620px){${R} .ecd2-work.has-photo{grid-template-columns:minmax(0, 1fr)}${R} .ecd2-photo img{aspect-ratio:16 / 11}}
@container (max-width: 560px){${R} .ecd2-offer-row{flex-direction:column;align-items:stretch}${R} .ecd2-act{justify-items:stretch}${R} .ecd2-btn{width:100%;padding:0 20px}}
@media (max-width: 860px){
${R} .ecd2-wrap{grid-template-columns:minmax(0, 1fr);gap:28px}
${R} .ecd2-railwrap{position:static}
${R} .ecd2-rail{padding:14px 10px 12px}
${R} .ecd2-course{margin:0 4px 10px;text-align:center}
${R} .ecd2-days{display:flex;align-items:center;gap:4px;overflow-x:auto;scrollbar-width:none}
${R} .ecd2-days::-webkit-scrollbar{display:none}
${R} .ecd2-day{flex:1 0 36px;display:flex;flex-direction:column;align-items:center;gap:6px;padding:8px 2px}
${R} .ecd2-day.is-current{flex:1.6 0 60px;display:flex;margin:0;padding:8px 6px 10px}
${R} .ecd2-day.is-current .ecd2-badge{position:static}
${R} .ecd2-day-word{display:none}
${R} .ecd2-big{font-size:2.5rem;line-height:1;letter-spacing:-.03em}
${R} .ecd2-short,${R} .ecd2-today{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
${R} .ecd2-meter{display:none}
}
@media (prefers-reduced-motion: reduce){${R} *,${R} *::before,${R} *::after{animation:none !important;transition:none !important}}
@keyframes ecd2-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes ecd2-pop{from{transform:scale(.9)}to{transform:scale(1)}}
`
pieces/content/email-course-days-2/specimen.tsx 52 lines
import __studioImageaa3106f9 from "../assets/4204267adcfca673.webp";
// Specimen: Day 7 of the Rye & Salt sourdough email course, two of four homework wins ticked, the paid class offer below.
import * as React from 'react'
import { EmailCourseDays2 } from '../email-course-days-2'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled']
type SpecimenState = 'default' | 'hover' | 'active' | 'disabled'
export default function EmailCourseDays2Specimen({ state = 'default' }: { state?: SpecimenState }) {
const sample = defaults.sample
return (
<EmailCourseDays2
state={state}
currentDay={7}
defaultDone={[0, 1]}
lesson={{
greeting: 'Hi baker,',
paragraphs: [
'Seven days ago your starter was flour and water. This morning it raises a loaf.',
'You fed it, read it, folded it and shaped it, one small win at a time. Today they all go in the oven.',
],
homework: [
{ label: 'Feed your starter after breakfast', detail: '2 min' },
{ label: 'Mix, fold and shape your dough by noon', detail: '30 min' },
{ label: 'Bake lid on, then lid off until deep brown', detail: '45 min' },
{ label: 'Let it cool two hours before you slice', detail: '2 hrs' },
],
closing: 'Proud of you,',
signature: 'Mara',
signatureRole: 'Head baker, Rye & Salt',
}}
image={slot(
'scene',
__studioImageaa3106f9,
)}
imageAlt='A glass jar of bubbly sourdough starter, doubled and domed, on a wooden counter'
imageCaption='Ready to bake: doubled, domed and full of bubbles.'
offer={{
headline: 'Bake a week of bread with us',
text: 'You showed up seven days in a row. The full Rye & Salt class turns that habit into a week of bread: rye, seeded and a weekend boule.',
regularPrice: sample.regularPrice,
price: sample.price,
priceNote: sample.note,
label: 'Send me the full class',
reassurance: sample.guarantee,
}}
/>
)
}
| Name | Type | Details |
|---|---|---|
courseName OptionalEmailCourseDays2 |
string |
|
days OptionalEmailCourseDays2 |
CourseDay[] |
|
currentDay OptionalEmailCourseDays2 |
number |
|
lesson OptionalEmailCourseDays2 |
CourseLesson |
|
homeworkTitle OptionalEmailCourseDays2 |
string |
|
image OptionalEmailCourseDays2 |
string |
|
imageAlt OptionalEmailCourseDays2 |
string |
|
imageCaption OptionalEmailCourseDays2 |
string |
|
nextStep OptionalEmailCourseDays2 |
'auto' | 'teaser' | 'offer' | 'none' |
|
offer OptionalEmailCourseDays2 |
CourseOffer |
|
defaultDone OptionalEmailCourseDays2 |
number[] |
|
onToggle OptionalEmailCourseDays2 |
(done: number[]) => void |
|
onAction OptionalEmailCourseDays2 |
() => void |
|
disabled OptionalEmailCourseDays2 |
boolean |
|
state OptionalEmailCourseDays2 |
'default' | 'hover' | 'active' | 'disabled' |
|
copy OptionalEmailCourseDays2 |
Partial<EmailCourseDays2Copy> |
|
className OptionalEmailCourseDays2 |
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--field-ink- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
scene- A wide atmosphere photo behind or beside the copy.
-
2c539f422023a290.webp
image/webp · 115 KB
-
4204267adcfca673.webp
image/webp · 50 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d0943b629c0b1324.webp
image/webp · 8.87 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB