Blenra
Optimized for: Gemini / ChatGPT / Claude

Expert Prompt for Background Color Morphing Scroll Sections

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

Required Variables

  • [COLOR_PALETTE_ARRAY]
  • [SECTION_SELECTOR]
  • [TRANSITION_SMOOTHNESS]
background-color-morphing-scroll-sections.txt
You are a UI Engineer specializing in immersive web experiences. Create a React component wrapper that changes the global background color of the page as the user scrolls through different sections. Take an array of colors in [COLOR_PALETTE_ARRAY] and map them to the scroll position of each [SECTION_SELECTOR]. Use useScroll and useTransform with an input range corresponding to the index of the sections and an output range of the colors. Set the [TRANSITION_SMOOTHNESS] using a Framer Motion spring. Implement this efficiently by applying the background color to a fixed-position background div to avoid re-rendering the entire component tree.

Example Output

"The AI will generate a higher-order component or wrapper that smoothly blends the site's background color as different content blocks enter the viewport."