JSFiddle - React, Tailwind, and code Playground
HTML
<div id="cover"></div>
<div class="image">
<img src="http://i.stack.imgur.com/6L6mk.png" />
</div>
CSS
html {
height: 2000px;
overflow-x: hidden;
}
.image {
position: fixed;
top: 0;
left: 0;
}
#cover {
width: 100%;
height: 200px;
background-color: white;
position: fixed;
top: 0;
z-index: 1000;
}
JavaScript
window.onscroll = function (event) {
var amount = window.pageYOffset + "px";
document.getElementById("cover").style.left = amount;
}