Reading mode: text versions of the front page's bands
- Stats: one line per number, no longer stuck at 0 (the count waited for the band to scroll into view, which the hidden page never does); reduced motion shows the numbers at once too. - Calendar: the next six weeks from today as a list (date, linked title, time, type, place), wherever a calendar is drawn. - Featured cards: a linked heading and its words each; a video card links to its video. - Countdown: left out, the retreats band shows the same event. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
502a294940
commit
c79910ef8d
5 changed files with 95 additions and 5 deletions
|
|
@ -23,6 +23,9 @@
|
|||
fall outside), 4px thick. 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.
|
||||
|
||||
Reading mode (readingMode.ts) gets each card as a linked heading
|
||||
and its words, a video card linking to its video.
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
|
||||
|
|
@ -31,6 +34,7 @@ import VideoPlayer from './VideoPlayer.tsx'
|
|||
import { refHref } from '../lib/hrefs.ts'
|
||||
import { mediaUrl } from '../lib/media.ts'
|
||||
import type { FeaturedCard } from '../lib/useFrontPage.ts'
|
||||
import { useReadingMode } from '../lib/readingMode.ts'
|
||||
import { useSmallImage } from '../lib/useSmallImage.ts'
|
||||
|
||||
/* Image kinds that are photographs, drawn edge to edge. Anything
|
||||
|
|
@ -131,7 +135,26 @@ function Card({ card, large }: { card: FeaturedCard; large: boolean }) {
|
|||
)
|
||||
}
|
||||
|
||||
function ReadingCards({ cards }: { cards: FeaturedCard[] }) {
|
||||
return (
|
||||
<>
|
||||
{cards.map((card, index) => {
|
||||
const href = card.kind === 'video' ? card.url : hrefFor(card)
|
||||
return (
|
||||
<div key={`${card.kind}-${card.ref?.id ?? card.url}-${index}`}>
|
||||
{card.eyebrow && <p>{card.eyebrow}</p>}
|
||||
{card.title && <h3>{href ? <HomeLink url={href}>{card.title}</HomeLink> : card.title}</h3>}
|
||||
{card.blurb && <p>{card.blurb}</p>}
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default function FeaturedCards({ cards }: { cards: FeaturedCard[] }) {
|
||||
const reading = useReadingMode()
|
||||
if (reading) return <ReadingCards cards={cards} />
|
||||
const leadLarge = cards.length >= 3
|
||||
return (
|
||||
<div className="overflow-hidden shadow-md">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue