How to create the sticky navigation like this

you can see as you scroll the website, the navigation stays and changes background.
Can this be created in Blocs with some custom script?