Lenis Smooth Scroll + Element Transform Animations Prompt
Prompt
Create a smooth scrolling experience using Lenis with scroll-triggered element transformations. Implement a vertical scroll container with multiple sections where elements (cards, images, text) transform (scale, rotate, opacity) based on scroll progress. Use GSAP for animations and include a visual scroll progress indicator.
CODE PREVIEW
AIとの対話に追加する一言
プロンプトと一緒にコピーして、AIがより正確に意図を汲み取れるようにします
このコードをそのまま使いたいので、CDNリンクも含めた完全なHTMLファイルとして出力してください。
初心者なので、各行にコメントを追加して、何をしているか説明してください。
このコードをWordPressのテーマに組み込む方法も教えてください。
動作確認済みのコードをお願いします。エラーが出る場合の対処法も含めて。
この実装は、スクロールトリガー要素変形付きLenisスムーズスクロールをデモンストレーションします。ページには上部に固定されたスクロール進捗インジケーターとグラデーションバックグラウンドがあります。4つの異なるセクションにはそれぞれ、スクロール位置に基づいて変形するカードが含まれています:スケーリング、回転、不透明度変化、および3つすべての組み合わせです。
Lenisライブラリは滑らかなスクロールを提供し、GSAPがアニメーションを駆動します。各カードはスクロール進捗に連動した独自の変形を持ち、魅力的なインタラクティブ体験を創出します。スクロール進捗バーはページ上の位置を視覚的に表示します。
変形はビューポートに対する要素の位置に基づいて計算され、ユーザーのスクロールに応答するシームレスなアニメーションを作成します。実装はレスポンシブで、異なる画面サイズで動作します。
Prompt Overview
This prompt is designed for front-end developers and creative coders who want to build high-quality scroll-driven animation experiences. By combining Lenis — a lightweight smooth-scroll library — with GSAP's powerful animation engine, the generated code demonstrates how page elements such as cards, images, and text blocks can dynamically scale, rotate, and fade based on the user's scroll position. A visual scroll progress indicator is also included, giving the final result a polished, production-ready feel.
This kind of prompt is especially useful when prototyping portfolio sites, agency landing pages, or interactive product showcases where motion design plays a central role. Because the output is self-contained code, developers can drop it directly into a project and customize easing curves, transform values, and section layouts to match their brand. For best results, use a model with strong JavaScript and DOM knowledge, such as GPT-4o or Claude 3.5 Sonnet, and try variations by swapping GSAP for the Web Animations API or by adding horizontal scroll sections.
Was this prompt helpful?
Comments
Comments appear after moderation
この記事が役に立ったら投げ銭で応援
Apple Pay / Google Pay / カード (Visa/Mastercard/JCB/Amex) / Link / Alipay / WeChat Pay 対応 · Stripeで安全に決済
開発者が選ぶ最強ツール集
運営者が毎日使っているツール・ガジェット 6選