Word Swap While Pinned
ピン中に語が入れ替わる
Generation Prompt
【対象要素】 - スクロールで見せるセクション1つ(見出し+図版・画像・カード等)に適用する 【演出内容】 - セクションを固定したまま、スクロールの進行に応じて同じ位置の語が次々に入れ替わる - 語と語の切り替わりは重ならず、片方が消えてから次が出る 【品質要件】 - 語の数だけ進行を等分し、各語の表示区間を割り当てる - スクロールを戻すと語も逆順に戻る - prefers-reduced-motion 時は演出を無効化し、最初から完成した状態で表示する - スクロールを戻したときも進行に応じて巻き戻る(一度きりの再生にしない) - 図形は半透明(不透明度0.7程度)にして、背後の要素や文字を潰さない
[Target element] - Apply to one scroll-driven section on your site (a heading plus a figure, image, or cards) [Motion] - With the section pinned, words in the same position replace one another as the scroll advances - The swaps never overlap: one leaves before the next arrives [Quality requirements] - Divide the progress evenly by the number of words and assign each a display range - Scrolling back steps the words back in reverse - When prefers-reduced-motion is set, disable the animation and show the finished state from the start - Scrolling back must rewind the animation in step with the scroll position (never a one-shot playback) - Keep shapes semi-transparent (around 0.7 opacity) so they never crush the content or text behind them
Prompts and demo code are free to use in your own projects. See About.