CSS Scroll-Driven Animations: Progress Bar with Timeline
Prompt
Create a scroll progress indicator with timeline markers using CSS scroll-driven animations. The progress bar should fill as the user scrolls, and timeline markers should highlight at specific scroll positions. No JavaScript required.
CODE PREVIEW
AI rewrites this code based on your instructions. Preview is free; copy & download unlocked for ¥100.
AIとの対話に追加する一言
プロンプトと一緒にコピーして、AIがより正確に意図を汲み取れるようにします
このコードをそのまま使いたいので、CDNリンクも含めた完全なHTMLファイルとして出力してください。
初心者なので、各行にコメントを追加して、何をしているか説明してください。
このコードをWordPressのテーマに組み込む方法も教えてください。
動作確認済みのコードをお願いします。エラーが出る場合の対処法も含めて。
This implementation demonstrates CSS Scroll-Driven Animations, a modern CSS feature that allows animations to be controlled by scroll progress without JavaScript. The progress bar fills as you scroll through the page, and timeline markers highlight at specific scroll positions (25%, 50%, and 75%).
Key features:
- Uses
animation-timeline: scroll(root)to link animations to scroll progress - Markers activate within specific scroll ranges using
animation-range - Sticky positioning keeps the progress bar visible while scrolling
- Pure CSS solution with no JavaScript dependencies
- Responsive design that works on all screen sizes
Browser support: Requires Chrome 115+ or Edge 115+ with the Experimental Web Platform Features flag enabled.
Was this prompt helpful?
Comments
Comments appear after moderation
この記事が役に立ったら投げ銭で応援
Apple Pay / Google Pay / クレジットカード対応 · Stripeで安全に決済
開発者が選ぶ最強ツール集
運営者が毎日使っているツール・ガジェット 6選