Optimized for: Gemini / ChatGPT / Claude
Expert AI Prompt for LayoutID Morphing on Scroll Trigger
Use this engineered prompt to drastically optimize your workflow and output.
Required Variables
- ✦
[START_ELEMENT] - ✦
[END_ELEMENT] - ✦
[TRIGGER_THRESHOLD] - ✦
[MORPH_DURATION]
layoutid-morphing-scroll-trigger-framer-motion.txt
Act as a Framer Motion specialist. Design a React component that uses the layoutId prop to morph between two different component states ([START_ELEMENT] and [END_ELEMENT]) when a specific [TRIGGER_THRESHOLD] of scroll is reached. Use an Intersection Observer or Framer Motion's onViewportEnter to toggle a state variable that triggers the shared layout animation. Ensure the transition is seamless across different DOM hierarchies. Include logic to handle the 'reverse' morphing when the user scrolls back up. Document how to handle potential layout shifts and overflow issues during the morph.
Example Output
"The AI will provide code that transforms a small thumbnail into a full-width header or card as the user reaches a specific scroll depth, using Framer Motion's layout projection."