I'm trying to make a site with a fixed navbar. The navbar will have a transparent background. I want to make the color of the text in the navbar to change based on the section of the site the user is looking at.
Let's say that the site starts by loading into a white page. The text in the navbar should start off by being black so that the user is able to read the text.
The user then scrolls to the next part of the webpage. Let's say that this part of the page is black. The text in the navbar should be white so that the user is able to read the text.
How do I do this? Do I need to use an event listener?