JSFiddle - React, Tailwind, and code Playground

JavaScript

function scroll(y) {
        // remove the edge restrictions from the scroll
        offset = y; 
        
        view.style[xform] = 'translateY(' + (-offset) + 'px)';
        indicator.style[xform] = 'translateY(' + (offset * relative) + 'px)';
    }