Lenis Smooth Scroll with Scroll-Triggered Element Transformations
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 rewrites this code based on your instructions. Preview is free; copy & download unlocked for ¥100.
AIとの対話に追加する一言
プロンプトと一緒にコピーして、AIがより正確に意図を汲み取れるようにします
このコードをそのまま使いたいので、CDNリンクも含めた完全なHTMLファイルとして出力してください。
初心者なので、各行にコメントを追加して、何をしているか説明してください。
このコードをWordPressのテーマに組み込む方法も教えてください。
動作確認済みのコードをお願いします。エラーが出る場合の対処法も含めて。
This implementation demonstrates Lenis smooth scrolling with scroll-triggered element transformations. The page features a gradient background with a fixed scroll progress indicator at the top. Four distinct sections each contain a card that transforms based on scroll position: scaling, rotating, changing opacity, and a combination of all three.
The Lenis library provides buttery-smooth scrolling, while GSAP powers the animations. Each card has a unique transformation tied to scroll progress, creating an engaging interactive experience. The scroll progress bar visually indicates your position on the page.
Transformations are calculated based on the element's position relative to the viewport, creating seamless animations that respond to user scrolling. The implementation is responsive and works across different screen sizes.
Was this prompt helpful?
Comments
Comments appear after moderation
この記事が役に立ったら投げ銭で応援
Apple Pay / Google Pay / クレジットカード対応 · Stripeで安全に決済
開発者が選ぶ最強ツール集
運営者が毎日使っているツール・ガジェット 6選