!function(a){a.fn.snakeify=function(b){var c=a.extend({inaccuracy:30,speed:200},b);this.find(".overlay").css({top:-9999999}),this.mouseenter(function(b){const d=a(this),e=d.find(".overlay"),f=d.offset(),g=b.pageX-f.left,h=b.pageY-f.top;e.css({top:0,left:0,width:d.width(),height:d.height()}),g>d.width()-c.inaccuracy?e.css({top:0,left:d.width()}):g<c.inaccuracy?e.css({top:0,left:-d.width()}):h>d.width()-c.inaccuracy?e.css({top:d.width(),left:0}):h<c.inaccuracy&&e.css({top:-d.width(),left:0}),e.animate({top:0,left:0},c.speed)}),this.mouseleave(function(b){const d=a(this),e=d.find(".overlay"),f=d.offset(),g=b.pageX-f.left,h=b.pageY-f.top;g<=0&&e.animate({top:0,left:-d.width()},c.speed),g>=d.width()&&e.animate({top:0,left:d.width()},c.speed),h<=0&&e.animate({left:0,top:-d.height()},c.speed),h>=d.height()&&e.animate({left:0,top:d.height()},c.speed)})}}(jQuery);