Podcast Subscribe 2
Podcast show block: a bento shelf that samples the season's best episodes (press one and it swaps into the now-playing tile), then asks for one email so the next episode arrives by itself.
Use it in a prompt
Use content/podcast-subscribe-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/podcast-subscribe-2.tsx. - Import it and pass your copy and images (Props tab):
import { PodcastSubscribe2 } from "@/components/funneldna/content/podcast-subscribe-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/podcast-subscribe-2/component.tsx 589 lines
// layout: diagonal-split
// Podcast show block: a bento shelf that samples the season's best episodes (press one and it swaps into the now-playing tile), then asks for one email so the next episode arrives by itself.
import * as React from 'react';
import { AlertCircle, AudioLines, Clock, Headphones, Lock, Play } from 'lucide-react';
import { FX_HOST, Pattern } from '../fx/fx';
export type PodcastShelfEpisode = {
/** Episode number as printed, e.g. '07'. */
number?: string;
title: string;
/** Running time as shown, e.g. '36 min'. */
runtime?: string;
/** One short line: why this episode is worth hearing first. */
detail?: string;
/** Poster art for the now-playing tile (slot: item-n). Falls back to the cover art. */
image?: string;
imageAlt?: string;
/** Where the episode plays. When set, the play control is a link. */
href?: string;
};
export type PodcastPlatformLink = { label: string; href: string };
export type PodcastSubscribe2Copy = {
nowPlaying: string;
/** Uses {number}. */
episodeLabel: string;
playLabel: string;
/** Accessible name of the play control. Uses {title}; keep the visible play label in it. */
playAria: string;
/** Read aloud after a swap. Uses {title}. */
announce: string;
shelfHeading: string;
shelfNote: string;
listenLabel: string;
inPlayerLabel: string;
formHeading: string;
formLead: string;
emailLabel: string;
emailPlaceholder: string;
buttonLabel: string;
privacy: string;
platformsLabel: string;
emailRequired: string;
emailInvalid: string;
/** Value shown in the field for the error state preview. */
errorSample: string;
};
export type PodcastSubscribe2Props = {
showName?: string;
/** Season label shown as a chip beside the show name. */
season?: string;
/** Square cover art (slot: product). */
coverImage?: string;
coverAlt?: string;
/** The show promise. */
headline?: string;
/** The phrase inside the headline that gets the marker stroke. */
headlineHighlight?: string;
/** One-sentence paragraphs; a one-word line is set large as the punch. */
lines?: string[];
/** Supplied release cadence, e.g. 'New episodes every Thursday'. */
cadence?: string;
/** The best-of episodes. Episode data comes from props only. */
episodes?: PodcastShelfEpisode[];
/** Index of the episode that starts in the player. */
defaultEpisode?: number;
platforms?: PodcastPlatformLink[];
copy?: Partial<PodcastSubscribe2Copy>;
onPlay?: (episode: PodcastShelfEpisode, index: number) => void;
onEpisodeChange?: (episode: PodcastShelfEpisode, index: number) => void;
/** Receives the validated email and the episode in the player. */
onSubmit?: (values: { email: string; episode?: string }) => void;
state?: 'default' | 'hover' | 'active' | 'disabled' | 'error';
className?: string;
};
export function PodcastSubscribe2(props: PodcastSubscribe2Props) {
const {
showName = 'Built From Scratch',
season = 'Season two',
coverImage,
coverAlt = '',
headline = 'Hear two first-time bakers open a shop, one 4 a.m. shift at a time',
headlineHighlight = 'open a shop',
lines = DEFAULT_LINES,
cadence = '',
episodes = [],
defaultEpisode = 0,
platforms = [],
onPlay,
onEpisodeChange,
onSubmit,
state = 'default',
className,
} = props;
const copy: PodcastSubscribe2Copy = { ...DEFAULT_COPY, ...props.copy };
const uid = React.useId();
const ids = {
head: `${uid}-head`,
player: `${uid}-player`,
playerTitle: `${uid}-player-title`,
shelf: `${uid}-shelf`,
email: `${uid}-email`,
error: `${uid}-error`,
privacy: `${uid}-privacy`,
};
const count = episodes.length;
const start = count ? Math.min(Math.max(0, Math.floor(defaultEpisode)), count - 1) : 0;
const [current, setCurrent] = React.useState(start);
const [prev, setPrev] = React.useState<number | null>(null);
const [swaps, setSwaps] = React.useState(0);
const [announce, setAnnounce] = React.useState('');
const npRef = React.useRef<HTMLElement>(null);
const safe = count ? Math.min(current, count - 1) : 0;
const playing = count ? episodes[safe] : undefined;
const disabled = state === 'disabled';
const forcedError = state === 'error';
const [email, setEmail] = React.useState(forcedError ? copy.errorSample : '');
const [error, setError] = React.useState<string | null>(forcedError ? copy.emailInvalid : null);
const inputRef = React.useRef<HTMLInputElement>(null);
React.useEffect(() => {
if (state === 'error') {
setEmail(copy.errorSample);
setError(copy.emailInvalid);
}
}, [state, copy.errorSample, copy.emailInvalid]);
const select = (i: number) => {
if (i === safe || !episodes[i]) return;
setPrev(safe);
setCurrent(i);
setSwaps((s) => s + 1);
setAnnounce(fill(copy.announce, { title: episodes[i].title }));
onEpisodeChange?.(episodes[i], i);
const el = npRef.current;
if (el && typeof window !== 'undefined') {
const r = el.getBoundingClientRect();
if (r.bottom < 96 || r.top > window.innerHeight - 96) {
const reduce = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches;
el.scrollIntoView({ behavior: reduce ? 'auto' : 'smooth', block: 'start' });
}
}
};
const check = (value: string) => {
const v = value.trim();
if (!v) return copy.emailRequired;
return EMAIL_RE.test(v) ? null : copy.emailInvalid;
};
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const v = e.target.value;
setEmail(v);
if (error && !check(v)) setError(null);
};
const handleBlur = () => {
if (email.trim()) setError(check(email));
};
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
if (disabled) return;
const problem = check(email);
setError(problem);
if (problem) {
inputRef.current?.focus();
return;
}
onSubmit?.({ email: email.trim(), episode: playing?.title });
};
const posterOf = (ep?: PodcastShelfEpisode) => ep?.image || coverImage;
const posterAltOf = (ep?: PodcastShelfEpisode) => (ep?.image ? ep.imageAlt ?? '' : coverAlt);
const hoverIndex = state === 'hover' && count > 1 ? (safe + 1) % count : -1;
const buttonClass = cx('pb-btn', state === 'hover' && 'is-hover', state === 'active' && 'is-active');
const cadenceText = cadence.replace(/[.\s]+$/, '');
const prevPoster = prev !== null ? posterOf(episodes[prev]) : undefined;
const playInner = (
<>
<span className='pb-play-disc' aria-hidden='true'>
<Play size={18} strokeWidth={2.5} fill='currentColor' />
</span>
<span className='pb-play-label'>{copy.playLabel}</span>
</>
);
return (
<section className={cx('cf-podcast-subscribe-2', className)} style={FX_HOST} aria-labelledby={ids.head}>
<style>{CSS}</style>
<div className='pb-field' aria-hidden='true'>
<Pattern name='grid' fade='corner' tone='band-ink' />
</div>
<div className={cx('pb-grid', !playing && 'is-solo')}>
<article className='pb-tile pb-cover'>
{coverImage ? (
<div className='pb-art'>
<img src={coverImage} alt={coverAlt} width={1024} height={1024} />
</div>
) : null}
<div className='pb-meta'>
<p className='pb-show'>{showName}</p>
{season ? <span className='pb-chip'>{season}</span> : null}
</div>
<h2 id={ids.head} className='pb-h2'>
{renderHeadline(headline, headlineHighlight)}
</h2>
{lines.length ? (
<div className='pb-lines'>
{lines.map((line, i) => (
<p key={i} className={isPunch(line) ? 'is-punch' : undefined}>
{line}
</p>
))}
</div>
) : null}
</article>
{playing ? (
<section ref={npRef} id={ids.player} className='pb-tile pb-np' aria-labelledby={ids.playerTitle}>
<div className='pb-np-top'>
<span className='pb-np-chip'>
<AudioLines size={16} strokeWidth={2.5} aria-hidden='true' />
{copy.nowPlaying}
</span>
{playing.number ? (
<span className='pb-np-num'>{fill(copy.episodeLabel, { number: playing.number })}</span>
) : null}
</div>
{posterOf(playing) ? (
<div className='pb-poster'>
{prevPoster ? <img className='pb-poster-under' src={prevPoster} alt='' aria-hidden='true' /> : null}
<img
key={`poster-${swaps}`}
className={swaps > 0 ? 'is-in' : undefined}
src={posterOf(playing)}
alt={posterAltOf(playing)}
width={1536}
height={1024}
onAnimationEnd={() => setPrev(null)}
/>
</div>
) : null}
<div key={`body-${swaps}`} className={cx('pb-np-body', swaps > 0 && 'is-in')}>
<h3 id={ids.playerTitle} className='pb-h3'>
{playing.title}
</h3>
{playing.runtime ? (
<p className='pb-np-meta'>
<Clock size={16} strokeWidth={2.5} aria-hidden='true' />
{playing.runtime}
</p>
) : null}
{playing.detail ? <p className='pb-np-detail'>{playing.detail}</p> : null}
</div>
{playing.href ? (
<a
className='pb-play'
href={playing.href}
aria-label={fill(copy.playAria, { title: playing.title })}
onClick={() => onPlay?.(playing, safe)}
>
{playInner}
</a>
) : (
<button
type='button'
className='pb-play'
aria-label={fill(copy.playAria, { title: playing.title })}
onClick={() => onPlay?.(playing, safe)}
>
{playInner}
</button>
)}
<p className='pb-sr' aria-live='polite'>
{announce}
</p>
</section>
) : null}
<div className='pb-tile pb-sub'>
<div>
<h3 className='pb-h3'>{copy.formHeading}</h3>
{cadenceText || copy.formLead ? (
<p className='pb-sub-lead'>
{cadenceText ? <strong>{cadenceText}. </strong> : null}
{copy.formLead}
</p>
) : null}
</div>
<form className='pb-form' noValidate onSubmit={handleSubmit}>
<div className='pb-group'>
<label htmlFor={ids.email} className='pb-label'>
{copy.emailLabel}
</label>
<input
ref={inputRef}
id={ids.email}
className='pb-input'
type='email'
name='email'
autoComplete='email'
inputMode='email'
placeholder={copy.emailPlaceholder}
value={email}
onChange={handleChange}
onBlur={handleBlur}
disabled={disabled}
aria-invalid={error ? 'true' : undefined}
aria-describedby={error ? `${ids.error} ${ids.privacy}` : ids.privacy}
/>
{error ? (
<p id={ids.error} className='pb-error' role='alert'>
<AlertCircle className='pb-ico' size={16} strokeWidth={2.5} aria-hidden='true' />
{error}
</p>
) : null}
</div>
<button type='submit' className={buttonClass} disabled={disabled}>
{copy.buttonLabel}
</button>
<p id={ids.privacy} className='pb-privacy'>
<Lock className='pb-ico' size={16} strokeWidth={2.5} aria-hidden='true' />
{copy.privacy}
</p>
</form>
{platforms.length ? (
<div className='pb-platforms'>
<p className='pb-platforms-label'>{copy.platformsLabel}</p>
<ul>
{platforms.map((p) => (
<li key={p.label}>
<a className='pb-link' href={p.href}>
{p.label}
</a>
</li>
))}
</ul>
</div>
) : null}
</div>
{count ? (
<div className='pb-tile pb-shelf'>
<div className='pb-shelf-intro'>
<h3 id={ids.shelf} className='pb-h3'>
{copy.shelfHeading}
</h3>
{copy.shelfNote ? <p className='pb-shelf-note'>{copy.shelfNote}</p> : null}
</div>
<ul className='pb-list' aria-labelledby={ids.shelf}>
{episodes.map((ep, i) => {
const isCurrent = i === safe;
return (
<li key={`${ep.title}-${i}`}>
<button
type='button'
className={cx('pb-ep', i === hoverIndex && 'is-hover')}
aria-current={isCurrent ? 'true' : undefined}
aria-controls={ids.player}
onClick={() => select(i)}
>
<span className='pb-ep-top'>
{ep.number ? <span className='pb-ep-num'>{ep.number}</span> : <span />}
{ep.runtime ? (
<span className='pb-ep-time'>
<Clock size={16} strokeWidth={2.5} aria-hidden='true' />
{ep.runtime}
</span>
) : null}
</span>
<span className='pb-ep-title'>{ep.title}</span>
{ep.detail ? <span className='pb-ep-detail'>{ep.detail}</span> : null}
<span className='pb-ep-status'>
{isCurrent ? (
<AudioLines size={18} strokeWidth={2.5} aria-hidden='true' />
) : (
<Headphones size={18} strokeWidth={2.5} aria-hidden='true' />
)}
{isCurrent ? copy.inPlayerLabel : copy.listenLabel}
</span>
</button>
</li>
);
})}
</ul>
</div>
) : null}
</div>
</section>
);
}
export default PodcastSubscribe2;
const DEFAULT_LINES = [
'Season one, we quit our jobs and signed a lease on a corner shop.',
'Season two, we have to open the doors.',
'We kept the mics running through all of it.',
'Unedited.',
];
const DEFAULT_COPY: PodcastSubscribe2Copy = {
nowPlaying: 'Now playing',
episodeLabel: 'Episode {number}',
playLabel: 'Play episode',
playAria: 'Play episode: {title}',
announce: 'Now playing: {title}',
shelfHeading: 'Start with the three best episodes',
shelfNote: 'Press one to put it in the player.',
listenLabel: 'Put it in the player',
inPlayerLabel: 'In the player',
formHeading: 'Hear the next episode first',
formLead: 'Drop your email and each new one lands in your inbox.',
emailLabel: 'Your email',
emailPlaceholder: 'you@example.com',
buttonLabel: 'Send me each new episode',
privacy: 'We respect your inbox. Unsubscribe anytime.',
platformsLabel: 'Or listen on',
emailRequired: 'Enter your email so we can send the next episode.',
emailInvalid: 'That email looks incomplete. Check it and try again.',
errorSample: 'maya@bakery',
};
const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;
function cx(...parts: (string | false | null | undefined)[]) {
return parts.filter(Boolean).join(' ');
}
function fill(template: string, values: Record<string, string>) {
return template.replace(/\{(\w+)\}/g, (match, key: string) => (key in values ? values[key] : match));
}
function isPunch(line: string) {
return line.trim().split(/\s+/).length === 1;
}
/** Keeps hyphenated words ("first-time") whole so a headline never breaks at the hyphen. */
function keepWords(text: string, keyBase: string) {
const parts = text.split(/(\S+-\S+)/);
return parts.map((p, i) =>
i % 2 ? (
<span key={`${keyBase}-${i}`} className='pb-nobr'>
{p}
</span>
) : (
p
),
);
}
function renderHeadline(text: string, mark?: string) {
const at = mark ? text.indexOf(mark) : -1;
if (!mark || at < 0) return <>{keepWords(text, 'h')}</>;
return (
<>
{keepWords(text.slice(0, at), 'a')}
<span className='pb-mark'>{keepWords(mark, 'm')}</span>
{keepWords(text.slice(at + mark.length), 'b')}
</>
);
}
const SHADOW_SM =
'0 1px 1px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / .18), 0 1px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / .14)';
const SHADOW_MD =
'0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / .22), 0 4px 10px -2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / .2)';
const SHADOW_LG =
'0 2px 4px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / .22), 0 12px 24px -8px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / .32)';
const R = '.cf-podcast-subscribe-2';
const CSS = `
${R}{position:relative;isolation:isolate;overflow-x:clip;background:var(--surface);color:var(--ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px)}
${R} *,${R} *::before,${R} *::after{box-sizing:border-box}
${R} :where(h2,h3,p,ul,li){margin:0;padding:0}
${R} :where(ul){list-style:none}
${R} .pb-field{position:absolute;inset:0;z-index:0;background:var(--band);clip-path:polygon(0 0,64% 0,42% 100%,0 100%);overflow:hidden;pointer-events:none}
${R} .pb-grid{position:relative;z-index:1;max-width:1120px;margin:0 auto;display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);grid-template-areas:'cover np' 'cover sub' 'shelf shelf';gap:16px}
${R} .pb-grid.is-solo{grid-template-areas:'cover sub'}
${R} .pb-tile{min-width:0;border-radius:var(--card-radius,var(--radius,14px));border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));padding:clamp(20px,3vw,32px)}
${R} .pb-cover{grid-area:cover;display:flex;flex-direction:column;background:var(--card);box-shadow:var(--card-shadow,var(--shadow-md,${SHADOW_MD}))}
${R} .pb-art{position:relative;flex:1 1 auto;min-height:280px;border-radius:12px;overflow:hidden;background:color-mix(in oklch,var(--ink) 6%,var(--card))}
${R} .pb-art img,${R} .pb-poster img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;display:block}
${R} .pb-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:24px 0 12px}
${R} .pb-meta:first-child{margin-top:0}
${R} .pb-show{font-size:1.0625rem;font-weight:700;line-height:1.3}
${R} .pb-chip{display:inline-flex;align-items:center;min-height:28px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch,var(--ink) 6%,var(--card));color:var(--ink);font-size:.875rem;font-weight:800;line-height:1.2}
${R} .pb-h2{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}
${R} .pb-nobr{white-space:nowrap}
${R} .pb-mark{background-image:linear-gradient(var(--marker,#fae37c),var(--marker,#fae37c));background-repeat:no-repeat;background-size:100% .44em;background-position:0 86%;padding:0 .06em;margin:0 -.06em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
${R} .pb-lines{display:grid;gap:8px;margin-top:16px}
${R} .pb-lines p{font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;text-wrap:pretty}
${R} .pb-lines p.is-punch{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:-0.01em}
${R} .pb-h3{font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;text-wrap:balance}
${R} .pb-np{grid-area:np;display:flex;flex-direction:column;gap:16px;background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card));border-color:oklch(from var(--accent-fill,var(--accent)) calc(l - .08) c h);box-shadow:var(--shadow-lg,${SHADOW_LG})}
${R} .pb-np-top{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 12px}
${R} .pb-np-chip{display:inline-flex;align-items:center;gap:8px;min-height:30px;padding:4px 12px;border-radius:999px;background:oklch(from var(--accent-fill-ink,var(--card)) l c h / .14);font-size:.875rem;font-weight:800;line-height:1.2}
${R} .pb-np-num{font-size:.9375rem;font-weight:700;line-height:1.4;font-variant-numeric:tabular-nums}
${R} .pb-poster{position:relative;flex:1 1 auto;min-height:200px;border-radius:12px;overflow:hidden;background:oklch(from var(--accent-fill-ink,var(--card)) l c h / .12)}
${R} .pb-np-body{display:grid;gap:8px}
${R} .pb-np-meta{display:flex;align-items:center;gap:6px;font-size:.9375rem;font-weight:600;line-height:1.4}
${R} .pb-np-detail{font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;font-weight:500;text-wrap:pretty}
${R} .pb-play{appearance:none;align-self:stretch;width:100%;display:grid;grid-template-columns:40px minmax(0,1fr) 40px;align-items:center;justify-items:center;gap:12px;min-height:56px;margin-top:4px;padding:8px;border:0;border-radius:999px;background:var(--card);color:var(--ink);font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:clamp(1.0625rem,1.3vw,1.1875rem);line-height:1.2;text-align:center;text-decoration:none;cursor:pointer;box-shadow:var(--shadow-sm,${SHADOW_SM});transition:transform .16s ease,box-shadow .16s ease,background-color .16s ease}
${R} .pb-play::after{content:'';width:40px;height:1px}
${R} .pb-play-label{min-width:0;text-wrap:balance}
${R} .pb-play:hover{background:color-mix(in oklch,var(--ink) 4%,var(--card))}
${R} .pb-play:hover{transform:translateY(-1px);box-shadow:var(--shadow-md,${SHADOW_MD})}
${R} .pb-play:active{transform:translateY(0) scale(.98);box-shadow:var(--shadow-sm,${SHADOW_SM})}
${R} .pb-play:focus-visible{outline:3px solid var(--accent-fill-ink,var(--card));outline-offset:3px}
${R} .pb-play-disc{display:inline-grid;place-items:center;width:40px;height:40px;flex:none;border-radius:50%;background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card))}
${R} .pb-play-disc svg{margin-left:2px}
${R} .pb-sub{grid-area:sub;display:flex;flex-direction:column;gap:24px;background:var(--card);box-shadow:var(--card-shadow,var(--shadow-md,${SHADOW_MD}))}
${R} .pb-sub-lead{margin-top:12px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--muted);text-wrap:pretty}
${R} .pb-sub-lead strong{color:var(--ink);font-weight:700}
${R} .pb-form{display:grid;gap:12px}
${R} .pb-group{display:grid;gap:8px}
${R} .pb-label{font-size:1.0625rem;font-weight:700;line-height:1.3;color:var(--label-ink,var(--ink))}
${R} .pb-input{width:100%;min-height:56px;padding:0 16px;font-family:var(--font-body);font-size:17px;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));transition:border-color .16s ease,box-shadow .16s ease}
${R} .pb-input::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
${R} .pb-input:hover:not(:disabled){border-color:color-mix(in oklch,var(--ink) 38%,transparent)}
${R} .pb-input:focus{outline:none;border-color:var(--field-focus,var(--accent));box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent)) l c h / .35)}
${R} .pb-input[aria-invalid='true']{border-color:var(--danger)}
${R} .pb-input[aria-invalid='true']:focus{border-color:var(--danger);box-shadow:0 0 0 3px oklch(from var(--danger) l c h / .3)}
${R} .pb-input:disabled{cursor:not-allowed;background:color-mix(in oklch,var(--ink) 4%,var(--field))}
${R} .pb-error{font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--danger);text-wrap:pretty}
${R} .pb-ico{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em}
${R} .pb-btn{appearance:none;border:0;width:100%;min-height:56px;padding:12px 28px;display:inline-flex;align-items:center;justify-content:center;text-align:center;text-wrap:balance;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(--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(--shadow,oklch(0.22 0.03 260)) l c h / .3),0 8px 16px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .45));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
${R} .pb-btn:hover:not(:disabled),${R} .pb-btn.is-hover{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:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .1) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .2) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .32),0 10px 18px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .5))}
${R} .pb-btn:active:not(:disabled),${R} .pb-btn.is-active{transform:translateY(1px);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 - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--button-bg,var(--cta)) calc(l - .22) c h / .55),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .18) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .3)}
${R} .pb-btn:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .55);outline-offset:3px}
${R} .pb-btn:disabled{cursor:not-allowed;background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));text-shadow:none;box-shadow:none}
${R} .pb-privacy{font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted);text-wrap:pretty}
${R} .pb-platforms{margin-top:auto;display:grid;gap:4px;font-size:.9375rem;line-height:1.4}
${R} .pb-platforms-label{font-weight:600;color:var(--muted)}
${R} .pb-platforms ul{display:flex;flex-wrap:wrap;gap:0 16px}
${R} .pb-link{display:inline-block;padding:6px 0;color:var(--link,var(--accent));font-weight:700;text-decoration:underline;text-decoration-thickness:1.5px;text-decoration-color:oklch(from var(--link,var(--accent)) l c h / .45);text-underline-offset:.18em}
${R} .pb-link:hover{color:oklch(from var(--link,var(--accent)) calc(l - .08) c h);text-decoration-color:currentColor}
${R} .pb-link:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .45);outline-offset:2px;border-radius:4px}
${R} .pb-shelf{grid-area:shelf;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,3.4fr);gap:24px clamp(24px,3vw,40px);align-items:start;background:var(--card);box-shadow:var(--card-shadow,var(--shadow-md,${SHADOW_MD}))}
${R} .pb-shelf-note{margin-top:12px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--muted);text-wrap:pretty}
${R} .pb-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
${R} .pb-list>li{display:flex;min-width:0}
${R} .pb-ep{appearance:none;flex:1;min-width:0;display:flex;flex-direction:column;gap:8px;padding:20px;text-align:left;font:inherit;color:var(--ink);background:color-mix(in oklch,var(--ink) 4%,var(--card));border:1px solid oklch(from var(--ink) l c h / .08);border-radius:10px;cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background-color .16s ease,border-color .16s ease}
${R} .pb-ep:hover,${R} .pb-ep.is-hover{background:color-mix(in oklch,var(--ink) 7%,var(--card));border-color:oklch(from var(--ink) l c h / .16);transform:translateY(-2px);box-shadow:var(--shadow-md,${SHADOW_MD})}
${R} .pb-ep:active{transform:translateY(0) scale(.985);box-shadow:var(--shadow-sm,${SHADOW_SM})}
${R} .pb-ep:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .55);outline-offset:2px}
${R} .pb-ep[aria-current='true']{background:color-mix(in oklch,var(--accent) 10%,var(--card));border-color:oklch(from var(--accent) l c h / .55);box-shadow:var(--shadow-sm,${SHADOW_SM});cursor:default}
${R} .pb-ep[aria-current='true']:hover,${R} .pb-ep[aria-current='true']:active{transform:none;box-shadow:var(--shadow-sm,${SHADOW_SM})}
${R} .pb-ep-top{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:14px}
${R} .pb-ep-num{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:-0.03em;font-variant-numeric:tabular-nums}
${R} .pb-ep-time{display:inline-flex;align-items:center;gap:6px;font-size:.9375rem;font-weight:600;line-height:1.4;white-space:nowrap;color:color-mix(in oklch,var(--ink) 85%,var(--card))}
${R} .pb-ep-title{display:block;font-family:var(--font-display);font-weight:800;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.2;text-wrap:balance}
${R} .pb-ep-detail{display:block;font-size:.9375rem;font-weight:500;line-height:1.4;text-wrap:pretty;color:color-mix(in oklch,var(--ink) 85%,var(--card))}
${R} .pb-ep-status{display:flex;align-items:center;gap:8px;margin-top:auto;padding-top:8px;font-size:.9375rem;font-weight:700;line-height:1.3}
${R} .pb-ep[aria-current='true'] .pb-ep-status svg{color:var(--accent)}
${R} .pb-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
@keyframes cf-ps2-fade{from{opacity:0}to{opacity:1}}
@keyframes cf-ps2-rise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
${R} .pb-poster img.is-in{animation:cf-ps2-fade .28s cubic-bezier(.2,.7,.2,1) both}
${R} .pb-np-body.is-in{animation:cf-ps2-rise .28s cubic-bezier(.2,.7,.2,1) both}
@media (max-width:1100px){
${R} .pb-shelf{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:860px){
${R} .pb-grid{grid-template-columns:minmax(0,1fr);grid-template-areas:'cover' 'np' 'sub' 'shelf'}
${R} .pb-grid.is-solo{grid-template-areas:'cover' 'sub'}
${R} .pb-field{clip-path:polygon(0 0,100% 0,100% 16%,0 28%)}
${R} .pb-art{flex:none;min-height:0;aspect-ratio:1/1}
${R} .pb-poster{flex:none;min-height:0;aspect-ratio:16/10}
${R} .pb-shelf{overflow:hidden}
${R} .pb-list{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;margin:0 calc(-1 * clamp(20px,3vw,32px));padding:6px clamp(20px,3vw,32px) 8px;scroll-padding-inline:clamp(20px,3vw,32px);scrollbar-width:none}
${R} .pb-list::-webkit-scrollbar{display:none}
${R} .pb-list>li{flex:0 0 min(80%,300px);scroll-snap-align:start}
}
@media (max-width:480px){
${R} .pb-btn{padding:12px 16px}
}
@media (prefers-reduced-motion:reduce){
${R} .pb-poster img.is-in,${R} .pb-np-body.is-in{animation:none}
${R} .pb-ep,${R} .pb-play,${R} .pb-btn,${R} .pb-input{transition:none}
${R} .pb-ep:hover,${R} .pb-ep.is-hover,${R} .pb-ep:active,${R} .pb-play:hover,${R} .pb-play:active,${R} .pb-btn:active:not(:disabled),${R} .pb-btn.is-active{transform:none}
}
`;
pieces/content/podcast-subscribe-2/specimen.tsx 75 lines
import __studioImageb4aebdf0 from "../assets/dd1a3bdd1c947d82.webp";
import __studioImaged52a6fd0 from "../assets/2758d5fe5923b46b.webp";
import __studioImage16ed0860 from "../assets/f5cb7604718580bb.webp";
import * as React from 'react';
import defaults from '../../studio-defaults.json';
import { slot } from '../../slots';
import { PodcastSubscribe2, type PodcastShelfEpisode, type PodcastSubscribe2Props } from '../podcast-subscribe-2';
export const states = ['default', 'hover', 'active', 'disabled', 'error'];
export default function PodcastSubscribe2Specimen({ state = 'default' }: { state?: PodcastSubscribe2Props['state'] }) {
const episodes: PodcastShelfEpisode[] = [
{
number: '03',
title: 'The oven that cost more than our car',
runtime: '41 min',
detail: 'What a deck oven really costs, and why we bought it anyway.',
image: slot(
'item-1',
__studioImageb4aebdf0,
),
imageAlt: 'A baker pulls a tray of croissants from a glowing deck oven before dawn',
},
{
number: '07',
title: 'Opening day, and nobody came',
runtime: '36 min',
detail: 'The quiet first morning, and the one change we made by noon.',
image: slot(
'item-2',
__studioImaged52a6fd0,
),
imageAlt: 'An empty corner bakery on opening morning with one tray of loaves in the case',
},
{
number: '11',
title: 'We burned 400 croissants and kept going',
runtime: '44 min',
detail: 'The worst week of the season, told as it happened.',
},
];
return (
<PodcastSubscribe2
state={state}
showName='Built From Scratch'
season='Season two'
coverImage={slot(
'product',
__studioImage16ed0860,
)}
coverAlt='Two pairs of floury hands shaping a round loaf on a steel workbench'
headline='Hear two first-time bakers open a shop, one 4 a.m. shift at a time'
headlineHighlight='open a shop'
lines={[
'Season one, we quit our jobs and signed a lease on a corner shop.',
'Season two, we have to open the doors.',
'We kept the mics running through all of it.',
'Unedited.',
]}
cadence='New episodes every Thursday'
episodes={episodes}
platforms={[
{ label: 'Apple Podcasts', href: '#apple-podcasts' },
{ label: 'Spotify', href: '#spotify' },
{ label: 'YouTube Music', href: '#youtube-music' },
{ label: 'RSS feed', href: '#rss' },
]}
copy={{
shelfHeading: 'Start with the best of season two',
privacy: defaults.sample.registration.privacy,
}}
/>
);
}
| Name | Type | Details |
|---|---|---|
showName OptionalPodcastSubscribe2 |
string |
|
season OptionalPodcastSubscribe2 |
string |
|
coverImage OptionalPodcastSubscribe2 |
string |
|
coverAlt OptionalPodcastSubscribe2 |
string |
|
headline OptionalPodcastSubscribe2 |
string |
|
headlineHighlight OptionalPodcastSubscribe2 |
string |
|
lines OptionalPodcastSubscribe2 |
string[] |
|
cadence OptionalPodcastSubscribe2 |
string |
|
episodes OptionalPodcastSubscribe2 |
PodcastShelfEpisode[] |
|
defaultEpisode OptionalPodcastSubscribe2 |
number |
|
platforms OptionalPodcastSubscribe2 |
PodcastPlatformLink[] |
|
copy OptionalPodcastSubscribe2 |
Partial<PodcastSubscribe2Copy> |
|
onPlay OptionalPodcastSubscribe2 |
(episode: PodcastShelfEpisode, index: number) => void |
|
onEpisodeChange OptionalPodcastSubscribe2 |
(episode: PodcastShelfEpisode, index: number) => void |
|
onSubmit OptionalPodcastSubscribe2 |
(values: { email: string; episode?: string }) => void |
|
state OptionalPodcastSubscribe2 |
'default' | 'hover' | 'active' | 'disabled' | 'error' |
|
className OptionalPodcastSubscribe2 |
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- 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-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.
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.
product- The main product shot or cover (ebook, kit, bottle).
-
2758d5fe5923b46b.webp
image/webp · 99 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
dd1a3bdd1c947d82.webp
image/webp · 78.7 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB
-
f5cb7604718580bb.webp
image/webp · 223 KB