JSFiddle - React, Tailwind, and code Playground
by namuol
HTML
<div id='container'>
<img id='bg' src='http://i.imgur.com/A0lSRQd.png' />
</div>
<img id='fg' src='http://i.imgur.com/D6gndIp.png' />
CSS
html,body {
overflow: hidden;
}
#container {
width: 803px;
height: 426px;
margin: 150px auto;
}
#fg {
position: fixed;
}
JavaScript
$(function() {
$('body').mousemove(function(e) {
$('#fg').offset({
left: e.pageX - $('#fg').width()/2,
top: e.pageY - $('#fg').height()/2
});
});
});