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:
parent
ab8dcdd608
commit
a10ff6d75f
30 changed files with 411 additions and 37 deletions
|
|
@ -55,6 +55,7 @@ import { headingAnchors } from '../lib/contents.ts'
|
|||
import { SITE_NAME } from '../lib/site.ts'
|
||||
import { useSmallImage } from '../lib/useSmallImage.ts'
|
||||
import { useReadingMode } from '../lib/readingMode.ts'
|
||||
import { WordMotion, Words } from './RotatingWords.tsx'
|
||||
|
||||
const BODY = 'var(--color-muted)'
|
||||
|
||||
|
|
@ -96,14 +97,15 @@ export default function ContentBlocks({
|
|||
return (
|
||||
<div className={`space-y-6 ${className}`}>
|
||||
{blocks.map((block, index) => (
|
||||
<WordMotion key={block.id ?? index} settings={block.words}>
|
||||
<Block
|
||||
key={block.id ?? index}
|
||||
block={block}
|
||||
accent={accent}
|
||||
anchor={idAt.get(index)}
|
||||
level={levels[index]}
|
||||
presentHref={presentHrefs[index]}
|
||||
/>
|
||||
</WordMotion>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
|
|
@ -191,14 +193,14 @@ function Block({
|
|||
case 'heading':
|
||||
return (
|
||||
<h3 id={anchor} className="text-2xl font-bold" style={{ color: accentText(accent) }}>
|
||||
{text}
|
||||
<Words text={text} />
|
||||
</h3>
|
||||
)
|
||||
|
||||
case 'subheading':
|
||||
return (
|
||||
<h4 id={anchor} className="text-lg font-normal" style={{ color: accentText(accent) }}>
|
||||
{text}
|
||||
<Words text={text} />
|
||||
</h4>
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue