Blenra
Optimized for: Gemini / ChatGPT / Claude

Advanced Prompt for Magnetic Scroll Snapping Logic

Use this engineered prompt to drastically optimize your workflow and output.

Required Variables

  • [SNAP_POINTS_ARRAY]
  • [SNAP_STRENGTH]
  • [DIRECTION]
  • [CALLBACK_FUNCTION]
magnetic-scroll-snapping-framer-motion.txt
Develop a custom scroll snapping engine in React using Framer Motion. Instead of native CSS snap, use useScroll and useAnimate to create a 'magnetic' effect where the scroll position is pulled toward [SNAP_POINTS_ARRAY] when the user stops scrolling near them. Calculate the proximity based on [SNAP_STRENGTH]. Support [DIRECTION] (vertical/horizontal). Execute a [CALLBACK_FUNCTION] whenever a snap event completes to update the application state (e.g., current slide index). Ensure the logic accounts for momentum and doesn't interfere with natural browser scrolling behavior for accessibility.

Example Output

"The AI will provide a complex React hook and wrapper that programmatically 'snaps' the scroll position to specific elements with custom easing and callbacks."