Lenis Smooth Scroll & Parallax Effect: AI Code Example
CODE PREVIEW
Prompt
Create a smooth scrolling webpage using Lenis library with multiple parallax sections. Each section should have a background image that moves at different speeds relative to the scroll, creating a depth effect. Include a progress indicator and navigation dots.
この実装は、Lenisを使用したスムーズスクロールとパララックス効果を紹介しています。4つの異なるセクションがあり、各セクションの背景画像はスクロールに対して異なる速度で動き、現実的な奥行き感を生み出します。上部のプログレスバーはスクロール位置を視覚的に表示し、右側のナビゲーションドットでセクション間を素早く移動できます。
Lenisはパフォーマンス最適化された滑らかなスクロールを提供し、パララックス効果はスクロール位置とセクションインデックスに基づいて計算されます。実装はレスポンシブで、デスクトップとモバイルデバイスの両方で良好に動作します。
Prompt Overview
This prompt is designed for front-end developers and creative coders who want to implement buttery-smooth scroll experiences with layered parallax depth effects. By leveraging the Lenis smooth-scroll library, the generated code produces a multi-section webpage where each section's background image moves at a distinct speed relative to the user's scroll position, creating a convincing sense of three-dimensional depth. A scroll progress indicator and clickable navigation dots are included out of the box, making the output immediately functional as a portfolio page, landing page prototype, or interactive showcase template.
This prompt works best with models capable of generating structured HTML, CSS, and JavaScript together — Claude or GPT-4o are strong choices. To adapt the output, try varying the number of sections, swapping placeholder image URLs for your own assets, or adjusting the parallax speed multipliers to fine-tune the depth illusion. You can also extend the prompt by requesting specific color schemes, section transitions, or mobile-responsive breakpoints to push the result closer to a production-ready component.
Was this prompt helpful?
Comments
Comments appear after moderation
この記事が役に立ったら投げ銭で応援
Apple Pay / Google Pay / カード (Visa/Mastercard/JCB/Amex) / Link / Alipay / WeChat Pay 対応 · Stripeで安全に決済
開発者が選ぶ最強ツール集
運営者が毎日使っているツール・ガジェット 6選