issue creating a selection on scroll interactive animation

What I'm trying to do:
Create a scroll-based interactive animation where items are automatically selected when they scroll close to the center of the viewport, similar to Brilliant apps pattern.

Current setup:

  • Nested components inside a scroll animation

  • Want to fire a selection event listener when a nested component reaches the center of the screen


What I've tried:

  • Tying blend modes to scroll value inputs to toggle state as items approach center

  • This approach isn't working as expected


Questions:

  1. What's the best way to detect when a nested component reaches viewport center during scroll?

  2. Should I use Intersection Observer, scroll event listeners, or a different approach?

  3. How can I reliably trigger state changes based on proximity to center?