GifproGifpro

Smooth Scroll Navigation Prompt – AI-Generated Example

CODE PREVIEW

エディタを読み込み中…
P

Prompt

Create a navigation menu that smoothly scrolls to sections when clicked. Include visual feedback for the active section.

この実装では、固定ナビゲーションバーとページセクションへのスムーズスクロールを作成します。スクロールまたはクリック時にアクティブなセクションが視覚的に強調表示されます。

Prompt Overview

This prompt targets a classic front-end development task: building a navigation menu that smoothly scrolls the page to corresponding sections when a link is clicked, while also highlighting whichever section is currently in view. It is ideal for landing pages, portfolios, documentation sites, or any single-page layout where guiding users through content without full page reloads improves the overall experience.

To reproduce this effectively, use it with a code-generation model such as GPT-4o or Claude, specifying your preferred stack — vanilla JavaScript, React, or a CSS-only approach. You can extend the prompt by requesting an offset for fixed headers, a scroll-spy mechanism using the Intersection Observer API, or animated underline transitions on active nav items. The output typically includes clean, reusable HTML, CSS, and JavaScript that you can drop directly into an existing project with minimal adjustment.

Was this prompt helpful?

Comments

Comments appear after moderation

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

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

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

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

見る
Homeヘルプ