How to Create Scroll Indicator using HTML CSS and JavaScript ?

Scroll Indicator is a progress bar that represents how much a page has been scrolled. When we scroll down the bar fills up and when we scroll up the bar amount reduces.

scroll indicator

See the Pen Scroll Indicator by Mohd Usman (@ekjunoon) on CodePen.