JSFiddle - React, Tailwind, and code Playground
HTML
<div class="main"></div>
<div class="over"></div>
CSS
body {
padding:0px;
margin:0px;
overflow: hidden;
cursor: none;
}
.main {
background: url(http://wallarthd.com/wp-content/uploads/2014/08/Free-BMW-4-Series-Coupe-Wallpaper-HD.jpg) center center no-repeat;
background-size: cover;
width: 100%;
height: 100%;
position:absolute;
z-index:3;
}
.over {
background:url(http://ilrac.net/transparent.png) center center no-repeat;
background-size: 200%;
width: 100%;
height: 100%;
display: block;
position:absolute;
z-index: 5;
}
JavaScript
$('body').mousemove(function(event) {
var pagewidth = $( window ).width();
var pageheight = $( window ).height();
var movex = event.pageX - (pagewidth/2);
var movey = event.pageY - (pageheight/2);
$('.over').css({'background-position': ''+movex+'px '+movey+'px'});
$('.main').css({'background-position': ''+(movex/5)+'px '+(movey/5)+'px'});
console.log('left: '+movex+'px, '+movey+'px');
});