Present: a heading alone as a centered slide; just an events list
- A section left with only its heading and subheadings, and nothing after it to title, gets a centered slide of them - Setup, per events block: A slide per event, so the list slide can show alone Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b2ef692155
commit
b286cbddbf
1 changed files with 13 additions and 4 deletions
|
|
@ -152,6 +152,7 @@ const OWN_SLIDES = new Map([
|
||||||
by eventKey. */
|
by eventKey. */
|
||||||
const EVENT_PARTS = [
|
const EVENT_PARTS = [
|
||||||
['overview', 'List slide'],
|
['overview', 'List slide'],
|
||||||
|
['each', 'A slide per event'],
|
||||||
['picture', 'Picture'],
|
['picture', 'Picture'],
|
||||||
['line', 'Type and date'],
|
['line', 'Type and date'],
|
||||||
['person', 'Presenter'],
|
['person', 'Presenter'],
|
||||||
|
|
@ -257,7 +258,8 @@ function sectionsOf(blocks: ContentBlock[], title: string): Section[] {
|
||||||
sections.push({ title: heading || title, headed: Boolean(heading), blocks: [] })
|
sections.push({ title: heading || title, headed: Boolean(heading), blocks: [] })
|
||||||
} else if (!block.present?.hide) sections[sections.length - 1].blocks.push(block)
|
} else if (!block.present?.hide) sections[sections.length - 1].blocks.push(block)
|
||||||
}
|
}
|
||||||
return sections.filter((section) => section.blocks.length)
|
// A heading with nothing left under it still has its title slide.
|
||||||
|
return sections.filter((section) => section.blocks.length || section.headed)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A day's, entry's or sub-item's key in the address: the schedule's
|
/* A day's, entry's or sub-item's key in the address: the schedule's
|
||||||
|
|
@ -407,6 +409,7 @@ function buildSlides(sections: Section[], schedules: Map<ContentBlock, Schedule>
|
||||||
slides.push({ id: `t${s}`, kind: 'section', seconds: seconds.section, label, blocks: text, pictures: side })
|
slides.push({ id: `t${s}`, kind: 'section', seconds: seconds.section, label, blocks: text, pictures: side })
|
||||||
}
|
}
|
||||||
const title = section.headed && !own ? label : null
|
const title = section.headed && !own ? label : null
|
||||||
|
const before = slides.length
|
||||||
section.blocks.forEach((block, b) => {
|
section.blocks.forEach((block, b) => {
|
||||||
const at = `${s}.${b}`
|
const at = `${s}.${b}`
|
||||||
const schedule = schedules.get(block)
|
const schedule = schedules.get(block)
|
||||||
|
|
@ -433,11 +436,17 @@ function buildSlides(sections: Section[], schedules: Map<ContentBlock, Schedule>
|
||||||
if (seconds.cards && items.length && !off.has('overview')) {
|
if (seconds.cards && items.length && !off.has('overview')) {
|
||||||
slides.push({ id: `c${at}`, kind: 'cards', seconds: seconds.cards, label, title: title ?? undefined, items: items.map(({ item }) => item), off })
|
slides.push({ id: `c${at}`, kind: 'cards', seconds: seconds.cards, label, title: title ?? undefined, items: items.map(({ item }) => item), off })
|
||||||
}
|
}
|
||||||
if (seconds.event) {
|
// Without A slide per event, just the list slide.
|
||||||
|
if (seconds.event && !off.has('each')) {
|
||||||
for (const { item, i } of items) slides.push({ id: `e${at}.${i}`, kind: 'event', seconds: seconds.event, label, entry: item, off })
|
for (const { item, i } of items) slides.push({ id: `e${at}.${i}`, kind: 'event', seconds: seconds.event, label, entry: item, off })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
// Only a heading (and subheadings) and nothing after it to title:
|
||||||
|
// the heading as a slide of its own, centered.
|
||||||
|
if (seconds.section && section.headed && !own && slides.length === before) {
|
||||||
|
slides.push({ id: `t${s}`, kind: 'section', seconds: seconds.section, label, blocks: text })
|
||||||
|
}
|
||||||
})
|
})
|
||||||
return slides
|
return slides
|
||||||
}
|
}
|
||||||
|
|
@ -1624,8 +1633,8 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
|
||||||
// The page's own blocks, zoomed up from the page's size. The
|
// The page's own blocks, zoomed up from the page's size. The
|
||||||
// zoom is inside Scroll, so it measures what the screen shows.
|
// zoom is inside Scroll, so it measures what the screen shows.
|
||||||
const zoom = Math.max(1, window.innerWidth / TEXT_WIDTH)
|
const zoom = Math.max(1, window.innerWidth / TEXT_WIDTH)
|
||||||
// Only people or pictures: the title and them in the middle of the
|
// Only people or pictures, or just the heading and subheadings: the
|
||||||
// slide, both ways.
|
// title and them in the middle of the slide, both ways.
|
||||||
if (slide.blocks!.every((block) => block.type === 'people' || isPicture(block) || FILLER.has(block.type))) {
|
if (slide.blocks!.every((block) => block.type === 'people' || isPicture(block) || FILLER.has(block.type))) {
|
||||||
return (
|
return (
|
||||||
<div className="flex h-full flex-col text-center">
|
<div className="flex h-full flex-col text-center">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue