Rotating words: {Next|Now} in titles and text cycles through its choices

Migration 084: site defaults for the motion (slide, flip, fade, type,
mirror), direction and seconds per word in Site settings, and a hero's
and a block's own. The hero's headline, section and band titles,
headings, paragraphs, callouts and quotes rotate; menus, tab titles,
search text and emails show the first word; less motion shows it still.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aidan Dona 2026-10-17 00:43:59 -05:00
parent ab8dcdd608
commit a10ff6d75f
30 changed files with 411 additions and 37 deletions

View file

@ -38,6 +38,7 @@
import { readableOn } from './color.ts'
import { PLATFORMS } from './platforms.ts'
import { firstWords } from '../lib/words.ts'
export type NewsletterItem = {
title: string
@ -186,7 +187,8 @@ const imageTag = (src: string, alt: string) =>
`<img src="${escape(src)}" width="552" alt="${escape(alt)}" style="display:block;margin:0 auto;width:100%;max-width:552px;height:auto;border:0;">`
function blockHtml(block: NewsletterPart, n: Newsletter): string {
const text = block.text?.trim() ?? ''
// An email can't animate: rotating words ({Next|Now}) are their first.
const text = firstWords(block.text).trim()
const href = block.href ? safeHref(block.href, n) : null
const items = block.items ?? []
const align = alignOf(block)
@ -412,7 +414,7 @@ export function newsletterHtml(n: Newsletter): string {
}
function blockText(block: NewsletterPart, n: Newsletter): string[] {
const text = block.text?.trim() ?? ''
const text = firstWords(block.text).trim()
const items = block.items ?? []
const link = (url: string) => safeHref(url, n) ?? url
switch (block.type) {