Image block: a dark theme picture; presented pictures centered

- media_dark (102): shown in place of the image while the site is
  dark, the block's alt text and caption shared
- Present: pictures beside text centered on the slide's height, and a
  section of only pictures centered both ways

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-11-12 06:40:40 -06:00
parent a59702b7f3
commit f46deac3cc
7 changed files with 41 additions and 8 deletions

View file

@ -1434,7 +1434,7 @@ function Scroll({ center = false, className = '', children }: {
zoomed down until its content is no taller than its box (a few
passes, since text narrower in zoom wraps less). Again whenever
its size changes, eg. a picture loading. */
function Fit({ className = '', children }: { className?: string; children: ReactNode }) {
function Fit({ center = false, className = '', children }: { center?: boolean; className?: string; children: ReactNode }) {
const box = useRef<HTMLDivElement>(null)
const inner = useRef<HTMLDivElement>(null)
useLayoutEffect(() => {
@ -1457,8 +1457,10 @@ function Fit({ className = '', children }: { className?: string; children: React
return () => watch.disconnect()
}, [])
return (
<div ref={box} className={`min-h-0 flex-1 overflow-hidden ${className}`}>
<div ref={inner}>{children}</div>
<div ref={box} className={`min-h-0 flex-1 overflow-hidden ${center ? 'flex flex-col' : ''} ${className}`}>
<div ref={inner} className={center ? 'my-auto' : undefined}>
{children}
</div>
</div>
)
}
@ -1587,9 +1589,9 @@ 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
// Only people or pictures: the title and them in the middle of the
// slide, both ways.
if (slide.blocks!.every((block) => block.type === 'people' || FILLER.has(block.type))) {
if (slide.blocks!.every((block) => block.type === 'people' || isPicture(block) || FILLER.has(block.type))) {
return (
<div className="flex h-full flex-col text-center">
<Scroll center>
@ -1620,7 +1622,7 @@ function SlideView({ slide, accent }: { slide: Slide; accent: string }) {
<div className="flex h-full flex-col">
<SlideTitle color={color}>{slide.label}</SlideTitle>
<Rise order={1} className="flex min-h-0 flex-1 flex-col">
<Fit>
<Fit center>
<div
className={`grid items-center gap-[3vw] ${left ? 'grid-cols-[2fr_3fr]' : 'grid-cols-[3fr_2fr]'}`}
style={{ zoom }}