v1.14.2-present: event schedules, venues and map blocks, Present mode and its phone remote #33
1 changed files with 116 additions and 41 deletions
|
|
@ -13,9 +13,14 @@
|
|||
schedule each schedule block's slides (below)
|
||||
venue each map block (088): the map with its locations
|
||||
place then the map once per marked location, it lit up
|
||||
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)
|
||||
cards each events block (088): its events' titles and
|
||||
presenters on one slide
|
||||
event then each event alone: picture, type and date,
|
||||
title, its presenter and its own page's blocks (else
|
||||
its card text)
|
||||
The setup picks, per events block, which events (`hide`
|
||||
e<section>.<block>.<item>) and what is shown (EVENT_PARTS, `hide`
|
||||
e<section>.<block>:<part>).
|
||||
list a list block picked for an Overview slide: its
|
||||
items' text, centered
|
||||
item then, picked for A slide per item, each item: its
|
||||
|
|
@ -118,7 +123,7 @@ const KINDS = [
|
|||
{ key: 'tag', label: 'Tag slides', help: "Each schedule tag and everything it's on, after the days", seconds: 15 },
|
||||
{ key: 'venue', label: 'Maps', help: "A map block: the venue's map with its locations", seconds: 15 },
|
||||
{ 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: 'cards', label: 'Event lists', help: "An events block's titles and presenters 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 },
|
||||
|
|
@ -132,6 +137,20 @@ const OWN_SLIDES = new Map([
|
|||
['map', 'Map'],
|
||||
['events', 'Events'],
|
||||
])
|
||||
/* What an events block's slides can show, each ticked off in `hide`
|
||||
by eventKey. */
|
||||
const EVENT_PARTS = [
|
||||
['overview', 'List slide'],
|
||||
['picture', 'Picture'],
|
||||
['line', 'Type and date'],
|
||||
['person', 'Presenter'],
|
||||
['content', 'Its page content'],
|
||||
] as const
|
||||
type EventPart = (typeof EVENT_PARTS)[number][0]
|
||||
/* An events block's event (by number) or part (by name) in `hide`. */
|
||||
const eventKey = (s: number, b: number, at: number | EventPart) =>
|
||||
typeof at === 'number' ? `e${s}.${b}.${at}` : `e${s}.${b}:${at}`
|
||||
|
||||
/* A list's picks in `lists`: its Overview slide, A slide per item. */
|
||||
const overviewKey = (s: number, b: number) => `o${s}.${b}`
|
||||
const itemsKey = (s: number, b: number) => `i${s}.${b}`
|
||||
|
|
@ -196,6 +215,8 @@ type Slide = {
|
|||
only?: string[]
|
||||
noList?: boolean
|
||||
noDetails?: boolean
|
||||
/* An events block's parts ticked off on the setup screen. */
|
||||
off?: Set<EventPart>
|
||||
}
|
||||
|
||||
/* A part of the page: a heading (`headed`, else the event's title)
|
||||
|
|
@ -363,10 +384,13 @@ function buildSlides(sections: Section[], schedules: Map<ContentBlock, Schedule>
|
|||
}
|
||||
}
|
||||
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 })
|
||||
const off = new Set(EVENT_PARTS.map(([part]) => part).filter((part) => hidden.has(eventKey(s, b, part))))
|
||||
const items = (block.items ?? []).flatMap((item, i) => (item.event && !hidden.has(eventKey(s, b, i)) ? [{ item, i }] : []))
|
||||
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 })
|
||||
}
|
||||
if (seconds.event) {
|
||||
items.forEach((entry, i) => slides.push({ id: `e${at}.${i}`, kind: 'event', seconds: seconds.event, label, entry }))
|
||||
for (const { item, i } of items) slides.push({ id: `e${at}.${i}`, kind: 'event', seconds: seconds.event, label, entry: item, off })
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -734,6 +758,42 @@ function Setup({
|
|||
</div>
|
||||
)
|
||||
}
|
||||
// An events block: what's shown, then which events.
|
||||
if (block.type === 'events') {
|
||||
const events = (block.items ?? []).flatMap((item, i) => (item.event ? [{ item, i }] : []))
|
||||
if (!events.length) return null
|
||||
const name = (item: ContentBlockItem) => item.text || item.event!.title
|
||||
return (
|
||||
<div key={b} className="mt-3 space-y-2 pl-7">
|
||||
<p className="text-sm text-muted">
|
||||
Events: {preview(events.map(({ item }) => name(item)).join(', '), 60)}
|
||||
</p>
|
||||
<div className="flex flex-wrap gap-x-6 gap-y-2">
|
||||
{EVENT_PARTS.map(([part, partLabel]) => (
|
||||
<PickEntry
|
||||
key={part}
|
||||
label={partLabel}
|
||||
enabled={on}
|
||||
checked={!hidden.has(eventKey(s, b, part))}
|
||||
onToggle={() => setHidden(toggle(hidden, eventKey(s, b, part)))}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
<ul className="space-y-2 pl-7">
|
||||
{events.map(({ item, i }) => (
|
||||
<li key={i}>
|
||||
<PickEntry
|
||||
label={[name(item), item.person?.name].filter(Boolean).join(' · ')}
|
||||
enabled={on}
|
||||
checked={!hidden.has(eventKey(s, b, i))}
|
||||
onToggle={() => setHidden(toggle(hidden, eventKey(s, b, i)))}
|
||||
/>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
const schedule = schedules.get(block)
|
||||
if (!schedule) return null
|
||||
const { n, days } = schedule
|
||||
|
|
@ -1317,6 +1377,22 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
|
|||
// The page's own blocks, zoomed up from the page's size. The
|
||||
// zoom is inside Scroll, so it measures what the screen shows.
|
||||
const zoom = Math.max(1, window.innerWidth / TEXT_WIDTH)
|
||||
// Only people: the title and their photos in the middle of the
|
||||
// slide, both ways.
|
||||
if (slide.blocks!.every((block) => block.type === 'people' || FILLER.has(block.type))) {
|
||||
return (
|
||||
<div className="flex h-full flex-col text-center">
|
||||
<Scroll center>
|
||||
<SlideTitle color={color}>{slide.label}</SlideTitle>
|
||||
<Rise order={1}>
|
||||
<div style={{ zoom }}>
|
||||
<ContentBlocks blocks={slide.blocks} accent={accent} />
|
||||
</div>
|
||||
</Rise>
|
||||
</Scroll>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<div className="flex h-full flex-col">
|
||||
<SlideTitle color={color}>{slide.label}</SlideTitle>
|
||||
|
|
@ -1409,35 +1485,30 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
|
|||
}
|
||||
|
||||
if (slide.kind === 'cards') {
|
||||
// The events' titles, each with its presenter, as rows.
|
||||
const items = slide.items ?? []
|
||||
const off = slide.off ?? new Set()
|
||||
return (
|
||||
<div className="flex h-full flex-col">
|
||||
<SlideTitle color={color}>{slide.title ?? slide.label}</SlideTitle>
|
||||
<Scroll>
|
||||
<ul className={`grid gap-[2vw] ${items.length > 4 ? 'grid-cols-3' : 'grid-cols-2'}`}>
|
||||
{items.map((item, i) => {
|
||||
const image = mediaUrl(item.event!.image)
|
||||
return (
|
||||
<li key={i}>
|
||||
<Rise order={i + 1} className="h-full bg-raised shadow-md">
|
||||
{image && <img src={image} alt="" className="aspect-video w-full object-cover" />}
|
||||
<div className="p-[1.5vw]">
|
||||
{eventLine(item.event!) && (
|
||||
<p className="text-[clamp(0.9rem,1.4vw,1.8rem)] font-semibold capitalize" style={{ color }}>
|
||||
{eventLine(item.event!)}
|
||||
</p>
|
||||
)}
|
||||
<p className="text-[clamp(1.2rem,2.2vw,2.8rem)] font-bold leading-tight text-ink">
|
||||
<ul className={`grid content-start gap-x-[4vw] ${items.length > ONE_COLUMN ? 'grid-cols-2' : 'grid-cols-1'}`}>
|
||||
{items.map((item, i) => (
|
||||
<li key={i} className="even:bg-tint-soft/60">
|
||||
<Rise
|
||||
order={i + 1}
|
||||
from="left"
|
||||
className="flex items-baseline justify-between gap-[2vw] border-b border-brand/15 px-[1vw] py-[1.4vh]"
|
||||
>
|
||||
<span className="min-w-0 text-[clamp(1.2rem,2.4vw,3rem)] font-bold leading-tight text-ink">
|
||||
{item.text || item.event!.title}
|
||||
</p>
|
||||
{item.person && (
|
||||
<p className="mt-[0.5vh] text-[clamp(0.9rem,1.4vw,1.8rem)] text-muted">{item.person.name}</p>
|
||||
</span>
|
||||
{item.person && !off.has('person') && (
|
||||
<span className="shrink-0 text-[clamp(1rem,1.8vw,2.4rem)] text-muted">{item.person.name}</span>
|
||||
)}
|
||||
</div>
|
||||
</Rise>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
))}
|
||||
</ul>
|
||||
</Scroll>
|
||||
</div>
|
||||
|
|
@ -1491,11 +1562,15 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
|
|||
|
||||
if (slide.kind === 'event') {
|
||||
const event = entry.event!
|
||||
const image = mediaUrl(event.image)
|
||||
const blurb = entry.detail || event.blurb
|
||||
// What the setup left on (EVENT_PARTS).
|
||||
const off = slide.off ?? new Set()
|
||||
const image = off.has('picture') ? null : mediaUrl(event.image)
|
||||
const line = off.has('line') ? null : eventLine(event)
|
||||
const person = off.has('person') ? null : entry.person
|
||||
const blurb = off.has('content') ? null : entry.detail || event.blurb
|
||||
// Its own page's blocks, when it has some, in place of its card
|
||||
// text, zoomed for the column they're in.
|
||||
const blocks = event.blocks?.length ? event.blocks : null
|
||||
const blocks = !off.has('content') && event.blocks?.length ? event.blocks : null
|
||||
const zoom = Math.max(1, (window.innerWidth * 0.75) / TEXT_WIDTH)
|
||||
return (
|
||||
<div className="flex h-full items-center gap-[5vw]">
|
||||
|
|
@ -1505,10 +1580,10 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
|
|||
</Rise>
|
||||
)}
|
||||
<Scroll center={!blocks} className="min-w-0 self-stretch">
|
||||
{eventLine(event) && (
|
||||
{line && (
|
||||
<Rise from="right">
|
||||
<p className="text-[clamp(1.2rem,2.4vw,3rem)] font-semibold capitalize" style={{ color }}>
|
||||
{eventLine(event)}
|
||||
{line}
|
||||
</p>
|
||||
</Rise>
|
||||
)}
|
||||
|
|
@ -1517,13 +1592,13 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
|
|||
{entry.text || event.title}
|
||||
</h1>
|
||||
</Rise>
|
||||
{entry.person && (
|
||||
{person && (
|
||||
<Rise order={2} from="right" className="mt-[3vh] flex items-center gap-[1.5vw]">
|
||||
<Avatar person={entry.person} size="h-[6vw] w-[6vw] text-[1.6vw]" />
|
||||
<Avatar person={person} size="h-[6vw] w-[6vw] text-[1.6vw]" />
|
||||
<span>
|
||||
<span className="block text-[clamp(1.1rem,2vw,2.6rem)] font-bold text-ink">{entry.person.name}</span>
|
||||
{entry.person.tagline && (
|
||||
<span className="block text-[clamp(0.9rem,1.4vw,1.8rem)] text-muted">{entry.person.tagline}</span>
|
||||
<span className="block text-[clamp(1.1rem,2vw,2.6rem)] font-bold text-ink">{person.name}</span>
|
||||
{person.tagline && (
|
||||
<span className="block text-[clamp(0.9rem,1.4vw,1.8rem)] text-muted">{person.tagline}</span>
|
||||
)}
|
||||
</span>
|
||||
</Rise>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue