How to make a Nav Bar that changes between each section?


I’m trying to make a nav bar similar to the one on the right side of this page:

I don’t want the fancy transitions between each work. I just want a function that as you scroll through the page the nav bar changes accordingly with the section that is been display. Maybe it changes is opacity.

I’m attaching a picture of the project I’m currently working on, maybe it will help to better understand.