In this tutorial, we’ll create a smooth background color transition effect triggered by scroll. As the user scrolls down the page, the background color will change (for example, from beige to black), and then revert back as they keep scrolling.
We’ll use GSAP animations via the Next Bricks Animator plugin inside Bricks Builder. This is a great way to bring subtle interactivity and a modern feel to your website.
A full step-by-step video is included below, and you can follow along using the written guide.
Step-by-step Guide
- Open your page inside Bricks Builder
- Wrap all content Sections inside one DIV
- Give that DIV a class, e.g. .body-div
- Set the default background color (e.g. beige) for this .body-div
Creating the First Scroll Animation (Light → Dark)
- Open the Next Bricks Animator panel
- Create a new Timeline inside a folder
- Set the Event to On Scroll
- Set Breakpoint: min 368px (to support mobile)
- Add the CSS ID of the Section where the color change should happen
- Set Scroll Position: Start: top center // End: top top
- Enable Scrub, and set it to 0.5
Add the Animation
- Target Element: .body-div
- Duration: 0.2
- Easing: None
- Method: From To
Set the background color transition
- From: the current color (e.g. beige)
- To: the new color (e.g. black)
Your first scroll-based color change is now ready!
🌓 Don’t Forget the Text Colors
If you’re switching from a light background to a dark one, make sure your text remains visible.
One trick: use Mix Blend Mode: Difference on your text elements — this way they adapt automatically to both backgrounds.
Creating the Reverse Timeline (Dark → Light)
To reverse the background color (e.g. from black back to beige):
- Duplicate the steps above
- Use a different Section ID as the new trigger
- In the animation settings, leave the From color empty
- Set only the To color (e.g. beige)
Now as users scroll through your page, the background color transitions smoothly between two (or more) colors, creating a dynamic experience without needing custom JavaScript, only Next Bricks Animator.