Present: the whole event page, in sections at its headings

The presentation (now EventPresent) cuts the event's page into
sections at its Heading blocks: a section's text on one slide, then
its schedules' slides, a map block's map and each location lit up,
and an events block's grid and each event. One Present button on the
event page replaces the schedule's. Setup lists the sections, each
schedule's days and entries under its own; the address keys are now
skip and hide, numbered by schedule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-11-09 03:41:21 -06:00
parent 818d648e91
commit df8052c75e
9 changed files with 635 additions and 260 deletions

View file

@ -52,7 +52,7 @@
import { mediaUrl } from '../lib/media.ts'
import PeopleTiles from './PeopleTiles.tsx'
import type { ContentBlock, ContentBlockItem } from '../lib/useContent.ts'
import type { ContentBlock, ContentBlockItem, ItemEvent } from '../lib/useContent.ts'
import { Anchor, Inline, Paragraphs, isExternalUrl } from './InlineText.tsx'
import VideoPlayer from './VideoPlayer.tsx'
import ScheduleBlock from './ScheduleBlock.tsx'
@ -72,7 +72,6 @@ export default function ContentBlocks({
blocks,
accent = BRAND,
className = '',
presentAt,
anchorPrefix = '',
}: {
blocks?: ContentBlock[] | null
@ -80,9 +79,6 @@ export default function ContentBlocks({
className?: string
/** Put before each heading's id: a blog post's tab (contents.ts, splitTabs). */
anchorPrefix?: string
/** An event page's presentation route: each schedule gets a Present
* button to it, `?block=<n>` naming which schedule (from 0). */
presentAt?: string
}) {
if (!blocks?.length) return null
// Headings get ids so a post's contents (PostContents) and a shared
@ -98,10 +94,6 @@ export default function ContentBlocks({
return level
})
let schedules = 0
const presentHrefs = blocks.map((block) =>
presentAt && block.type === 'schedule' ? `${presentAt}?block=${schedules++}` : undefined,
)
// The venues mapped here, for a schedule's places to link to.
const maps = new Set(blocks.flatMap((block) => (block.type === 'map' && block.venue ? [block.venue.id] : [])))
@ -116,7 +108,6 @@ export default function ContentBlocks({
accent={accent}
anchor={idAt.get(index)}
level={levels[index]}
presentHref={presentHrefs[index]}
/>
</WordMotion>
))}
@ -161,12 +152,19 @@ function LinkCard({ item }: { item: ContentBlockItem }) {
/* One event card (088): the event's picture, its type and date,
its title (or the item's text) and card text (or the item's
detail); the whole card links to the event. */
/* An event's type and date, eg. workshop · June 14, 2025 (shown
capitalized), or null with neither. */
export function eventLine(event: ItemEvent): string | null {
const when = event.date_label || (event.starts_on ? occurrenceLabel(event.starts_on) : null)
const kind = event.event_type && event.event_type !== 'other' ? event.event_type : null
return [kind, when].filter(Boolean).join(' · ') || null
}
function EventCard({ item, accent }: { item: ContentBlockItem; accent: string }) {
const event = item.event!
const img = useSmallImage(mediaUrl(event.image))
const color = event.color || accent
const when = event.date_label || (event.starts_on ? occurrenceLabel(event.starts_on) : null)
const kind = event.event_type && event.event_type !== 'other' ? event.event_type : null
const line = eventLine(event)
return (
<Anchor
href={eventHref(event.id)}
@ -176,9 +174,9 @@ function EventCard({ item, accent }: { item: ContentBlockItem; accent: string })
<img src={img.src} alt="" loading="lazy" onError={img.onError} className="aspect-video w-full object-cover" />
)}
<span className="flex flex-1 flex-col gap-1 p-4">
{(kind || when) && (
{line && (
<span className="text-xs font-semibold capitalize" style={{ color: accentText(color) }}>
{[kind, when].filter(Boolean).join(' · ')}
{line}
</span>
)}
<span className="font-display text-base font-bold leading-snug text-ink group-hover:text-link">
@ -223,13 +221,11 @@ function Block({
accent,
anchor,
level,
presentHref,
}: {
block: ContentBlock
accent: string
anchor?: string
level: 3 | 4 | 5
presentHref?: string
}) {
const text = block.text ?? ''
const reading = useReadingMode()
@ -439,7 +435,6 @@ function Block({
tags={block.tags}
intro={block.text}
accent={accent}
presentHref={presentHref}
/>
)