Featured cards and the connect section as one ruled block; Give beside the footer logo
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
6fc19d7ee3
commit
5dbb203519
3 changed files with 109 additions and 93 deletions
|
|
@ -16,6 +16,13 @@
|
|||
|
||||
A photo fills the picture area; a logo sits inside it on a soft
|
||||
panel instead, since cropping a logo to 16:9 cuts it off.
|
||||
|
||||
The grid is one continuous block: no gaps and no frame, only a
|
||||
colored rule between cards (each card's right and bottom border,
|
||||
with the grid pulled past its clipping wrapper so the outer ones
|
||||
fall outside). With three or more cards the first is the large
|
||||
one, two rows tall, and the next two stack beside it, so it no
|
||||
longer stretches its neighbor.
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
|
||||
|
|
@ -71,16 +78,18 @@ function VideoPicture({ card }: { card: FeaturedCard }) {
|
|||
return <VideoPlayer url={card.url} still={own} title={card.title} />
|
||||
}
|
||||
|
||||
function Card({ card }: { card: FeaturedCard }) {
|
||||
const RULE = 'border-brand'
|
||||
|
||||
function Card({ card, large }: { card: FeaturedCard; large: boolean }) {
|
||||
const href = hrefFor(card)
|
||||
|
||||
const text = (
|
||||
<div className="flex flex-1 flex-col p-6">
|
||||
<div className={`flex flex-1 flex-col ${large ? 'p-8 md:p-10' : 'p-7'}`}>
|
||||
{card.eyebrow && (
|
||||
<p className="text-sm font-semibold text-link">{card.eyebrow}</p>
|
||||
)}
|
||||
{card.title && (
|
||||
<h3 className="mt-2 font-display text-xl font-bold leading-snug text-ink">
|
||||
<h3 className={`mt-2 font-display font-bold leading-snug text-ink ${large ? 'text-2xl md:text-3xl' : 'text-lg'}`}>
|
||||
{href ? (
|
||||
// Stretched over the whole card, so the picture and the
|
||||
// blurb are part of the click without nesting links.
|
||||
|
|
@ -95,12 +104,18 @@ function Card({ card }: { card: FeaturedCard }) {
|
|||
)}
|
||||
</h3>
|
||||
)}
|
||||
{card.blurb && <p className="mt-2 leading-relaxed text-muted">{card.blurb}</p>}
|
||||
{card.blurb && (
|
||||
<p className={`mt-2 leading-relaxed text-muted ${large ? '' : 'line-clamp-3 text-sm'}`}>{card.blurb}</p>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
|
||||
return (
|
||||
<li className="relative flex flex-col overflow-hidden border border-brand/15 bg-surface shadow-sm transition-shadow hover:shadow-lg">
|
||||
<li
|
||||
className={`relative flex flex-col overflow-hidden border-r-2 border-b-2 ${RULE} bg-surface transition-colors hover:bg-tint-soft ${
|
||||
large ? 'lg:col-span-2 lg:row-span-2' : ''
|
||||
}`}
|
||||
>
|
||||
{card.kind === 'video' ? (
|
||||
// Above the stretched link, which a video card doesn't have
|
||||
// anyway, so the play button always gets the click.
|
||||
|
|
@ -116,11 +131,18 @@ function Card({ card }: { card: FeaturedCard }) {
|
|||
}
|
||||
|
||||
export default function FeaturedCards({ cards }: { cards: FeaturedCard[] }) {
|
||||
const leadLarge = cards.length >= 3
|
||||
return (
|
||||
<ul className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3 lg:[&>li:first-child]:col-span-2">
|
||||
{cards.map((card, index) => (
|
||||
<Card key={`${card.kind}-${card.ref?.id ?? card.url}-${index}`} card={card} />
|
||||
))}
|
||||
</ul>
|
||||
<div className="overflow-hidden">
|
||||
<ul className="-mr-[2px] -mb-[2px] grid sm:grid-cols-2 lg:grid-cols-3">
|
||||
{cards.map((card, index) => (
|
||||
<Card
|
||||
key={`${card.kind}-${card.ref?.id ?? card.url}-${index}`}
|
||||
card={card}
|
||||
large={leadLarge && index === 0}
|
||||
/>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue