v1.14.2-present: event schedules, venues and map blocks, Present mode and its phone remote #33
2 changed files with 111 additions and 53 deletions
|
|
@ -38,3 +38,25 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* A slide part taller than its room (Scroll): holds at the top,
|
||||||
|
moves up by --present-scroll, holds at the end. With reduced
|
||||||
|
motion it stays at the top. */
|
||||||
|
.present-scroll {
|
||||||
|
animation: present-scroll ease-in-out both;
|
||||||
|
}
|
||||||
|
@keyframes present-scroll {
|
||||||
|
0%,
|
||||||
|
15% {
|
||||||
|
transform: none;
|
||||||
|
}
|
||||||
|
85%,
|
||||||
|
100% {
|
||||||
|
transform: translateY(var(--present-scroll));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
.present-scroll {
|
||||||
|
animation: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,8 @@
|
||||||
tag after the days: each of the schedule's tags (087)
|
tag after the days: each of the schedule's tags (087)
|
||||||
and everything it's on, under each day's name
|
and everything it's on, under each day's name
|
||||||
A heading (086) is only a line on the overview; a break gets no
|
A heading (086) is only a line on the overview; a break gets no
|
||||||
spotlight. "Only entries tagged" (`only=<key>`) cuts every slide
|
spotlight. A slide with more than the screen holds scrolls through
|
||||||
|
it over its seconds. "Only entries tagged" (`only=<key>`) cuts every slide
|
||||||
to what one tag is on, eg. for a screen outside the youth room.
|
to what one tag is on, eg. for a screen outside the youth room.
|
||||||
|
|
||||||
Keys while playing: arrows step, Space pauses, Escape leaves full
|
Keys while playing: arrows step, Space pauses, Escape leaves full
|
||||||
|
|
@ -29,7 +30,7 @@
|
||||||
═══════════════════════════════════════════════════════════════ */
|
═══════════════════════════════════════════════════════════════ */
|
||||||
|
|
||||||
import { ArrowsOut, CaretLeft, CaretRight, Gear, Pause, Play } from '@phosphor-icons/react'
|
import { ArrowsOut, CaretLeft, CaretRight, Gear, Pause, Play } from '@phosphor-icons/react'
|
||||||
import { useContext, useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
|
import { useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type ReactNode } from 'react'
|
||||||
import { useParams, useSearchParams } from 'react-router-dom'
|
import { useParams, useSearchParams } from 'react-router-dom'
|
||||||
|
|
||||||
import PageState from '../components/PageState.tsx'
|
import PageState from '../components/PageState.tsx'
|
||||||
|
|
@ -584,6 +585,35 @@ function Rise({ order = 0, from = 'below', className = '', children }: {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* A slide's part that may not fit: when its content is taller than
|
||||||
|
the room it has, it holds, scrolls to the end over the slide's
|
||||||
|
`seconds`, then holds again. `center` puts short content in the
|
||||||
|
middle (and still starts long content at the top). */
|
||||||
|
function Scroll({ seconds, center = false, className = '', children }: {
|
||||||
|
seconds: number
|
||||||
|
center?: boolean
|
||||||
|
className?: string
|
||||||
|
children: ReactNode
|
||||||
|
}) {
|
||||||
|
const box = useRef<HTMLDivElement>(null)
|
||||||
|
const [by, setBy] = useState(0)
|
||||||
|
useLayoutEffect(() => {
|
||||||
|
const outer = box.current
|
||||||
|
const inner = outer?.firstElementChild as HTMLElement | null
|
||||||
|
if (outer && inner) setBy(Math.max(0, inner.offsetHeight - outer.clientHeight))
|
||||||
|
}, [])
|
||||||
|
return (
|
||||||
|
<div ref={box} className={`min-h-0 flex-1 overflow-hidden ${center ? 'flex flex-col' : ''} ${className}`}>
|
||||||
|
<div
|
||||||
|
className={`${center ? 'my-auto' : ''} ${by ? 'present-scroll' : ''}`}
|
||||||
|
style={by ? ({ '--present-scroll': `-${by}px`, animationDuration: `${seconds}s` } as CSSProperties) : undefined}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
/* An overview's rows: each entry, a block's sub-items under it.
|
/* An overview's rows: each entry, a block's sub-items under it.
|
||||||
`start` is the first row's place in the slide's entrance. */
|
`start` is the first row's place in the slide's entrance. */
|
||||||
function OverviewEntries({ entries, accent, start = 1 }: { entries: ContentBlockItem[]; accent: string; start?: number }) {
|
function OverviewEntries({ entries, accent, start = 1 }: { entries: ContentBlockItem[]; accent: string; start?: number }) {
|
||||||
|
|
@ -673,9 +703,11 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
|
||||||
{slide.day.name || 'Schedule'}
|
{slide.day.name || 'Schedule'}
|
||||||
</h1>
|
</h1>
|
||||||
</Rise>
|
</Rise>
|
||||||
<ul className={`grid min-h-0 flex-1 content-start gap-x-[4vw] ${two ? 'grid-cols-2' : 'grid-cols-1'}`}>
|
<Scroll seconds={slide.seconds}>
|
||||||
<OverviewEntries entries={entries} accent={accent} />
|
<ul className={`grid content-start gap-x-[4vw] ${two ? 'grid-cols-2' : 'grid-cols-1'}`}>
|
||||||
</ul>
|
<OverviewEntries entries={entries} accent={accent} />
|
||||||
|
</ul>
|
||||||
|
</Scroll>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -693,24 +725,26 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
|
||||||
{tag.name}
|
{tag.name}
|
||||||
</h1>
|
</h1>
|
||||||
</Rise>
|
</Rise>
|
||||||
<ul className={`grid min-h-0 flex-1 content-start gap-x-[4vw] ${two ? 'grid-cols-2' : 'grid-cols-1'}`}>
|
<Scroll seconds={slide.seconds}>
|
||||||
{tagDays.map((day, d) => {
|
<ul className={`grid content-start gap-x-[4vw] ${two ? 'grid-cols-2' : 'grid-cols-1'}`}>
|
||||||
const start = order
|
{tagDays.map((day, d) => {
|
||||||
order += day.entries.length + 1
|
const start = order
|
||||||
return (
|
order += day.entries.length + 1
|
||||||
<li key={d}>
|
return (
|
||||||
{day.name && (
|
<li key={d}>
|
||||||
<Rise order={start} from="left">
|
{day.name && (
|
||||||
<p className="pt-[1.5vh] pb-[0.5vh] text-[clamp(1rem,1.8vw,2.4rem)] font-bold text-ink">{day.name}</p>
|
<Rise order={start} from="left">
|
||||||
</Rise>
|
<p className="pt-[1.5vh] pb-[0.5vh] text-[clamp(1rem,1.8vw,2.4rem)] font-bold text-ink">{day.name}</p>
|
||||||
)}
|
</Rise>
|
||||||
<ul>
|
)}
|
||||||
<OverviewEntries entries={day.entries} accent={accent} start={start + 1} />
|
<ul>
|
||||||
</ul>
|
<OverviewEntries entries={day.entries} accent={accent} start={start + 1} />
|
||||||
</li>
|
</ul>
|
||||||
)
|
</li>
|
||||||
})}
|
)
|
||||||
</ul>
|
})}
|
||||||
|
</ul>
|
||||||
|
</Scroll>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -745,38 +779,40 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
|
||||||
</p>
|
</p>
|
||||||
</Rise>
|
</Rise>
|
||||||
)}
|
)}
|
||||||
<ul className="mt-[4vh] min-h-0 flex-1" style={{ borderLeft: `0.4vw solid ${withAlpha(accent, 40)}` }}>
|
<Scroll seconds={slide.seconds} className="mt-[4vh]">
|
||||||
{items.map((item, i) => (
|
<ul style={{ borderLeft: `0.4vw solid ${withAlpha(accent, 40)}` }}>
|
||||||
<li key={i} className="even:bg-tint-soft/60" style={item.featured ? featuredStyle(accent) : undefined}>
|
{items.map((item, i) => (
|
||||||
<Rise order={i + 3} from="left" className="flex items-center gap-[2vw] px-[2vw] py-[1.6vh]">
|
<li key={i} className="even:bg-tint-soft/60" style={item.featured ? featuredStyle(accent) : undefined}>
|
||||||
<span className="w-[14vw] shrink-0 text-[clamp(1rem,2vw,2.6rem)] font-semibold" style={{ color }}>
|
<Rise order={i + 3} from="left" className="flex items-center gap-[2vw] px-[2vw] py-[1.6vh]">
|
||||||
{item.time}
|
<span className="w-[14vw] shrink-0 text-[clamp(1rem,2vw,2.6rem)] font-semibold" style={{ color }}>
|
||||||
</span>
|
{item.time}
|
||||||
<span className="min-w-0 flex-1">
|
</span>
|
||||||
<span className="block text-[clamp(1.3rem,2.8vw,3.6rem)] font-bold leading-tight text-ink">
|
<span className="min-w-0 flex-1">
|
||||||
{item.featured && (
|
<span className="block text-[clamp(1.3rem,2.8vw,3.6rem)] font-bold leading-tight text-ink">
|
||||||
<span className="mr-[0.6vw]" style={{ color }}>
|
{item.featured && (
|
||||||
<FeaturedStar className="h-[0.8em] w-[0.8em]" />
|
<span className="mr-[0.6vw]" style={{ color }}>
|
||||||
|
<FeaturedStar className="h-[0.8em] w-[0.8em]" />
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
{item.text}
|
||||||
|
</span>
|
||||||
|
{(item.location || item.detail) && (
|
||||||
|
<span className="mt-1 block text-[clamp(0.9rem,1.6vw,2rem)] text-muted">
|
||||||
|
{[item.location, item.detail].filter(Boolean).join(' · ')}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{item.text}
|
|
||||||
</span>
|
</span>
|
||||||
{(item.location || item.detail) && (
|
{item.person && (
|
||||||
<span className="mt-1 block text-[clamp(0.9rem,1.6vw,2rem)] text-muted">
|
<span className="flex shrink-0 items-center gap-[1vw] text-[clamp(0.9rem,1.6vw,2rem)] text-body">
|
||||||
{[item.location, item.detail].filter(Boolean).join(' · ')}
|
<Avatar person={item.person} size="h-[5vw] w-[5vw] text-[1.4vw]" />
|
||||||
|
{item.person.name}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</span>
|
</Rise>
|
||||||
{item.person && (
|
</li>
|
||||||
<span className="flex shrink-0 items-center gap-[1vw] text-[clamp(0.9rem,1.6vw,2rem)] text-body">
|
))}
|
||||||
<Avatar person={item.person} size="h-[5vw] w-[5vw] text-[1.4vw]" />
|
</ul>
|
||||||
{item.person.name}
|
</Scroll>
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</Rise>
|
|
||||||
</li>
|
|
||||||
))}
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -814,7 +850,7 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
|
||||||
)}
|
)}
|
||||||
</Rise>
|
</Rise>
|
||||||
)}
|
)}
|
||||||
<div className="min-w-0 flex-1">
|
<Scroll seconds={slide.seconds} center className="min-w-0 self-stretch">
|
||||||
<Rise from="right">
|
<Rise from="right">
|
||||||
<p className="text-[clamp(1.2rem,2.4vw,3rem)] font-semibold" style={{ color }}>
|
<p className="text-[clamp(1.2rem,2.4vw,3rem)] font-semibold" style={{ color }}>
|
||||||
{[slide.day.name, slide.parent?.text, entry.time].filter(Boolean).join(' · ')}
|
{[slide.day.name, slide.parent?.text, entry.time].filter(Boolean).join(' · ')}
|
||||||
|
|
@ -849,12 +885,12 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
|
||||||
)}
|
)}
|
||||||
{entry.description && (
|
{entry.description && (
|
||||||
<Rise order={4} from="right">
|
<Rise order={4} from="right">
|
||||||
<div className="mt-[3vh] line-clamp-6 space-y-3 text-[clamp(1rem,1.8vw,2.2rem)] leading-snug text-muted">
|
<div className="mt-[3vh] space-y-3 text-[clamp(1rem,1.8vw,2.2rem)] leading-snug text-muted">
|
||||||
<Paragraphs text={entry.description} accent={accent} />
|
<Paragraphs text={entry.description} accent={accent} />
|
||||||
</div>
|
</div>
|
||||||
</Rise>
|
</Rise>
|
||||||
)}
|
)}
|
||||||
</div>
|
</Scroll>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue