Lesson Visual Grid 1
Lesson visual grid: each workshop lesson reads as a concrete result with its own picture or mini chart,
Use it in a prompt
Use content/lesson-visual-grid 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/lesson-visual-grid.tsx. - Import it and pass your copy and images (Props tab):
import { LessonVisualGrid } from "@/components/funneldna/content/lesson-visual-grid"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/lesson-visual-grid/component.tsx 682 lines
// layout: route-map
// Lesson visual grid: each workshop lesson reads as a concrete result with its own picture or mini chart,
// linked like milestones on a route that ends at the registration button and P.S.
import * as React from 'react';
import { motion, useReducedMotion } from 'motion/react';
import { Divider, FX_HOST, Spot } from '../fx/fx';
import book from '../fx/spots/book';
import checklist from '../fx/spots/checklist';
import rocket from '../fx/spots/rocket';
export type LessonVisual =
/** Photo or cut-out render; use fit 'contain' for transparent object art */
| { kind: 'image'; src: string; alt?: string; fit?: 'cover' | 'contain'; position?: string }
/** fx Spot clay illustration (pass the imported asset) */
| { kind: 'spot'; src: string; alt?: string }
/** Rising line chart; points are raw values, the line switches to the highlight colour from highlightFrom */
| { kind: 'line'; points: number[]; highlightFrom?: number; value?: string; caption?: string; label?: string }
/** Ranked list, up to four rows; highlight is the featured row index */
| { kind: 'rank'; rows: { label: string; value?: string }[]; highlight?: number; label?: string }
/** Bar chart; value sets the height, display is the figure printed above the bar */
| { kind: 'bars'; bars: { label: string; value: number; display?: string }[]; highlight?: number; label?: string };
export type Lesson = {
title: string;
/** Two or three lines; wrap the key phrase in <b> */
body: React.ReactNode;
visual?: LessonVisual;
/** Optional link: the whole card becomes a link with a focus ring */
href?: string;
};
export type LessonVisualGridProps = {
headline?: string;
/** Phrase inside the headline that gets the accent marker stroke */
highlight?: string;
lead?: React.ReactNode;
lessons?: Lesson[];
/** Show milestone numerals before each lesson title */
numbered?: boolean;
/** Button action line */
label?: string;
/** Button reassurance line */
sublabel?: string;
href?: string;
onAction?: () => void;
/** P.S. line under the button */
ps?: React.ReactNode;
/** Token of the next section for the curved hand-off; null for a flat edge */
edge?: 'band' | 'surface' | 'card' | null;
copy?: { listLabel?: string };
state?: 'default' | 'hover' | 'active' | 'disabled';
className?: string;
};
export function LessonVisualGrid(props: LessonVisualGridProps) {
const {
headline = DEFAULT_HEADLINE,
highlight = DEFAULT_HIGHLIGHT,
lead = DEFAULT_LEAD,
lessons = DEFAULT_LESSONS,
numbered = true,
label = 'Yes! Save My Seat',
sublabel = 'Free workshop · Watch online',
href,
onAction,
ps = DEFAULT_PS,
edge = 'band',
copy,
state = 'default',
className,
} = props;
const reduce = useReducedMotion() ?? false;
const disabled = state === 'disabled';
const listLabel = copy?.listLabel ?? 'Workshop lessons';
const inner = (
<>
<span className='cf-lvg__btn-main'>{label}</span>
{sublabel ? <span className='cf-lvg__btn-sub'>{sublabel}</span> : null}
</>
);
return (
<section
className={['cf-lvg', edge ? 'has-edge' : '', className].filter(Boolean).join(' ')}
data-state={state}
style={FX_HOST}
>
<style>{CSS}</style>
{edge ? <Divider shape='curve' tone={edge} height={56} /> : null}
<div className='cf-lvg__wrap'>
<div className='cf-lvg__upper'>
<div className='cf-lvg__block' aria-hidden='true' />
<div className='cf-lvg__stripe' aria-hidden='true' />
<header className='cf-lvg__head'>
<h2 className='cf-lvg__h'>{markPhrase(headline, highlight)}</h2>
{lead ? <p className='cf-lvg__lead'>{lead}</p> : null}
</header>
<ol className='cf-lvg__grid' aria-label={listLabel}>
{lessons.map((lesson, i) => (
<LessonCard
key={`${lesson.title}-${i}`}
lesson={lesson}
index={i}
numbered={numbered}
reduce={reduce}
forceHover={state === 'hover' && i === 0}
/>
))}
</ol>
</div>
<div className='cf-lvg__finish'>
<span className='cf-lvg__route-end' aria-hidden='true' />
{href && !disabled ? (
<a className='cf-lvg__btn' href={href} onClick={onAction ? () => onAction() : undefined}>
{inner}
</a>
) : (
<button type='button' className='cf-lvg__btn' disabled={disabled} onClick={() => onAction?.()}>
{inner}
</button>
)}
{ps ? <p className='cf-lvg__ps'>{ps}</p> : null}
</div>
</div>
</section>
);
}
export default LessonVisualGrid;
function LessonCard({
lesson,
index,
numbered,
reduce,
forceHover,
}: {
lesson: Lesson;
index: number;
numbered: boolean;
reduce: boolean;
forceHover: boolean;
}) {
const v = lesson.visual;
const lit = !!v && v.kind !== 'image';
return (
<motion.li
className='cf-lvg__item'
initial={reduce ? false : { opacity: 0.82, y: 8 }}
whileInView={reduce ? undefined : { opacity: 1, y: 0 }}
viewport={{ once: true, amount: 0.2 }}
transition={{ duration: 0.45, ease: EASE, delay: Math.min(index * 0.07, 0.28) }}
>
<article className={forceHover ? 'cf-lvg__card is-hover' : 'cf-lvg__card'}>
{v ? (
<div className={lit ? 'cf-lvg__visual is-lit' : 'cf-lvg__visual'}>
<Visual v={v} reduce={reduce} />
</div>
) : null}
<div className='cf-lvg__body'>
<h3 className='cf-lvg__title'>
{numbered ? (
<span className='cf-lvg__num' aria-hidden='true'>
{String(index + 1).padStart(2, '0')}
</span>
) : null}
{lesson.href ? (
<a className='cf-lvg__link' href={lesson.href}>
{lesson.title}
</a>
) : (
lesson.title
)}
</h3>
<p className='cf-lvg__text'>{lesson.body}</p>
</div>
</article>
</motion.li>
);
}
function Visual({ v, reduce }: { v: LessonVisual; reduce: boolean }) {
if (v.kind === 'image') {
return (
<img
className={v.fit === 'contain' ? 'cf-lvg__img is-contain' : 'cf-lvg__img'}
src={v.src}
alt={v.alt ?? ''}
loading='lazy'
decoding='async'
style={v.position ? { objectPosition: v.position } : undefined}
/>
);
}
if (v.kind === 'spot') {
return (
<div className='cf-lvg__spot'>
<Spot src={v.src} size={112} shade='band' light='band-ink' alt={v.alt} />
</div>
);
}
if (v.kind === 'line') return <LineChart v={v} reduce={reduce} />;
if (v.kind === 'rank') return <RankList v={v} reduce={reduce} />;
return <BarChart v={v} reduce={reduce} />;
}
function LineChart({ v, reduce }: { v: Extract<LessonVisual, { kind: 'line' }>; reduce: boolean }) {
const gid = 'lvg-' + React.useId().replace(/[^a-zA-Z0-9_-]/g, '');
const pts = v.points.length > 1 ? v.points : [0, 1];
const n = pts.length;
const min = Math.min(...pts);
const span = Math.max(...pts) - min || 1;
const xy = pts.map((p, i): [number, number] => [
8 + (i / (n - 1)) * (VB_W - 26),
VB_H * 0.9 - ((p - min) / span) * VB_H * 0.66,
]);
const split = Math.min(Math.max(v.highlightFrom ?? Math.floor((n - 1) / 2), 0), n - 2);
const seg = (i: number) => {
const p0 = xy[Math.max(i - 1, 0)];
const p1 = xy[i];
const p2 = xy[i + 1];
const p3 = xy[Math.min(i + 2, n - 1)];
return ` C${r1(p1[0] + (p2[0] - p0[0]) / 6)} ${r1(p1[1] + (p2[1] - p0[1]) / 6)} ${r1(p2[0] - (p3[0] - p1[0]) / 6)} ${r1(p2[1] - (p3[1] - p1[1]) / 6)} ${r1(p2[0])} ${r1(p2[1])}`;
};
const from = (a: number, b: number) =>
`M${r1(xy[a][0])} ${r1(xy[a][1])}` + Array.from({ length: b - a }, (_, k) => seg(a + k)).join('');
const before = split > 0 ? from(0, split) : '';
const after = from(split, n - 1);
const area = `${after} L${r1(xy[n - 1][0])} ${VB_H} L${r1(xy[split][0])} ${VB_H} Z`;
const end = xy[n - 1];
const name = v.label ?? [v.value, v.caption].filter(Boolean).join(', ');
return (
<div
className='cf-lvg__fig'
role={name ? 'img' : undefined}
aria-label={name || undefined}
aria-hidden={name ? undefined : true}
>
<svg className='cf-lvg__svg' viewBox={`0 0 ${VB_W} ${VB_H}`} preserveAspectRatio='none' aria-hidden='true' focusable='false'>
<defs>
<linearGradient id={gid} x1='0' y1='0' x2='0' y2='1'>
<stop offset='0' style={{ stopColor: 'var(--lvg-hi)', stopOpacity: 0.34 }} />
<stop offset='1' style={{ stopColor: 'var(--lvg-hi)', stopOpacity: 0 }} />
</linearGradient>
</defs>
<line className='cf-lvg__base' x1='0' x2={VB_W} y1={r1(xy[split][1])} y2={r1(xy[split][1])} />
<motion.path
d={area}
fill={`url(#${gid})`}
initial={reduce ? false : { opacity: 0 }}
whileInView={reduce ? undefined : { opacity: 1 }}
viewport={VIEW}
transition={{ duration: 0.5, delay: 0.9 }}
/>
{before ? (
<motion.path
className='cf-lvg__line is-before'
d={before}
initial={reduce ? false : { pathLength: 0 }}
whileInView={reduce ? undefined : { pathLength: 1 }}
viewport={VIEW}
transition={{ duration: 0.5, ease: 'linear' }}
/>
) : null}
<motion.path
className='cf-lvg__line is-after'
d={after}
initial={reduce ? false : { pathLength: 0 }}
whileInView={reduce ? undefined : { pathLength: 1 }}
viewport={VIEW}
transition={{ duration: 0.7, delay: before ? 0.5 : 0, ease: EASE }}
/>
</svg>
<motion.span
className='cf-lvg__dot'
style={{ left: `${(end[0] / VB_W) * 100}%`, top: `${(end[1] / VB_H) * 100}%` }}
initial={reduce ? false : { opacity: 0, scale: 0.9 }}
whileInView={reduce ? undefined : { opacity: 1, scale: 1 }}
viewport={VIEW}
transition={{ duration: 0.3, delay: 1.1 }}
/>
{v.value || v.caption ? (
<div className='cf-lvg__chip'>
{v.value ? <span className='cf-lvg__chip-v'>{v.value}</span> : null}
{v.caption ? <span className='cf-lvg__chip-c'>{v.caption}</span> : null}
</div>
) : null}
</div>
);
}
function RankList({ v, reduce }: { v: Extract<LessonVisual, { kind: 'rank' }>; reduce: boolean }) {
const rows = v.rows.slice(0, 4);
const hl = v.highlight ?? 0;
const name = v.label ?? rows.map((row) => [row.label, row.value].filter(Boolean).join(' ')).join(', ');
return (
<div className='cf-lvg__fig' role='img' aria-label={name}>
<ol className='cf-lvg__rank'>
{rows.map((row, i) => (
<motion.li
key={`${row.label}-${i}`}
className={i === hl ? 'cf-lvg__row is-top' : 'cf-lvg__row'}
style={{ rotate: TILT[i % TILT.length] }}
initial={reduce ? false : { opacity: 0.82, x: -10 }}
whileInView={reduce ? undefined : { opacity: 1, x: 0 }}
viewport={VIEW}
transition={{ duration: 0.45, ease: EASE, delay: Math.min(i * 0.07, 0.28) }}
>
<span className='cf-lvg__row-n'>{i + 1}</span>
<span className='cf-lvg__row-l'>{row.label}</span>
{row.value ? <span className='cf-lvg__row-v'>{row.value}</span> : null}
</motion.li>
))}
</ol>
</div>
);
}
function BarChart({ v, reduce }: { v: Extract<LessonVisual, { kind: 'bars' }>; reduce: boolean }) {
const bars = v.bars.slice(0, 6);
const max = Math.max(0, ...bars.map((b) => b.value)) || 1;
const hl = v.highlight ?? bars.reduce((best, b, i) => (b.value > bars[best].value ? i : best), 0);
const name = v.label ?? bars.map((b) => [b.label, b.display].filter(Boolean).join(' ')).join(', ');
return (
<div className='cf-lvg__fig' role='img' aria-label={name}>
<div className='cf-lvg__bars'>
{bars.map((b, i) => {
const pct = 10 + (Math.max(b.value, 0) / max) * 62;
const hi = i === hl;
return (
<div className='cf-lvg__bar-col' key={`${b.label}-${i}`}>
<div className='cf-lvg__bar-track'>
<motion.div
className={hi ? 'cf-lvg__bar is-hi' : 'cf-lvg__bar'}
style={{ height: `${pct}%`, originY: 1 }}
initial={reduce ? false : { scaleY: 0.2 }}
whileInView={reduce ? undefined : { scaleY: 1 }}
viewport={VIEW}
transition={{ duration: 0.55, ease: EASE, delay: Math.min(i * 0.07, 0.28) }}
/>
{b.display ? (
<span className={hi ? 'cf-lvg__bar-v is-hi' : 'cf-lvg__bar-v'} style={{ bottom: `calc(${pct}% + 6px)` }}>
{b.display}
</span>
) : null}
</div>
<span className='cf-lvg__bar-label'>{b.label}</span>
</div>
);
})}
</div>
</div>
);
}
function markPhrase(text: string, phrase?: string): React.ReactNode {
if (!phrase) return text;
const at = text.indexOf(phrase);
if (at < 0) return text;
return (
<>
{text.slice(0, at)}
<span className='cf-lvg__mark'>{phrase}</span>
{text.slice(at + phrase.length)}
</>
);
}
const VB_W = 360;
const VB_H = 200;
const TILT = [-1.2, 0.8, -0.6, 1];
const EASE: [number, number, number, number] = [0.2, 0.7, 0.2, 1];
const VIEW = { once: true, amount: 0.4 };
const r1 = (n: number) => Math.round(n * 10) / 10;
const DEFAULT_HEADLINE = 'Map your first funnel, one page at a time';
const DEFAULT_HIGHLIGHT = 'one page at a time';
const DEFAULT_LEAD = 'Join the Funnel Starter Workshop and walk through your offer, page copy, and next steps.';
const DEFAULT_PS = (
<>
<b>P.S.</b> The workshop is free. Bring your offer idea and leave with a page-by-page plan.
</>
);
const DEFAULT_LESSONS: Lesson[] = [
{
title: 'Find the offer people say yes to',
body: (
<>
How to shape one clear offer around the problem your buyer already wants solved, <b>before you build a single page</b>.
</>
),
visual: { kind: 'spot', src: checklist },
},
{
title: 'Go from blank page to launch plan',
body: (
<>
Map every page your funnel needs in the order visitors see them, so <b>nothing is left to guess</b> on launch day.
</>
),
visual: { kind: 'line', points: [2, 2.6, 2.2, 3.4, 3, 4.4, 6.2, 8.6], highlightFrom: 3, value: 'Launch day', caption: 'your plan, finished' },
},
{
title: 'Write a headline that earns the scroll',
body: (
<>
The <b>one-sentence formula</b> for a promise your visitor understands in three seconds, and wants to read past.
</>
),
visual: { kind: 'spot', src: book },
},
{
title: 'Build the pages in the right order',
body: (
<>
Why most first funnels stall on page one, and the <b>build order</b> that gets you to a working funnel sooner.
</>
),
visual: {
kind: 'rank',
rows: [
{ label: 'Opt-in page', value: 'Step 1' },
{ label: 'Thank-you page', value: 'Step 2' },
{ label: 'Sales page', value: 'Step 3' },
{ label: 'Order form', value: 'Step 4' },
],
highlight: 0,
},
},
{
title: 'Fix the step where visitors leave',
body: (
<>
How to spot the <b>one page</b> where visitors drop off, and the small change that keeps them moving.
</>
),
visual: {
kind: 'bars',
bars: [
{ label: 'Ad', value: 9 },
{ label: 'Opt-in', value: 7 },
{ label: 'Sales', value: 4 },
{ label: 'Order', value: 3 },
{ label: 'Upsell', value: 2 },
],
highlight: 1,
label: 'Visitors moving through a funnel: ad, opt-in, sales, order, upsell',
},
},
{
title: 'Launch with every link checked',
body: (
<>
The pre-launch walk-through that catches <b>broken links, forms and emails</b> before your first visitor does.
</>
),
visual: { kind: 'spot', src: rocket },
},
];
const CSS = `
.cf-lvg {
--lvg-pt: clamp(56px, 8vw, 112px);
--lvg-pb: clamp(64px, 8.5vw, 120px);
--lvg-gap: clamp(24px, 2.6vw, 32px);
--lvg-vh: clamp(184px, 15vw, 208px);
--lvg-shadow: var(--shadow, oklch(0.22 0.03 260));
--lvg-stage: oklch(from var(--band) calc(l - 0.03) c h);
--lvg-hi: var(--accent-fill, var(--accent));
position: relative;
overflow: clip;
background: var(--surface);
color: var(--ink);
font-family: var(--font-body);
padding: var(--lvg-pt) clamp(16px, 5vw, 48px) var(--lvg-pb);
}
@supports (color: oklch(from red max(l, 0.5) c h)) {
.cf-lvg { --lvg-hi: oklch(from var(--accent-fill, var(--accent)) max(l, 0.7) c h); }
}
.cf-lvg.has-edge { padding-bottom: calc(var(--lvg-pb) + 56px); }
.cf-lvg *, .cf-lvg *::before, .cf-lvg *::after { box-sizing: border-box; }
.cf-lvg__wrap { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; }
.cf-lvg__upper { position: relative; }
.cf-lvg__block, .cf-lvg__stripe {
position: absolute; z-index: 0; top: calc(-1 * var(--lvg-pt)); bottom: 0; left: 50%;
width: max(100vw, 100%); transform: translateX(-50%); pointer-events: none;
}
.cf-lvg__block { background: var(--band); clip-path: polygon(0 0, 100% 0, 100% 58%, 0 80%); }
.cf-lvg__stripe {
background: var(--accent-fill, var(--accent));
clip-path: polygon(0 80%, 100% 58%, 100% calc(58% + 12px), 0 calc(80% + 12px));
}
.cf-lvg__head {
position: relative; z-index: 1; max-width: 46rem; margin: 0 auto; text-align: center;
background: var(--band); color: var(--band-ink);
}
.cf-lvg__h {
margin: 0; color: var(--band-ink); 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.12;
text-wrap: balance;
}
.cf-lvg__mark {
padding: 0 0.12em; margin: 0 -0.02em; border-radius: 0.18em 0.3em 0.22em 0.34em;
background: linear-gradient(to bottom, transparent 0 17%, var(--accent-fill, var(--accent)) 17% 100%);
color: var(--accent-fill-ink, var(--card));
-webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.cf-lvg__lead {
margin: 16px auto 0; max-width: 40rem; color: color-mix(in oklch, var(--band-ink) 84%, var(--band));
font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.4; font-weight: 500; text-wrap: pretty;
}
.cf-lvg__grid {
position: relative; z-index: 1; list-style: none; margin: clamp(40px, 5vw, 56px) 0 0; padding: 0;
display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--lvg-gap);
}
.cf-lvg__item { position: relative; display: flex; min-width: 0; }
@media (min-width: 1000px) {
.cf-lvg__item:not(:nth-child(3n)):not(:last-child)::after {
content: ''; position: absolute; left: 100%; top: calc(8px + var(--lvg-vh) / 2 - 2px);
width: var(--lvg-gap); height: 4px; border-radius: 4px; background: var(--accent-fill, var(--accent));
}
}
@media (max-width: 999px) { .cf-lvg__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) {
.cf-lvg { --lvg-vh: 184px; --lvg-gap: 28px; }
.cf-lvg__grid { grid-template-columns: minmax(0, 1fr); }
.cf-lvg__block { clip-path: polygon(0 0, 100% 0, 100% 480px, 0 540px); }
.cf-lvg__stripe { clip-path: polygon(0 540px, 100% 480px, 100% 492px, 0 552px); }
.cf-lvg .cf-lvg__bars { inset: 16px 10px 12px; gap: 4px; }
.cf-lvg .cf-lvg__bar { left: 10%; right: 10%; }
.cf-lvg__item:not(:last-child)::after {
content: ''; position: absolute; left: 50%; top: 100%; width: 4px; height: var(--lvg-gap);
margin-left: -2px; border-radius: 4px; background: var(--accent-fill, var(--accent));
}
}
.cf-lvg__card {
position: relative; display: flex; flex-direction: column; width: 100%; padding: 8px;
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(--lvg-shadow) l c h / 0.22), 0 4px 10px -2px oklch(from var(--lvg-shadow) l c h / 0.2)));
transition: transform 0.16s ease, box-shadow 0.16s ease;
}
@media (hover: hover) {
.cf-lvg__card:hover {
transform: translateY(-4px);
box-shadow: var(--shadow-lg, 0 2px 4px oklch(from var(--lvg-shadow) l c h / 0.22), 0 12px 24px -8px oklch(from var(--lvg-shadow) l c h / 0.32));
}
}
.cf-lvg__card.is-hover {
transform: translateY(-4px);
box-shadow: var(--shadow-lg, 0 2px 4px oklch(from var(--lvg-shadow) l c h / 0.22), 0 12px 24px -8px oklch(from var(--lvg-shadow) l c h / 0.32));
}
.cf-lvg__card:has(.cf-lvg__link:focus-visible) { outline: 3px solid var(--field-focus, var(--accent)); outline-offset: 3px; }
.cf-lvg__visual {
position: relative; isolation: isolate; height: var(--lvg-vh); overflow: hidden; border-radius: 10px;
background: var(--lvg-stage); color: var(--band-ink);
}
.cf-lvg__visual.is-lit::before {
content: ''; position: absolute; inset: 0; z-index: -1;
background: radial-gradient(70% 85% at 50% 108%, oklch(from var(--accent-fill, var(--accent)) l c h / 0.32), transparent 72%);
}
.cf-lvg__body { flex: 1; padding: clamp(16px, 2vw, 20px) clamp(12px, 1.6vw, 16px) clamp(14px, 1.8vw, 18px); }
.cf-lvg__title {
margin: 0; color: var(--ink); font-family: var(--font-display); font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none); letter-spacing: -0.01em;
font-size: clamp(1.3125rem, 1.8vw, 1.625rem); line-height: 1.15; text-wrap: balance;
}
.cf-lvg__num { margin-right: 0.4em; color: var(--accent); font-variant-numeric: tabular-nums; }
.cf-lvg__link { color: inherit; text-decoration: none; outline: none; }
.cf-lvg__link::after { content: ''; position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.cf-lvg__card:has(.cf-lvg__link:hover) .cf-lvg__link {
text-decoration: underline; text-decoration-color: oklch(from var(--link, var(--accent)) l c h / 0.45);
text-underline-offset: 0.18em;
}
.cf-lvg__text { margin: 12px 0 0; color: var(--muted); font-size: 1.0625rem; line-height: 1.5; text-wrap: pretty; }
.cf-lvg__text b, .cf-lvg__text strong { color: var(--ink); font-weight: 700; }
.cf-lvg__img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.cf-lvg__img.is-contain {
inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); object-fit: contain;
filter: drop-shadow(0 2px 3px oklch(from var(--lvg-shadow) l c h / 0.45)) drop-shadow(0 12px 16px oklch(from var(--lvg-shadow) l c h / 0.35));
}
.cf-lvg__spot { position: absolute; inset: 0; display: grid; place-items: center; }
.cf-lvg__fig { position: absolute; inset: 0; }
.cf-lvg__svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; }
.cf-lvg__base { stroke: oklch(from var(--band-ink) l c h / 0.22); stroke-width: 1.5; }
.cf-lvg__line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.cf-lvg__line.is-before { stroke: oklch(from var(--band-ink) l c h / 0.72); stroke-width: 3; }
.cf-lvg__line.is-after { stroke: var(--lvg-hi); stroke-width: 3.5; }
.cf-lvg__dot {
position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
background: var(--lvg-hi); border: 3px solid var(--lvg-stage);
}
.cf-lvg__chip { position: absolute; top: 16px; left: 18px; display: grid; gap: 12px; text-align: left; }
.cf-lvg__chip-v {
color: var(--band-ink); font-family: var(--font-display); font-weight: 800; font-size: 2rem; line-height: 1;
letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.cf-lvg__chip-c { color: color-mix(in oklch, var(--band-ink) 80%, var(--lvg-stage)); font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.cf-lvg__rank {
position: absolute; inset: 12px 16px; margin: 0; padding: 0; list-style: none;
display: flex; flex-direction: column; justify-content: center; gap: 6px;
}
.cf-lvg__row {
display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 6px 12px; border-radius: 10px;
background: oklch(from var(--band) calc(l + 0.08) c h); color: var(--band-ink);
border: 1px solid oklch(from var(--band-ink) l c h / 0.1);
box-shadow: 0 1px 2px oklch(from var(--lvg-shadow) l c h / 0.4), 0 6px 12px -6px oklch(from var(--lvg-shadow) l c h / 0.5);
}
.cf-lvg__row.is-top {
margin-inline: -4px; border-color: transparent;
background: var(--accent-fill, var(--accent)); color: var(--accent-fill-ink, var(--card));
}
.cf-lvg__row-n { min-width: 1.1em; font-size: 0.875rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.cf-lvg__row-l {
flex: 1; min-width: 0; font-size: 0.9375rem; font-weight: 600; line-height: 1.2;
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cf-lvg__row-v {
font-family: var(--font-display); font-size: 1.125rem; font-weight: 800; line-height: 1.1;
font-variant-numeric: tabular-nums; white-space: nowrap;
}
.cf-lvg__bars {
position: absolute; inset: 16px 14px 12px; display: grid; grid-auto-flow: column;
grid-auto-columns: minmax(0, 1fr); gap: 8px;
}
.cf-lvg__bar-col { display: flex; flex-direction: column; min-width: 0; }
.cf-lvg__bar-track { position: relative; flex: 1; }
.cf-lvg__bar {
position: absolute; left: 14%; right: 14%; bottom: 0; border-radius: 8px 8px 4px 4px;
background: linear-gradient(oklch(from var(--band-ink) l c h / 0.3), oklch(from var(--band-ink) l c h / 0.08));
}
.cf-lvg__bar.is-hi { background: linear-gradient(oklch(from var(--lvg-hi) calc(l + 0.04) c h), oklch(from var(--lvg-hi) calc(l - 0.08) c h)); }
.cf-lvg__bar-v {
position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap;
color: var(--band-ink); font-size: 0.875rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums;
}
.cf-lvg__bar-v.is-hi { font-family: var(--font-display); font-size: 1.125rem; font-weight: 800; }
.cf-lvg__bar-label {
margin-top: 8px; text-align: center; color: color-mix(in oklch, var(--band-ink) 80%, var(--lvg-stage));
font-size: 0.875rem; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cf-lvg__finish { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.cf-lvg__route-end { display: block; width: 4px; height: 40px; margin-bottom: 16px; border-radius: 4px; background: var(--accent-fill, var(--accent)); }
.cf-lvg__btn {
display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
width: min(100%, 26rem); min-height: 72px; padding: 12px 28px; border: 0; cursor: pointer;
border-radius: var(--button-radius, var(--radius, 12px)); color: var(--button-ink, var(--cta-ink));
background: linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l + 0.04) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.02) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--lvg-shadow) l c h / 0.3), 0 8px 16px -6px oklch(from var(--lvg-shadow) l c h / 0.45));
text-decoration: none; text-shadow: var(--button-text-shadow, none); font: inherit;
transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.cf-lvg__btn-main {
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;
}
.cf-lvg__btn-sub { font-family: var(--font-body); font-size: 0.9375rem; font-weight: 600; line-height: 1.3; text-wrap: pretty; }
.cf-lvg__btn:hover, .cf-lvg[data-state='hover'] .cf-lvg__btn {
transform: translateY(-1px);
background: linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - 0.01) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.07) c h));
box-shadow: inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.1) c h / 0.7), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.2) c h), 0 1px 2px oklch(from var(--lvg-shadow) l c h / 0.34), 0 10px 18px -6px oklch(from var(--lvg-shadow) l c h / 0.55);
}
.cf-lvg__btn:active, .cf-lvg[data-state='active'] .cf-lvg__btn {
transform: translateY(1px);
background: linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - 0.04) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.08) c h));
box-shadow: inset 0 2px 4px oklch(from var(--button-bg, var(--cta)) calc(l - 0.2) c h / 0.45), inset 0 -2px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--lvg-shadow) l c h / 0.3);
}
.cf-lvg__btn:focus-visible { outline: 3px solid var(--field-focus, var(--accent)); outline-offset: 3px; }
.cf-lvg .cf-lvg__btn:disabled {
cursor: not-allowed; transform: none; background: var(--secondary); color: var(--secondary-ink);
text-shadow: none; box-shadow: none;
}
.cf-lvg__ps { margin: 20px auto 0; max-width: 34rem; color: var(--muted); font-size: 1.0625rem; line-height: 1.5; text-wrap: pretty; }
.cf-lvg__ps b, .cf-lvg__ps strong { color: var(--ink); font-weight: 800; }
@media (prefers-reduced-motion: reduce) {
.cf-lvg__card, .cf-lvg__btn { transition: none; }
.cf-lvg__card:hover, .cf-lvg__card.is-hover, .cf-lvg__btn:hover, .cf-lvg__btn:active,
.cf-lvg[data-state] .cf-lvg__btn { transform: none; }
}
`;
pieces/content/lesson-visual-grid/specimen.tsx 131 lines
import __studioImageb6753115 from "../assets/ca01ed8cd4295d68.webp";
import __studioImage46450313 from "../assets/69dd236a3fa39258.webp";
import __studioImage89c22177 from "../assets/ac0c18a74d29da24.webp";
import { LessonVisualGrid, type LessonVisualGridProps } from '../lesson-visual-grid';
import { slot } from '../../slots';
export const states = ['default', 'hover', 'active', 'disabled'];
export default function LessonVisualGridSpecimen({ state = 'default' }: { state?: LessonVisualGridProps['state'] }) {
return (
<LessonVisualGrid
state={state}
headline='5 days to a balcony that feeds you all summer'
highlight='feeds you all summer'
lead='Six short lessons from the free Rooftop Harvest workshop. Each one ends with something growing.'
label='Save my free seat'
sublabel='Free 5-day workshop · Watch online'
ps={
<>
<b>P.S.</b> It costs nothing to join. All you need is a balcony, a sunny railing or one bright window.
</>
}
lessons={[
{
title: 'Fit a garden on any balcony',
body: (
<>
How to lay out pots, rails and one vertical rack so a balcony the size of a parking space grows <b>salad, herbs and tomatoes</b>.
</>
),
visual: {
kind: 'image',
src: slot(
'scene',
__studioImageb6753115
),
alt: 'A small city balcony full of vegetables and herbs growing in pots',
position: '50% 60%',
},
},
{
title: 'Grow the crops that pay their rent',
body: (
<>
Which vegetables give you the <b>most food per pot</b>, and the three that look great but barely feed you.
</>
),
visual: {
kind: 'bars',
bars: [
{ label: 'Basil', value: 0.5, display: '0.5 lb' },
{ label: 'Chard', value: 2, display: '2 lb' },
{ label: 'Tomato', value: 4, display: '4 lb' },
{ label: 'Beans', value: 2.5, display: '2.5 lb' },
{ label: 'Kale', value: 1.5, display: '1.5 lb' },
],
highlight: 2,
label: 'Harvest per pot in one season: basil 0.5 lb, chard 2 lb, tomato 4 lb, beans 2.5 lb, kale 1.5 lb',
},
},
{
title: 'The soil mix that stops wilting',
body: (
<>
Why bagged potting soil dries out by noon on a sunny balcony, and the <b>three-ingredient mix</b> that holds water all day.
</>
),
visual: {
kind: 'image',
fit: 'contain',
src: slot(
'item-1',
__studioImage46450313
),
alt: 'A terracotta pot of rich soil with a young tomato seedling',
},
},
{
title: 'Your first salad in 30 days',
body: (
<>
The fast crops to sow first, so you are <b>picking leaves within a month</b> while the tomatoes are still flowering.
</>
),
visual: {
kind: 'line',
points: [1, 1.6, 1.3, 2.2, 1.8, 2.6, 4, 6.2, 8.5],
highlightFrom: 4,
value: 'Day 30',
caption: 'first salad picked',
label: 'Leaves growing from seed to the first salad picked on day 30',
},
},
{
title: 'The 5-minute daily routine',
body: (
<>
The <b>morning check</b> that keeps every pot alive through a heatwave, even when you are out all day.
</>
),
visual: {
kind: 'rank',
rows: [
{ label: 'Check the soil', value: '1 min' },
{ label: 'Water at the roots', value: '2 min' },
{ label: 'Pinch and pick', value: '1 min' },
{ label: 'Turn the pots', value: '1 min' },
],
highlight: 0,
},
},
{
title: 'Harvest every week, all summer',
body: (
<>
How to <b>stagger your sowing</b> so something is ready to pick every week, instead of everything at once in August.
</>
),
visual: {
kind: 'image',
src: slot(
'item-2',
__studioImage89c22177
),
alt: 'Hands picking ripe cherry tomatoes and basil on a sunny balcony',
},
},
]}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalLessonVisualGrid |
string |
|
highlight OptionalLessonVisualGrid |
string |
|
lead OptionalLessonVisualGrid |
React.ReactNode |
|
lessons OptionalLessonVisualGrid |
Lesson[] |
|
numbered OptionalLessonVisualGrid |
boolean |
|
label OptionalLessonVisualGrid |
string |
|
sublabel OptionalLessonVisualGrid |
string |
|
href OptionalLessonVisualGrid |
string |
|
onAction OptionalLessonVisualGrid |
() => void |
|
ps OptionalLessonVisualGrid |
React.ReactNode |
|
edge OptionalLessonVisualGrid |
'band' | 'surface' | 'card' | null |
|
copy OptionalLessonVisualGrid |
{ listLabel?: string } |
|
state OptionalLessonVisualGrid |
'default' | 'hover' | 'active' | 'disabled' |
|
className OptionalLessonVisualGrid |
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-focus- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
item-1- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-2- One image per offer item (item-1, item-2…), shown in stacks and lists.
scene- A wide atmosphere photo behind or beside the copy.
-
69dd236a3fa39258.webp
image/webp · 106 KB
-
ac0c18a74d29da24.webp
image/webp · 57.8 KB
-
bc3d360c88eeac0e.webp
image/webp · 23.9 KB
-
ca01ed8cd4295d68.webp
image/webp · 101 KB
-
d0943b629c0b1324.webp
image/webp · 8.87 KB
-
d7814fce240ddf0e.webp
image/webp · 17.6 KB