Let the hero's photos or brand backdrop sit behind a stream or video

hero_mode answered two questions with one value, so a livestream or
featured video could only ever sit on the brand backdrop. It's now
two settings:

  Background        brand | photos
  Beside the words  nothing | livestream | featured video

Any background goes with any feature: the photo slideshow can run
behind the stream, with its captions, progress bars and pause button
as before. The fallbacks are unchanged: photos with none added shows
brand, and a feature with no link set shows nothing beside the words.

Migration 025 adds hero_backdrop and hero_feature, maps each row's
hero_mode onto them (photos → photos + nothing, livestream/video →
brand + that feature, brand → brand + nothing) and drops hero_mode.
ADD/DROP COLUMN rather than a rebuild, so front_page's children and
touch trigger are untouched. The API's hero sends `backdrop` and
`feature` in place of `mode`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-26 18:29:40 -05:00
parent 5b9c8f7391
commit 7eeac6b22f
6 changed files with 104 additions and 40 deletions

View file

@ -1,24 +1,30 @@
/* ═══════════════════════════════════════════════════════════════
HERO STAGE
The top of the front page, in whichever mode the admin set:
The top of the front page. Two choices the admin makes
separately, so any backdrop goes with any feature:
Backdrop, what fills the background:
brand drifting colour and slow concentric rings — many
circles, one centre — behind the words, with the
dove at that centre
circles, one centre — with the dove at that centre
photos the hero photos, crossfading with a slow zoom, a
progress bar per photo and a pause button (anything
that moves on its own for more than five seconds
needs one)
livestream the stream beside the words, with a LIVE badge
video a featured video beside the words, under a
"Featured video" badge. Never autoplays: an embed
waits for play, a file shows the browser's player
A mode that has nothing to show falls back to brand: photos with
no photos, or livestream/video with no link set. A link that
can't be framed still gets a "Watch live" or "Watch the video"
button, so switching the mode on is never a no-op.
Feature, what sits beside the words over that backdrop:
none nothing; the words take the width
livestream the stream, with a LIVE badge above the headline
video a featured video under a "Featured video" badge.
Never autoplays: an embed waits for play, a file
shows the browser's player
A choice with nothing to show falls back: photos with no photos
to brand, a feature with no link set to none. A link that can't
be framed still gets a "Watch live" or "Watch the video" button,
so switching a feature on is never a no-op.
`hero` is null while the page config loads or when it failed; the
stage still draws, empty, so the page doesn't jump when it
@ -31,7 +37,7 @@ import HomeLink from './HomeLink.tsx'
import DoveMark from '../../../components/DoveMark.tsx'
import { livestreamEmbedUrl, videoSource, type VideoSource } from '../../../lib/embeds.ts'
import { heroPhoto } from '../../../lib/media.ts'
import type { Hero, HeroSlide } from '../../../lib/useFrontPage.ts'
import type { Hero, HeroBackdrop, HeroFeature, HeroSlide } from '../../../lib/useFrontPage.ts'
const DEEP = '#04262e'
@ -40,17 +46,18 @@ export default function HeroStage({ hero }: { hero: Hero | null }) {
const embed = livestreamEmbedUrl(hero?.livestream?.url)
const video = videoSource(hero?.video?.url)
const mode =
hero?.mode === 'photos' && slides.length > 0
? 'photos'
: hero?.mode === 'livestream' && hero.livestream
? 'livestream'
: hero?.mode === 'video' && hero.video
? 'video'
: 'brand'
const backdrop: HeroBackdrop =
hero?.backdrop === 'photos' && slides.length > 0 ? 'photos' : 'brand'
// Livestream and video share a layout: words left, player right.
const beside = mode === 'livestream' || mode === 'video'
const feature: HeroFeature =
hero?.feature === 'livestream' && hero.livestream
? 'livestream'
: hero?.feature === 'video' && hero.video
? 'video'
: 'none'
// Both features share a layout: words left, player right.
const beside = feature !== 'none'
return (
<section
@ -58,7 +65,7 @@ export default function HeroStage({ hero }: { hero: Hero | null }) {
className="relative isolate flex min-h-[92vh] items-center overflow-hidden pt-24 pb-16"
style={{ background: DEEP }}
>
{mode === 'photos' ? (
{backdrop === 'photos' ? (
<PhotoBackdrop slides={slides} seconds={hero?.slide_seconds ?? 7} />
) : (
<BrandBackdrop />
@ -66,16 +73,16 @@ export default function HeroStage({ hero }: { hero: Hero | null }) {
<div className="relative z-10 mx-auto grid w-full max-w-7xl items-center gap-12 px-6 lg:grid-cols-12">
<div className={beside ? 'lg:col-span-5' : 'lg:col-span-8'}>
{hero && <Words hero={hero} mode={mode} />}
{hero && <Words hero={hero} feature={feature} />}
</div>
{mode === 'livestream' && hero?.livestream && (
{feature === 'livestream' && hero?.livestream && (
<div className="lg:col-span-7">
<LiveFrame src={embed} url={hero.livestream.url} title={hero.livestream.title} />
</div>
)}
{mode === 'video' && hero?.video && (
{feature === 'video' && hero?.video && (
<div className="lg:col-span-7">
<VideoFrame source={video} url={hero.video.url} title={hero.video.title} />
</div>
@ -87,10 +94,10 @@ export default function HeroStage({ hero }: { hero: Hero | null }) {
/* ── The words ───────────────────────────────────────────────── */
function Words({ hero, mode }: { hero: Hero; mode: 'brand' | 'photos' | 'livestream' | 'video' }) {
function Words({ hero, feature }: { hero: Hero; feature: HeroFeature }) {
const words = hero.headline.split(/\s+/).filter(Boolean)
const live = mode === 'livestream'
const beside = live || mode === 'video'
const live = feature === 'livestream'
const beside = feature !== 'none'
return (
<div className="text-white">
@ -104,7 +111,7 @@ function Words({ hero, mode }: { hero: Hero; mode: 'brand' | 'photos' | 'livestr
</span>
)}
</p>
) : mode === 'video' ? (
) : feature === 'video' ? (
<p className="mb-6 inline-flex items-center gap-3 rounded-full bg-white/10 px-4 py-1.5 text-sm font-semibold uppercase tracking-[0.2em] backdrop-blur">
<span className="text-[#9fe7d0]" aria-hidden="true">▶</span>
Featured video