JSFiddle - React, Tailwind, and code Playground

HTML

<div id="cont">
    <div id="progress"></div>
</div>

CSS

html {
    height: 1000px;
}
#cont {
    width: 5px;
    height: 200px;
    position: fixed;
    top:0;
    border: 1px solid #000;
}
#progress {
    background: #F00;
    height: 0%;
}

JavaScript

$(window).scroll(function(){
    var ratio = $(document).scrollTop()/(($(document).height() - $(window).height()) / 100);
    $("#progress").height(ratio+"%");
});