AIGPAIGP

Scroll Progress Bar Prompt: AI-Generated CSS Example

P

Prompt

Create a progress bar that fills as user scrolls down the page. Bar stays fixed at top. Shows scroll percentage.

CODE PREVIEW

エディタを読み込み中…

AIとの対話に追加する一言

プロンプトと一緒にコピーして、AIがより正確に意図を汲み取れるようにします

このコードをそのまま使いたいので、CDNリンクも含めた完全なHTMLファイルとして出力してください。

初心者なので、各行にコメントを追加して、何をしているか説明してください。

このコードをWordPressのテーマに組み込む方法も教えてください。

動作確認済みのコードをお願いします。エラーが出る場合の対処法も含めて。

ページをスクロールした際に、スクロール位置に応じて進行状況を視覚的に表示するプログレスバーです。コンテンツの長さと現在位置をフィードバックします。

Prompt Overview

This prompt asks an AI coding assistant to generate a scroll-linked progress bar — a thin bar fixed at the top of the page that fills from left to right as the user scrolls down, while displaying the current scroll percentage. It is a practical UI enhancement commonly used in blog articles, documentation pages, and long-form landing pages to help readers track how far they have progressed through the content.

The implementation typically requires a small amount of JavaScript to calculate scroll position relative to total page height, combined with CSS for the fixed positioning and fill animation. This prompt works well with models like GPT-4o or Claude when you need clean, copy-paste-ready code. You can extend the basic version by customizing the bar color, height, or animation speed, or by adding a tooltip that shows the exact percentage as a floating label. It is a great starting point for anyone looking to add subtle but effective reading progress indicators to a web project.

Was this prompt helpful?

Comments

Comments appear after moderation

この記事が役に立ったら投げ銭で応援

Apple Pay / Google Pay / カード (Visa/Mastercard/JCB/Amex) / Link / Alipay / WeChat Pay 対応 · Stripeで安全に決済

開発者が選ぶ最強ツール集

運営者が毎日使っているツール・ガジェット 6選

見る
Homeヘルプ