1// JavaScript Document 2$(document).ready(function(){ 3 // Determine position of mouse 4 var currentMousePos = { x: -1, y: -1 }; 5 $(document).mousemove(function(event) { 6 // Find width and height of browser 7 var windowWidth = $(window).width(); 8 var windowHeight = $(window).height(); 9 // Find X and Y coordinates of the mouse 10 currentMousePos.x = event.pageX; 11 currentMousePos.y = event.pageY; 12 // Attach vertical line to X position and horizontal line Y position 13 $('#verticalLine').css('left', event.pageX); 14 $('#horizontalLine').css('top', event.clientY); 15 // Get percentage of mouse position in relation to total width and height 16 var mousePercentageX = currentMousePos.x / windowWidth * 100; 17 var mousePercentageY = currentMousePos.y / windowHeight * 100; 18 // Tilt Galaxy Type 19 if ($('body').hasClass('galaxy')) { 20 // Define Range 21 var rangeX = mousePercentageX - 50 + 'deg'; 22 var rangeY = -(mousePercentageY - 50) + 'deg'; 23 // Define Perspective 24 var perspective = windowWidth + 'px'; 25 var tilting = 'rotateY(' + rangeX + ') rotateX(' + rangeY + ')'; 26 $('#perspective').css('perspective', perspective); 27 $('#tilter').css('transform', tilting); 28 } else if ($('body').hasClass('clouds')) { 29 // Define range 30 var factor = 3; 31 var rangeX = mousePercentageX / factor - (100 / (factor * 2)) + 'px'; 32 var rangeY = mousePercentageY / factor - (100 / (factor * 2)) + 'px'; 33 // Apply CSS 34 $('.contactContent').css('margin-top',rangeY).css('margin-left',rangeX); 35 } 36 }); 37});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.