Magnetic Button with Ripple Feedback
CODE PREVIEW
Prompt
Create a button with magnetic hover effect that follows cursor movement, and ripple animation feedback on click using GSAP for smooth animations.
このマイクロインタラクションボタンは、磁石効果のホバーと波紋フィードバックアニメーションを組み合わせています。ホバー時にカーソルの動きに追従する微妙な磁石効果により、魅力的なインタラクティブ体験を提供します。クリック時には、クリック地点から波紋アニメーションが広がり、明確な視覚的フィードバックを与えます。
実装にはスムーズで高性能なアニメーションのためにGSAPを使用しています。磁石効果は、カーソル位置をボタンに対して相対的に計算し、比例した変形を適用することで実現しています。波紋アニメーションはクリック地点から波状に拡大する効果を作り出します。
このパターンは、インタラクションをより応答性が高く満足感のあるものにすることでユーザーエクスペリエンスを向上させ、コールトゥアクションボタンや重要なインターフェース要素に最適です。
Prompt Overview
This microinteraction button combines magnetic hover effects with ripple feedback animations. The button follows cursor movement with a subtle magnetic pull when hovered, creating an engaging interactive experience. On click, a ripple animation emanates from the click point, providing clear visual feedback.
The implementation uses GSAP for smooth, performant animations. The magnetic effect is achieved by calculating cursor position relative to the button and applying proportional transforms. The ripple animation creates a wave-like expansion from the click location.
This pattern enhances user experience by making interactions feel more responsive and satisfying, perfect for call-to-action buttons or important interface elements.
Was this prompt helpful?
Comments
Comments appear after moderation
この記事が役に立ったら投げ銭で応援
Apple Pay / Google Pay / カード (Visa/Mastercard/JCB/Amex) / Link / Alipay / WeChat Pay 対応 · Stripeで安全に決済
開発者が選ぶ最強ツール集
運営者が毎日使っているツール・ガジェット 6選