Count Up Text
数字カウントアップ
Generation Prompt
【対象要素】 - サイト内のテキスト1箇所(見出し・キャッチコピー・リード文等)に適用する 【演出内容】 - 数字が0から目標の値まで駆け上がる - 最初は速く、目標に近づくほど1回の増分が小さくなって滑り込むように止まる 【品質要件】 - 到達までは1秒前後。等速で数えず、終盤を減速させる - 桁数が変わっても位置がずれないよう、等幅の数字を使う - prefers-reduced-motion 時は演出を無効化し、最初から完成した状態で表示する - 演出中も文字が判読できなくなる時間を作らない。レイアウトを揺らさない
[Target element] - Apply to one piece of text on your site (a heading, a tagline, a lead paragraph, etc.) [Motion] - A number races from zero up to its target value - It starts fast and each increment shrinks as it approaches, so it slides to a stop [Quality requirements] - Reach the target in about 1 second. Do not count at a constant rate; decelerate at the end - Use monospaced digits so the position does not shift as digits change - When prefers-reduced-motion is set, disable the animation and show the finished state from the start - Never let the text become unreadable during the animation, and never shift the surrounding layout
Prompts and demo code are free to use in your own projects. See About.