JSFiddle - React, Tailwind, and code Playground
JavaScript
// aircraft moover
$('.s-quest-section').mousemove(function(e) {
var mX = e.clientX;
var mY = e.clientX;
var mpHeight = $('.s-quest-section').height();
var mpWidth = $('.s-quest-section').width();
if (mX < mpWidth/2) {
mX = e.clientX - mpWidth/2;
} else {
mX = e.clientX - mpWidth/2;
}
if (mY < mpHeight/2) {
mY = e.clientY - mpHeight/2;
} else {
mY = e.clientY - mpHeight/2;
}
$('.s-quest-section .sqs-aircraft').css({
"transform" : "translateX(" + -mX/54 + "px) translateY(" + -mY/54 + "px)"
});
});