JSFiddle - React, Tailwind, and code Playground

HTML

<div class="layer1"></div>
<div class="layer2"></div>
<div class="layer3"></div>


<div class="layer1-shadow"></div>
<div class="layer2-shadow"></div>
<div class="layer3-shadow"></div>

CSS

html,body{height:100%;min-height:100%;overflow:hidden}
div{position:absolute;opacity:0.3}
.layer1{background:red;width:300px;height:150px;top:200px;left:300px}
.layer2{background:green;width:100px;height:200px;top:300px;left:900px}
.layer3{background:blue;width:50px;height:50px;top:550px;left:100px}
.layer1-shadow{background:#ccc;width:300px;height:150px;top:200px;left:300px}
.layer2-shadow{background:#ccc;width:100px;height:200px;top:300px;left:900px}
.layer3-shadow{background:#ccc;width:50px;height:50px;top:550px;left:100px}

JavaScript

(function($){
    $.fn.plaxmove = function(options) {

        this.defaults = {
            ratioH: 0.2,
            ratioV: 0.2,
            reversed: false
        }

        var settings = $.extend({},this.defaults,options),
            layer = $(this),
            center = {
                x: $('html').width()/2-layer.width()/2,
                y: $('html').height()/2-layer.height()/2
            },
            y0 = layer.offset().top,
            x0 = layer.offset().left;

        var eqH = function(e) {
            return x0+(e.pageX - center.x)*settings.ratioH
        }

        var eqW = function(e) {
            return y0+(e.pageY - center.y)*settings.ratioV
        }        

        if(settings.reversed) {
                var t = eqH; eqH = eqW; eqW = t;
        }
        
        $('html').on('mousemove', function(e) {

                x = eqH(e)
                y = eqW(e)

                $(layer).css({top:y,left:x})

        })

    };
})(jQuery);

$(function(){
    $('.layer1').plaxmove()
    $('.layer2').plaxmove({ratioW: 0.4,reversed:true})
    $('.layer3').plaxmove({ratioH: -0.6})
});