JSFiddle - React, Tailwind, and code Playground

by Maria

HTML

<div data-my-stuff="foobar" 
     style="height: 20000px"></div>

CSS

body {
    background-color: #000;
    background-image:url(http://testcollectivator.com/images/stars.png),
        url(http://testcollectivator.com/images/stars.png),
        url(http://testcollectivator.com/images/stars.png);
    background-position: 100px 0, 0 100px, 250px 200px;
}

JavaScript

window.addEventListener("scroll", function() {
    var st = document.body.scrollTop;
    document.body.style.backgroundPosition = 100 + Math.sin(st/5)*20 + "px 0,"+ "0 " + Math.floor(100 - 1.5*st) + "px,"+ "250px " + Math.floor(200-4*st) + "px";
});