Present: list slides, centered people
- A list block's Overview slide and A slide per item (098): its items' text on one slide, and each item with its detail, centered - Setup ticks a list's overview and items on and off; List overview and List items seconds - A presented people row is centered Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
584340b0ee
commit
2282bee23c
7 changed files with 152 additions and 8 deletions
|
|
@ -16,6 +16,13 @@
|
|||
cards each events block (088): its events on one slide
|
||||
event then each event alone: picture, title, its person
|
||||
host and its own page's blocks (else its card text)
|
||||
list a list block with an Overview slide (098): its
|
||||
items' text, centered
|
||||
item then, with A slide per item, each item: its text
|
||||
the heading, its detail under it, centered
|
||||
A list without either is part of its section's text. The setup
|
||||
ticks a list's overview (`hide` l<section>.<block>) and its items
|
||||
(l<section>.<block>.<item>) on and off.
|
||||
|
||||
A schedule's slides, for each day picked, in order:
|
||||
overview the day's picked entries on one slide
|
||||
|
|
@ -81,7 +88,7 @@ import {
|
|||
} from '../components/ScheduleBlock.tsx'
|
||||
import ContentBlocks, { eventLine } from '../components/ContentBlocks.tsx'
|
||||
import { LocationNumber, MapPicture, isMarked, locationNumber } from '../components/MapBlock.tsx'
|
||||
import { Paragraphs } from '../components/InlineText.tsx'
|
||||
import { Inline, Paragraphs } from '../components/InlineText.tsx'
|
||||
import { Presenting } from '../lib/presenting.ts'
|
||||
import {
|
||||
useEvent,
|
||||
|
|
@ -111,6 +118,8 @@ const KINDS = [
|
|||
{ key: 'place', label: 'Map locations', help: 'The map again for each location, it lit up', seconds: 8 },
|
||||
{ key: 'cards', label: 'Event lists', help: "An events block's events on one slide", seconds: 15 },
|
||||
{ key: 'event', label: 'Event spotlight', help: 'Each event of an events block alone', seconds: 12 },
|
||||
{ key: 'list', label: 'List overview', help: "A list block's items on one slide, without their detail", seconds: 12 },
|
||||
{ key: 'item', label: 'List items', help: 'Each list item alone, its detail under it', seconds: 10 },
|
||||
] as const
|
||||
type Kind = (typeof KINDS)[number]['key']
|
||||
|
||||
|
|
@ -121,6 +130,14 @@ const OWN_SLIDES = new Map([
|
|||
['map', 'Map'],
|
||||
['events', 'Events'],
|
||||
])
|
||||
/* What the setup calls a block with slides of its own (a list with
|
||||
an Overview slide or A slide per item, 098), else null. */
|
||||
const ownSlides = (block: ContentBlock): string | null =>
|
||||
OWN_SLIDES.get(block.type) ??
|
||||
(block.type === 'list' && (block.present?.list_overview || block.present?.list_items) ? 'List' : null)
|
||||
/* A list's overview's key in `hide`, and an item's (`i`). */
|
||||
const listKey = (s: number, b: number, i?: number) => `l${s}.${b}${i == null ? '' : `.${i}`}`
|
||||
|
||||
/* Blocks that start a section. */
|
||||
const STARTS_SECTION = new Set(['heading', 'tab'])
|
||||
/* Text that alone makes no section slide: the heading titles what
|
||||
|
|
@ -311,15 +328,16 @@ function mapSlides(slides: Slide[], block: ContentBlock, at: string, label: stri
|
|||
/* Each slide's id says where it comes from, so a saved order still
|
||||
finds it: t<section> a section's text; v and p a map and its
|
||||
locations, c and e an events list and its events, by
|
||||
<section>.<block>; o, k, s, g and m a schedule's overview, block,
|
||||
spotlight, graphic and map image, and x its tag slides, by key(). */
|
||||
<section>.<block>; l and i a list's overview and items (listKey);
|
||||
o, k, s, g and m a schedule's overview, block, spotlight, graphic
|
||||
and map image, and x its tag slides, by key(). */
|
||||
function buildSlides(sections: Section[], schedules: Map<ContentBlock, Schedule>, picks: Picks): Slide[] {
|
||||
const { skipped, seconds } = picks
|
||||
const { skipped, seconds, hidden } = picks
|
||||
const slides: Slide[] = []
|
||||
sections.forEach((section, s) => {
|
||||
if (skipped.has(s)) return
|
||||
const label = section.title
|
||||
const text = section.blocks.filter((block) => !OWN_SLIDES.has(block.type))
|
||||
const text = section.blocks.filter((block) => !ownSlides(block))
|
||||
// Nothing but a heading: it titles the slides that follow.
|
||||
const own = text.some((block) => !FILLER.has(block.type))
|
||||
if (seconds.section && own) slides.push({ id: `t${s}`, kind: 'section', seconds: seconds.section, label, blocks: text })
|
||||
|
|
@ -329,6 +347,15 @@ function buildSlides(sections: Section[], schedules: Map<ContentBlock, Schedule>
|
|||
const schedule = schedules.get(block)
|
||||
if (schedule) scheduleSlides(slides, schedule, picks)
|
||||
if (block.type === 'map' && block.venue) mapSlides(slides, block, at, label, title, seconds)
|
||||
if (block.type === 'list' && ownSlides(block)) {
|
||||
const items = (block.items ?? []).flatMap((item, i) => (hidden.has(listKey(s, b, i)) ? [] : [{ item, i }]))
|
||||
if (seconds.list && block.present?.list_overview && items.length && !hidden.has(listKey(s, b))) {
|
||||
slides.push({ id: `l${at}`, kind: 'list', seconds: seconds.list, label, title: title ?? undefined, items: items.map(({ item }) => item) })
|
||||
}
|
||||
if (seconds.item && block.present?.list_items) {
|
||||
for (const { item, i } of items) slides.push({ id: `i${at}.${i}`, kind: 'item', seconds: seconds.item, label, entry: item })
|
||||
}
|
||||
}
|
||||
if (block.type === 'events') {
|
||||
const items = (block.items ?? []).filter((item) => item.event)
|
||||
if (seconds.cards && items.length) slides.push({ id: `c${at}`, kind: 'cards', seconds: seconds.cards, label, items })
|
||||
|
|
@ -374,6 +401,10 @@ function slideName(slide: Slide): string {
|
|||
return slide.location!.name
|
||||
case 'event':
|
||||
return entry!.text || entry!.event!.title
|
||||
case 'list':
|
||||
return slide.title ?? (slide.items ?? []).map((item) => item.text).join(', ')
|
||||
case 'item':
|
||||
return entry!.text
|
||||
default:
|
||||
return [slide.day?.name, entry!.time, entry!.text].filter(Boolean).join(' · ')
|
||||
}
|
||||
|
|
@ -649,7 +680,7 @@ function Setup({
|
|||
<div className="space-y-6">
|
||||
{sections.map((section, s) => {
|
||||
const on = !skipped.has(s)
|
||||
const kinds = [...new Set(section.blocks.map((block) => (OWN_SLIDES.get(block.type) ?? 'Text')))]
|
||||
const kinds = [...new Set(section.blocks.map((block) => ownSlides(block) ?? 'Text'))]
|
||||
return (
|
||||
<fieldset key={s} className="bg-raised p-4 shadow-sm">
|
||||
<legend className="sr-only">{section.title}</legend>
|
||||
|
|
@ -659,6 +690,34 @@ function Setup({
|
|||
<span className="text-xs text-muted">{kinds.join(', ')}</span>
|
||||
</label>
|
||||
{section.blocks.map((block, b) => {
|
||||
// A list with slides: its overview, then its items.
|
||||
if (block.type === 'list' && ownSlides(block)) {
|
||||
return (
|
||||
<div key={b} className="mt-3 space-y-2 pl-7">
|
||||
{block.present?.list_overview && (
|
||||
<PickEntry
|
||||
label="List overview"
|
||||
strong
|
||||
enabled={on}
|
||||
checked={!hidden.has(listKey(s, b))}
|
||||
onToggle={() => setHidden(toggle(hidden, listKey(s, b)))}
|
||||
/>
|
||||
)}
|
||||
<ul className="space-y-2 pl-7">
|
||||
{(block.items ?? []).map((item, i) => (
|
||||
<li key={i}>
|
||||
<PickEntry
|
||||
label={item.text}
|
||||
enabled={on}
|
||||
checked={!hidden.has(listKey(s, b, i))}
|
||||
onToggle={() => setHidden(toggle(hidden, listKey(s, b, i)))}
|
||||
/>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
const schedule = schedules.get(block)
|
||||
if (!schedule) return null
|
||||
const { n, days } = schedule
|
||||
|
|
@ -1369,8 +1428,51 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
|
|||
)
|
||||
}
|
||||
|
||||
if (slide.kind === 'list') {
|
||||
const items = slide.items ?? []
|
||||
return (
|
||||
<div className="flex h-full flex-col items-center text-center">
|
||||
{slide.title && <SlideTitle color={color}>{slide.title}</SlideTitle>}
|
||||
<Scroll center className="w-full">
|
||||
<ul className="space-y-[2vh]">
|
||||
{items.map((item, i) => (
|
||||
<li key={i}>
|
||||
<Rise order={i + 1}>
|
||||
<span className="text-[clamp(1.4rem,3vw,4rem)] font-bold leading-tight text-ink">
|
||||
<Inline text={item.text} accent={accent} />
|
||||
</span>
|
||||
</Rise>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</Scroll>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
const entry = slide.entry!
|
||||
|
||||
if (slide.kind === 'item') {
|
||||
return (
|
||||
<div className="flex h-full flex-col text-center">
|
||||
<Scroll center>
|
||||
<Rise>
|
||||
<h1 className="text-[clamp(2.4rem,5.5vw,7rem)] font-bold leading-[1.05]" style={{ color }}>
|
||||
<Inline text={entry.text} accent={accent} />
|
||||
</h1>
|
||||
</Rise>
|
||||
{entry.detail && (
|
||||
<Rise order={1}>
|
||||
<p className="mx-auto mt-[3vh] max-w-[70vw] text-[clamp(1.2rem,2.6vw,3.2rem)] leading-snug text-body">
|
||||
{entry.detail}
|
||||
</p>
|
||||
</Rise>
|
||||
)}
|
||||
</Scroll>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
if (slide.kind === 'event') {
|
||||
const event = entry.event!
|
||||
const image = mediaUrl(event.image)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue