Community Hero 1
Community hero: the circle's promise lit centre stage, ringed by member photos that drift on scroll and flip to a member's own note, with one join action.
Use it in a prompt
Use hero/community-hero 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/hero/community-hero.tsx. - Import it and pass your copy and images (Props tab):
import { CommunityHero } from "@/components/funneldna/hero/community-hero"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/community-hero/component.tsx 601 lines
// layout: product-stage
// Community hero: the circle's promise lit centre stage, ringed by member photos that drift on scroll and flip to a member's own note, with one join action.
import * as React from 'react';
import { motion, useReducedMotion, useScroll, useTransform, type MotionValue } from 'motion/react';
import { CalendarCheck, MessageSquareQuote, Quote, Users } from 'lucide-react';
import { BackdropVideo, FX_HOST } from '../fx/fx';
import dust from '../fx/loops/dust';
export type CommunityHeroMember = {
/** Member photo URL (image slots member-1 … member-n). */
image: string;
alt: string;
/** Shown with the quote, e.g. 'Dana R., Portland'. */
name?: string;
/** Short member note (about 70 characters). The photo flips to show it. Put quoted members first so they land on the large tiles. */
quote?: string;
/** Crop focal point (object-position), e.g. '50% 20%'. */
position?: string;
/** Zoom toward the focal point; 1 shows the whole photo. */
zoom?: number;
};
export type CommunityHeroWeek = {
/** Short day or cadence label, e.g. 'Mon'. Without it a calendar icon shows. */
when?: string;
text: string;
};
export type CommunityHeroProps = {
/** Wrap the key phrase in <em> to tint it. */
headline?: React.ReactNode;
/** The group's promise, one or two sentences. */
lead?: React.ReactNode;
/** What members do every week (three short lines read best, four at most). */
weekly?: CommunityHeroWeek[];
/** Accessible name for the weekly list. */
weeklyLabel?: string;
/** 6–9 member photos read best; none gives a type-led hero. */
members?: CommunityHeroMember[];
/** Shown only when supplied, e.g. '312'. */
memberCount?: string;
memberCountLabel?: string;
label?: string;
/** One short reassurance line under the button. */
note?: string;
href?: string;
onAction?: (event: React.MouseEvent<HTMLElement>) => void;
/** Accessible name of a flip photo; {name} is replaced with the member's name. */
quoteHint?: string;
/** Used for {name} when a member has no name. */
quoteHintFallback?: string;
/** Looping backdrop module from ../fx/loops; null for a flat band. */
backdropLoop?: typeof dust | null;
disabled?: boolean;
state?: 'default' | 'hover' | 'active' | 'disabled';
className?: string;
};
const DEFAULT_WEEK: CommunityHeroWeek[] = [
{ text: 'Share what you are working on' },
{ text: 'Get honest, kind feedback' },
{ text: 'Meet live and make together' },
];
const LEFT_DEPTH = [0.55, 1, 0.3, 0.8, 0.45];
const RIGHT_DEPTH = [0.85, 0.4, 1, 0.5, 0.7];
export function CommunityHero(props: CommunityHeroProps) {
const {
headline = (
<>
Find your people. <em>Make something every week.</em>
</>
),
lead = 'A small circle that makes, shares and shows up for each other, week after week.',
weekly = DEFAULT_WEEK,
weeklyLabel = 'What members do every week',
members = [],
memberCount,
memberCountLabel = 'members',
label = 'Join the circle',
note,
href,
onAction,
quoteHint = 'Read a note from {name}',
quoteHintFallback = 'a member',
backdropLoop = dust,
disabled,
state = 'default',
className,
} = props;
const ref = React.useRef<HTMLElement>(null);
const reduce = !!useReducedMotion();
const { scrollYProgress } = useScroll({ target: ref, offset: ['start end', 'end start'] });
const headingId = React.useId();
const photos = members.filter((m) => m && m.image).slice(0, 9);
const hasPhotos = photos.length > 0;
const left = photos.filter((_, i) => i % 2 === 0);
const right = photos.filter((_, i) => i % 2 === 1);
const strip = photos.slice(0, 6);
const quoted = photos.find((m) => m.quote);
const week = weekly.slice(0, 4);
const isDisabled = !!disabled || state === 'disabled';
const stateClass = state === 'hover' ? ' is-hover' : state === 'active' ? ' is-active' : '';
const joinClass = 'cf-ch__join' + stateClass;
const hintFor = (m: CommunityHeroMember) => quoteHint.replace('{name}', m.name || quoteHintFallback);
const join =
href && !isDisabled ? (
<a className={joinClass} href={href} onClick={onAction}>
{label}
</a>
) : (
<button type='button' className={joinClass} disabled={isDisabled} onClick={onAction}>
{label}
</button>
);
return (
<section
ref={ref}
className={'cf-community-hero' + (className ? ' ' + className : '')}
style={FX_HOST}
aria-labelledby={headingId}
>
{backdropLoop ? <BackdropVideo video={backdropLoop} treatment='scrim-dark' control='bottom-right' /> : null}
<div className={'cf-ch__stage ' + (hasPhotos ? 'has-photos' : 'is-type')}>
{hasPhotos ? (
<div
className='cf-ch__strip'
style={{ '--cols-sm': Math.min(strip.length, 3), '--cols-md': Math.min(strip.length, 6) } as React.CSSProperties}
>
{strip.map((m, i) => (
<span key={'s' + i} className='cf-ch__cell cf-ch__rise' style={{ '--i': i } as React.CSSProperties}>
<Photo member={m} />
</span>
))}
</div>
) : null}
{hasPhotos ? (
<div className='cf-ch__side is-left'>
{left.map((m, i) => (
<Tile
key={'l' + i}
member={m}
slotIndex={i}
order={i * 2}
depth={LEFT_DEPTH[i] ?? 0.5}
progress={scrollYProgress}
reduce={reduce}
hint={hintFor(m)}
/>
))}
</div>
) : null}
<div className='cf-ch__core'>
<h1 id={headingId} className='cf-ch__h1 cf-ch__rise' style={{ '--i': 0 } as React.CSSProperties}>
{headline}
</h1>
{lead ? (
<p className='cf-ch__lead cf-ch__rise' style={{ '--i': 1 } as React.CSSProperties}>
{lead}
</p>
) : null}
{week.length ? (
<ul
className='cf-ch__week cf-ch__rise'
aria-label={weeklyLabel}
style={{ '--i': 2, '--days': week.length } as React.CSSProperties}
>
{week.map((w, i) => (
<li key={'w' + i} className='cf-ch__day'>
{w.when ? (
<span className='cf-ch__when'>{w.when}</span>
) : (
<CalendarCheck className='cf-ch__inline cf-ch__when-ico' size={18} strokeWidth={2.5} aria-hidden='true' />
)}
<span className='cf-ch__do'>{w.text}</span>
</li>
))}
</ul>
) : null}
<div className='cf-ch__action cf-ch__rise' style={{ '--i': 3 } as React.CSSProperties}>
{join}
{note ? <p className='cf-ch__note'>{note}</p> : null}
{memberCount ? (
<p className='cf-ch__count'>
<Users className='cf-ch__inline' size={18} strokeWidth={2.5} aria-hidden='true' />
<strong>{memberCount}</strong> {memberCountLabel}
</p>
) : null}
</div>
{quoted ? (
<figure className='cf-ch__phone-quote cf-ch__rise' style={{ '--i': 4 } as React.CSSProperties}>
<span className='cf-ch__avatar'>
<Photo member={quoted} alt='' />
</span>
<div className='cf-ch__pq-body'>
<blockquote className='cf-ch__pq'>
<p>{quoted.quote}</p>
</blockquote>
{quoted.name ? <figcaption className='cf-ch__pq-who'>{quoted.name}</figcaption> : null}
</div>
</figure>
) : null}
</div>
{hasPhotos ? (
<div className='cf-ch__side is-right'>
{right.map((m, i) => (
<Tile
key={'r' + i}
member={m}
slotIndex={i}
order={i * 2 + 1}
depth={RIGHT_DEPTH[i] ?? 0.5}
progress={scrollYProgress}
reduce={reduce}
hint={hintFor(m)}
/>
))}
</div>
) : null}
</div>
<style>{CSS}</style>
</section>
);
}
export default CommunityHero;
function Photo({ member, alt }: { member: CommunityHeroMember; alt?: string }) {
const pos = member.position || '50% 35%';
const zoom = member.zoom && member.zoom > 1 ? member.zoom : undefined;
return (
<img
className='cf-ch__img'
src={member.image}
alt={alt ?? member.alt}
decoding='async'
style={{
objectPosition: pos,
transform: zoom ? `scale(${zoom})` : undefined,
transformOrigin: zoom ? pos : undefined,
}}
/>
);
}
function Tile({
member,
slotIndex,
order,
depth,
progress,
reduce,
hint,
}: {
member: CommunityHeroMember;
slotIndex: number;
order: number;
depth: number;
progress: MotionValue<number>;
reduce: boolean;
hint: string;
}) {
const y = useTransform(progress, [0, 1], [depth * 56, depth * -56]);
const [open, setOpen] = React.useState(false);
const quoteId = React.useId();
const rise = { '--i': order } as React.CSSProperties;
return (
<motion.div className={'cf-ch__drift cf-ch__p' + slotIndex} style={reduce ? undefined : { y }}>
{member.quote ? (
<button
type='button'
className='cf-ch__tile has-quote cf-ch__rise'
style={rise}
aria-pressed={open}
aria-label={hint}
aria-describedby={quoteId}
onClick={() => setOpen((v) => !v)}
>
<span className='cf-ch__flip'>
<span className='cf-ch__face cf-ch__front'>
<Photo member={member} />
<span className='cf-ch__hint' aria-hidden='true'>
<MessageSquareQuote size={16} strokeWidth={2.5} />
</span>
</span>
<span className='cf-ch__face cf-ch__back' id={quoteId}>
<Quote className='cf-ch__qmark' size={20} strokeWidth={2.5} aria-hidden='true' />
<span className='cf-ch__q'>{member.quote}</span>
{member.name ? <span className='cf-ch__who'>{member.name}</span> : null}
</span>
</span>
</button>
) : (
<span className='cf-ch__tile cf-ch__rise' style={rise}>
<span className='cf-ch__flip'>
<span className='cf-ch__face cf-ch__front'>
<Photo member={member} />
</span>
</span>
</span>
)}
</motion.div>
);
}
const CSS = `
.cf-community-hero{
--ch-tint: color-mix(in oklab, var(--band-ink) 72%, var(--accent-fill, var(--accent)));
--ch-soft: color-mix(in oklab, var(--band-ink) 84%, var(--band));
--ch-line: oklch(from var(--band-ink) l c h / .16);
--ch-well: oklch(from var(--band-ink) l c h / .08);
position: relative;
overflow: clip;
background: var(--band);
color: var(--band-ink);
font-family: var(--font-body);
padding: clamp(56px, 8vw, 112px) clamp(16px, 5vw, 48px) clamp(64px, 8.5vw, 120px);
}
.cf-community-hero .cf-ch__stage{ position: relative; z-index: 1; max-width: 1320px; margin: 0 auto; }
.cf-community-hero .cf-ch__side{ display: none; }
.cf-community-hero .cf-ch__core{ max-width: 40rem; margin: 0 auto; text-align: center; }
.cf-community-hero .cf-ch__stage.is-type .cf-ch__core{ max-width: 46rem; }
.cf-community-hero .cf-ch__h1{
margin: 0 0 clamp(20px, 2.5vw, 36px);
font-family: var(--font-display);
font-size: clamp(2.5rem, 5.4vw, 4.875rem);
line-height: 1.04;
font-weight: var(--display-weight, 800);
letter-spacing: var(--display-tracking, -0.025em);
text-transform: var(--display-case, none);
color: var(--band-ink);
text-wrap: balance;
}
.cf-community-hero .cf-ch__h1 em{ font-style: normal; color: var(--ch-tint); }
.cf-community-hero .cf-ch__lead{
margin: 0 auto 32px;
max-width: 36rem;
font-size: clamp(1.125rem, 1.5vw, 1.375rem);
line-height: 1.4;
font-weight: 500;
color: var(--ch-soft);
text-wrap: pretty;
}
.cf-community-hero .cf-ch__week{
list-style: none;
margin: 0 auto clamp(32px, 3.4vw, 48px);
padding: 4px 8px;
max-width: 40rem;
display: grid;
border-radius: var(--card-radius, var(--radius, 14px));
background: var(--ch-well);
border: 1px solid var(--ch-line);
}
.cf-community-hero .cf-ch__day{ padding: 12px 8px; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.35; text-wrap: pretty; }
.cf-community-hero .cf-ch__day + .cf-ch__day{ border-top: 1px solid var(--ch-line); }
.cf-community-hero .cf-ch__when{
display: inline-block;
margin-inline-end: .5em;
font-size: .875rem;
line-height: 1.2;
font-weight: 800;
letter-spacing: .08em;
text-transform: uppercase;
color: var(--ch-tint);
}
.cf-community-hero .cf-ch__inline{ display: inline-block; vertical-align: -0.15em; margin-inline-end: .4em; }
.cf-community-hero .cf-ch__when-ico{ color: var(--ch-tint); }
.cf-community-hero .cf-ch__do{ color: var(--band-ink); font-weight: 600; }
.cf-community-hero .cf-ch__action{ display: flex; flex-direction: column; align-items: center; }
.cf-community-hero .cf-ch__join{
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
box-sizing: border-box;
width: auto;
min-width: min(100%, 26rem);
max-width: 100%;
min-height: 72px;
margin: 0 auto;
padding: 12px 32px;
border: 0;
border-radius: var(--button-radius, var(--radius, 12px));
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));
color: var(--button-ink, var(--cta-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.125rem, 1.55vw, 1.375rem);
line-height: 1.15;
text-align: center;
text-decoration: none;
text-wrap: balance;
text-shadow: var(--button-text-shadow, none);
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(.22 .03 260)) l c h / .4),
0 8px 16px -6px oklch(from var(--shadow, oklch(.22 .03 260)) l c h / .5));
cursor: pointer;
transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.cf-community-hero .cf-ch__join:hover:not(:disabled),
.cf-community-hero .cf-ch__join.is-hover:not(:disabled){
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));
transform: translateY(-1px);
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(.22 .03 260)) l c h / .45),
0 12px 20px -8px oklch(from var(--shadow, oklch(.22 .03 260)) l c h / .6));
}
.cf-community-hero .cf-ch__join:active:not(:disabled),
.cf-community-hero .cf-ch__join.is-active:not(:disabled){
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 - .09) c h));
transform: translateY(1px);
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 - .16) c h),
0 1px 2px oklch(from var(--shadow, oklch(.22 .03 260)) l c h / .35);
}
.cf-community-hero .cf-ch__join:focus-visible{ outline: 3px solid var(--band-ink); outline-offset: 4px; }
.cf-community-hero .cf-ch__join:disabled{
background: var(--button-2-bg, var(--secondary));
color: var(--button-2-ink, var(--secondary-ink));
box-shadow: var(--button-2-shadow, var(--shadow-sm));
text-shadow: none;
cursor: not-allowed;
}
.cf-community-hero .cf-ch__note{ margin: 12px 0 0; font-size: .9375rem; line-height: 1.4; font-weight: 500; color: var(--ch-soft); text-wrap: pretty; }
.cf-community-hero .cf-ch__count{ margin: 16px 0 0; font-size: .9375rem; line-height: 1.4; font-weight: 500; color: var(--ch-soft); text-wrap: pretty; }
.cf-community-hero .cf-ch__count strong{ color: var(--band-ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.cf-community-hero .cf-ch__count .cf-ch__inline{ color: var(--ch-tint); }
.cf-community-hero .cf-ch__img{ display: block; width: 100%; height: 100%; object-fit: cover; }
.cf-community-hero .cf-ch__strip{
display: grid;
grid-template-columns: repeat(var(--cols-sm, 3), minmax(0, 1fr));
gap: 8px;
max-width: 40rem;
margin: 0 auto 32px;
}
.cf-community-hero .cf-ch__cell{ display: block; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: var(--ch-well); }
@media (max-width: 640px){
.cf-community-hero .cf-ch__cell:nth-child(3n+2){ margin-top: 16px; }
.cf-community-hero .cf-ch__strip{ margin-bottom: 24px; }
.cf-community-hero .cf-ch__join{ width: 100%; min-width: 0; padding: 12px 24px; }
}
@media (min-width: 641px){
.cf-community-hero .cf-ch__strip{ grid-template-columns: repeat(var(--cols-md, 6), minmax(0, 1fr)); gap: 12px; max-width: 1120px; margin-bottom: 48px; }
.cf-community-hero .cf-ch__cell:nth-child(even){ margin-top: 24px; }
.cf-community-hero .cf-ch__week{ grid-template-columns: repeat(var(--days, 3), minmax(0, 1fr)); padding: 8px; }
.cf-community-hero .cf-ch__day{ padding: 12px 16px; }
.cf-community-hero .cf-ch__day + .cf-ch__day{ border-top: 0; border-left: 1px solid var(--ch-line); }
.cf-community-hero .cf-ch__when{ display: block; margin: 0 0 4px; }
.cf-community-hero .cf-ch__when-ico{ display: block; margin: 0 auto 4px; }
}
.cf-community-hero .cf-ch__phone-quote{
display: flex;
gap: 12px;
align-items: flex-start;
max-width: 26rem;
margin: 32px auto 0;
padding: 16px;
border-radius: var(--card-radius, var(--radius, 14px));
background: var(--ch-well);
text-align: left;
}
.cf-community-hero .cf-ch__avatar{ flex: none; display: block; width: 44px; height: 44px; border-radius: 999px; overflow: hidden; background: var(--ch-well); }
.cf-community-hero .cf-ch__pq{ margin: 0; }
.cf-community-hero .cf-ch__pq p{ margin: 0; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.4; font-weight: 600; color: var(--band-ink); text-wrap: pretty; }
.cf-community-hero .cf-ch__pq-who{ margin-top: 4px; font-size: .9375rem; line-height: 1.4; font-weight: 500; color: var(--ch-soft); }
.cf-community-hero .cf-ch__drift{ display: block; min-width: 0; }
.cf-community-hero .cf-ch__tile{
display: block;
width: 100%;
margin: 0;
padding: 0;
border: 0;
background: none;
color: inherit;
font: inherit;
text-align: left;
border-radius: 12px;
perspective: 1000px;
-webkit-tap-highlight-color: transparent;
}
.cf-community-hero .cf-ch__tile.has-quote{ cursor: pointer; }
.cf-community-hero .cf-ch__tile:focus-visible{ outline: 3px solid var(--band-ink); outline-offset: 4px; }
.cf-community-hero .cf-ch__flip{ position: relative; display: block; aspect-ratio: 4 / 5; border-radius: 12px; transform-style: preserve-3d; }
.cf-community-hero .cf-ch__p2 .cf-ch__flip,
.cf-community-hero .cf-ch__p4 .cf-ch__flip{ aspect-ratio: 1 / 1; }
.cf-community-hero .cf-ch__face{
position: absolute;
inset: 0;
border-radius: 12px;
overflow: hidden;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
.cf-community-hero .cf-ch__front{ background: var(--ch-well); }
.cf-community-hero .cf-ch__hint{
position: absolute;
right: 12px;
bottom: 12px;
display: grid;
place-items: center;
width: 32px;
height: 32px;
border-radius: 999px;
background: var(--card);
color: var(--ink);
box-shadow: var(--shadow-sm, 0 1px 2px oklch(from var(--shadow, oklch(.22 .03 260)) l c h / .3));
transition: transform .16s ease;
}
.cf-community-hero .cf-ch__tile.has-quote:hover .cf-ch__hint{ transform: scale(1.06); }
.cf-community-hero .cf-ch__back{
display: flex;
flex-direction: column;
justify-content: center;
gap: 12px;
padding: clamp(16px, 1.6vw, 24px);
background: var(--card);
color: var(--ink);
border: 1px solid var(--card-border, oklch(from var(--ink) l c h / .12));
transform: rotateY(180deg);
}
.cf-community-hero .cf-ch__qmark{ color: var(--accent); flex: none; }
.cf-community-hero .cf-ch__q{ display: block; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.35; font-weight: 600; color: var(--ink); text-wrap: pretty; }
.cf-community-hero .cf-ch__who{ display: block; font-size: .9375rem; line-height: 1.4; font-weight: 500; color: var(--muted); }
@media (min-width: 1200px){
.cf-community-hero .cf-ch__stage.has-photos{
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 36rem) minmax(0, 1fr);
column-gap: 48px;
align-items: start;
}
.cf-community-hero .cf-ch__stage.has-photos .cf-ch__strip,
.cf-community-hero .cf-ch__stage.has-photos .cf-ch__phone-quote{ display: none; }
.cf-community-hero .cf-ch__stage.has-photos .cf-ch__core{ max-width: none; margin: 0; padding-top: 32px; }
.cf-community-hero .cf-ch__stage.has-photos .cf-ch__side{
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
grid-auto-flow: row dense;
gap: 16px;
align-content: start;
}
.cf-community-hero .cf-ch__side.is-right{ padding-top: 64px; }
.cf-community-hero .cf-ch__p0{ grid-column: 1 / -1; width: 76%; justify-self: start; }
.cf-community-hero .cf-ch__p1{ grid-column: 1; width: 100%; justify-self: end; }
.cf-community-hero .cf-ch__p2{ grid-column: 2; width: 84%; justify-self: start; margin-top: 48px; }
.cf-community-hero .cf-ch__p3{ grid-column: 1; width: 88%; justify-self: end; }
.cf-community-hero .cf-ch__p4{ grid-column: 2; width: 100%; justify-self: start; margin-top: 24px; }
.cf-community-hero .is-right .cf-ch__p0{ justify-self: end; }
.cf-community-hero .is-right .cf-ch__p1{ grid-column: 2; justify-self: start; }
.cf-community-hero .is-right .cf-ch__p2{ grid-column: 1; justify-self: end; }
.cf-community-hero .is-right .cf-ch__p3{ grid-column: 2; justify-self: start; }
.cf-community-hero .is-right .cf-ch__p4{ grid-column: 1; justify-self: end; }
}
@keyframes cf-ch-rise{ from{ opacity: .82; transform: translateY(8px); } to{ opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference){
.cf-community-hero .cf-ch__rise{
animation: cf-ch-rise .45s cubic-bezier(.2, .7, .2, 1) both;
animation-delay: min(calc(var(--i, 0) * .07s), .28s);
}
.cf-community-hero .cf-ch__flip{ transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.cf-community-hero .cf-ch__tile[aria-pressed='true'] .cf-ch__flip{ transform: rotateY(180deg); }
@media (hover: hover){
.cf-community-hero .cf-ch__tile.has-quote:hover .cf-ch__flip{ transform: rotateY(180deg); }
}
}
@media (prefers-reduced-motion: reduce){
.cf-community-hero .cf-ch__back{ transform: none; opacity: 0; }
.cf-community-hero .cf-ch__tile[aria-pressed='true'] .cf-ch__back{ opacity: 1; }
@media (hover: hover){
.cf-community-hero .cf-ch__tile.has-quote:hover .cf-ch__back{ opacity: 1; }
}
.cf-community-hero .cf-ch__join,
.cf-community-hero .cf-ch__hint{ transition: none; }
.cf-community-hero .cf-ch__join:hover:not(:disabled),
.cf-community-hero .cf-ch__join.is-hover:not(:disabled),
.cf-community-hero .cf-ch__join:active:not(:disabled),
.cf-community-hero .cf-ch__join.is-active:not(:disabled){ transform: none; }
}
`;
pieces/hero/community-hero/specimen.tsx 47 lines
import __studioImagea65792c2 from "../assets/b268b15f45722d29.webp";
import __studioImagead006623 from "../assets/1f83c1380754bfa9.webp";
import __studioImaged52cc542 from "../assets/1d5385a1b61d732c.webp";
import { CommunityHero, type CommunityHeroMember, type CommunityHeroProps } from '../community-hero';
import { slot } from '../../slots';
const wheelPhoto = __studioImagea65792c2;
const glazePhoto = __studioImagead006623;
const kilnPhoto = __studioImaged52cc542;
export const states = ['default', 'hover', 'active', 'disabled'];
export default function CommunityHeroSpecimen({ state = 'default' }: { state?: CommunityHeroProps['state'] }) {
const crops: (Omit<CommunityHeroMember, 'image'> & { src: string })[] = [
{ src: wheelPhoto, alt: 'Dana smiling at her pottery wheel', name: 'Dana R., Portland', quote: 'I come for the wheel. I stay for Thursday nights.', position: '50% 16%', zoom: 1.5 },
{ src: glazePhoto, alt: 'Theo glazing a mug at his workbench', name: 'Theo M., Leeds', quote: 'My first cylinder that didn’t slump. Twelve people cheered.', position: '45% 18%', zoom: 1.45 },
{ src: wheelPhoto, alt: 'Clay-covered hands centring a bowl on the wheel', position: '50% 82%', zoom: 1.7 },
{ src: glazePhoto, alt: 'A speckled mug being dipped in glaze', position: '55% 80%', zoom: 1.8 },
{ src: kilnPhoto, alt: 'Two members laughing as they unload the kiln', position: '50% 28%', zoom: 1.15 },
{ src: kilnPhoto, alt: 'Freshly fired mugs and bowls on the kiln shelf', position: '50% 84%', zoom: 1.7 },
];
const members: CommunityHeroMember[] = crops.map(({ src, ...rest }, i) => ({ ...rest, image: slot(`member-${i + 1}`, src) }));
return (
<CommunityHero
state={state}
headline={
<>
Your wheel. Our circle. <em>Every single week.</em>
</>
}
lead='Kiln & Co. is a circle of home potters who keep each other making: one weekly prompt, friendly critique and a live studio night with your wheel on.'
weekly={[
{ when: 'Mon', text: 'Get the week’s throwing prompt' },
{ when: 'Wed', text: 'Post your pot for friendly critique' },
{ when: 'Thu', text: 'Throw live at studio night' },
]}
weeklyLabel='What Kiln & Co. members do every week'
members={members}
memberCount='312'
memberCountLabel='potters in the circle'
label='Start throwing with the circle'
note='Free for 14 days · Leave anytime'
href='#join'
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalCommunityHero |
React.ReactNode |
|
lead OptionalCommunityHero |
React.ReactNode |
|
weekly OptionalCommunityHero |
CommunityHeroWeek[] |
|
weeklyLabel OptionalCommunityHero |
string |
|
members OptionalCommunityHero |
CommunityHeroMember[] |
|
memberCount OptionalCommunityHero |
string |
|
memberCountLabel OptionalCommunityHero |
string |
|
label OptionalCommunityHero |
string |
|
note OptionalCommunityHero |
string |
|
href OptionalCommunityHero |
string |
|
onAction OptionalCommunityHero |
(event: React.MouseEvent<HTMLElement>) => void |
|
quoteHint OptionalCommunityHero |
string |
|
quoteHintFallback OptionalCommunityHero |
string |
|
backdropLoop OptionalCommunityHero |
typeof dust | null |
|
disabled OptionalCommunityHero |
boolean |
|
state OptionalCommunityHero |
'default' | 'hover' | 'active' | 'disabled' |
|
className OptionalCommunityHero |
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- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
member-*- An image this piece places.
-
1d5385a1b61d732c.webp
image/webp · 66.4 KB
-
1f83c1380754bfa9.webp
image/webp · 53.5 KB
- 29ef5dd0aa81d9d1.mp4 video/mp4 · 84 KB
- 46bc23060d7f0510.webm video/webm · 32.1 KB
-
b268b15f45722d29.webp
image/webp · 51.8 KB
-
f5e176ebf0632936.webp
image/webp · 9.96 KB