Present: a slide with more than the screen holds scrolls through it

The day overview, tag and block lists and the spotlight text hold, scroll to the end over the slide's seconds, then hold. The spotlight description is no longer cut at six lines. Reduced motion keeps them at the top.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-11-03 03:21:44 -06:00
parent b30f5f11fe
commit d17e2596ba
2 changed files with 111 additions and 53 deletions

View file

@ -38,3 +38,25 @@
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;
}
}

View file

@ -21,7 +21,8 @@
tag after the days: each of the schedule's tags (087)
and everything it's on, under each day's name
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.
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 { 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 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.
`start` is the first row's place in the slide's entrance. */
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'}
</h1>
</Rise>
<ul className={`grid min-h-0 flex-1 content-start gap-x-[4vw] ${two ? 'grid-cols-2' : 'grid-cols-1'}`}>
<OverviewEntries entries={entries} accent={accent} />
</ul>
<Scroll seconds={slide.seconds}>
<ul className={`grid content-start gap-x-[4vw] ${two ? 'grid-cols-2' : 'grid-cols-1'}`}>
<OverviewEntries entries={entries} accent={accent} />
</ul>
</Scroll>
</div>
)
}
@ -693,24 +725,26 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
{tag.name}
</h1>
</Rise>
<ul className={`grid min-h-0 flex-1 content-start gap-x-[4vw] ${two ? 'grid-cols-2' : 'grid-cols-1'}`}>
{tagDays.map((day, d) => {
const start = order
order += day.entries.length + 1
return (
<li key={d}>
{day.name && (
<Rise order={start} from="left">
<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>
</li>
)
})}
</ul>
<Scroll seconds={slide.seconds}>
<ul className={`grid content-start gap-x-[4vw] ${two ? 'grid-cols-2' : 'grid-cols-1'}`}>
{tagDays.map((day, d) => {
const start = order
order += day.entries.length + 1
return (
<li key={d}>
{day.name && (
<Rise order={start} from="left">
<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>
</li>
)
})}
</ul>
</Scroll>
</div>
)
}
@ -745,38 +779,40 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
</p>
</Rise>
)}
<ul className="mt-[4vh] min-h-0 flex-1" style={{ borderLeft: `0.4vw solid ${withAlpha(accent, 40)}` }}>
{items.map((item, i) => (
<li key={i} className="even:bg-tint-soft/60" style={item.featured ? featuredStyle(accent) : undefined}>
<Rise order={i + 3} from="left" className="flex items-center gap-[2vw] px-[2vw] py-[1.6vh]">
<span className="w-[14vw] shrink-0 text-[clamp(1rem,2vw,2.6rem)] font-semibold" style={{ color }}>
{item.time}
</span>
<span className="min-w-0 flex-1">
<span className="block text-[clamp(1.3rem,2.8vw,3.6rem)] font-bold leading-tight text-ink">
{item.featured && (
<span className="mr-[0.6vw]" style={{ color }}>
<FeaturedStar className="h-[0.8em] w-[0.8em]" />
<Scroll seconds={slide.seconds} className="mt-[4vh]">
<ul style={{ borderLeft: `0.4vw solid ${withAlpha(accent, 40)}` }}>
{items.map((item, i) => (
<li key={i} className="even:bg-tint-soft/60" style={item.featured ? featuredStyle(accent) : undefined}>
<Rise order={i + 3} from="left" className="flex items-center gap-[2vw] px-[2vw] py-[1.6vh]">
<span className="w-[14vw] shrink-0 text-[clamp(1rem,2vw,2.6rem)] font-semibold" style={{ color }}>
{item.time}
</span>
<span className="min-w-0 flex-1">
<span className="block text-[clamp(1.3rem,2.8vw,3.6rem)] font-bold leading-tight text-ink">
{item.featured && (
<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>
)}
{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(' · ')}
{item.person && (
<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]" />
{item.person.name}
</span>
)}
</span>
{item.person && (
<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]" />
{item.person.name}
</span>
)}
</Rise>
</li>
))}
</ul>
</Rise>
</li>
))}
</ul>
</Scroll>
</div>
)
}
@ -814,7 +850,7 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
)}
</Rise>
)}
<div className="min-w-0 flex-1">
<Scroll seconds={slide.seconds} center className="min-w-0 self-stretch">
<Rise from="right">
<p className="text-[clamp(1.2rem,2.4vw,3rem)] font-semibold" style={{ color }}>
{[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 && (
<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} />
</div>
</Rise>
)}
</div>
</Scroll>
</div>
)
}