User:Robyn Grayson/wikia.js

$(function {    body = $('body');    body.mousemove(function(e) { $('#flashlight').css({          left: e.clientX-125,           top: e.clientY-125        }); });   body.append($(' ', {        id: 'flashlight',        css: {            'display': 'none',            'position': 'fixed',            'top': '30%',             'left': '30%',             'box-shadow': '0px 0px 20px 200em rgba(0, 0, 0, 0.7)',             'border-radius': '100%',            'z-index': '10000000',             'pointer-events': 'none',        },        append: [            $(' ', { css: { 'box-shadow': 'inset 0px 0px 50px 0px rgb(0, 0, 0)', 'border-radius': '100%', 'width': '250px', 'height': '250px', },           })        ]    }),    $(' ', {        id: 'boo',        css: {            'z-index': '9999999',             'position': 'fixed',            'top': 0,             'left': 0,            'display': 'none',        },        append: [            $(' ', { src: 'https://www.mariowiki.com/images/thumb/c/c7/BooMP8Official.png/180px-BooMP8Official.png', css: { 'width': '150px', 'transition': '1s', },           })        ]    }),    $(' ', {        id: 'boo2',        css: {            'z-index': '9999999',             'position': 'fixed',            'top': 30,             'left': 100,            'transform': 'scaleX(-1)',            'display': 'none',        },        append: [            $(' ', { src: 'https://www.mariowiki.com/images/thumb/c/c7/BooMP8Official.png/180px-BooMP8Official.png', css: { 'width': '150px', 'transition': '1s', },           })        ]    }));

$('#boo') .mouseover(function {            var shy = 'https://vignette.wikia.nocookie.net/robyns-little-land/images/7/7a/6cc410133d31fe42bb78ed363ee5b10831965ae3_00.png/revision/latest?cb=20171012064143';            $('#boo img').attr('src', shy);            $('#boo img').css('opacity', '0');        }) .mouseout(function {           var cheeky ='https://www.mariowiki.com/images/thumb/c/c7/BooMP8Official.png/180px-BooMP8Official.png';            $('#boo img').attr('src', cheeky);            $('#boo img').css('opacity', '1');        }); $('#boo2') .mouseover(function {            var shy = 'https://vignette.wikia.nocookie.net/robyns-little-land/images/7/7a/6cc410133d31fe42bb78ed363ee5b10831965ae3_00.png/revision/latest?cb=20171012064143';            $('#boo2 img').attr('src', shy);            $('#boo2 img').css('opacity', '0');        }) .mouseout(function {           var cheeky ='https://www.mariowiki.com/images/thumb/c/c7/BooMP8Official.png/180px-BooMP8Official.png';            $('#boo2 img').attr('src', cheeky);            $('#boo2 img').css('opacity', '1');        });

function makeNewPosition{ var h = $(window).height - 50; var w = $(window).width - 50; var nh = Math.floor(Math.random * h); var nw = Math.floor(Math.random * w); return [nh,nw]; }

function moveBoo{ var newq = makeNewPosition; var oldq = $('#boo').offset; var speed = calcSpeed([oldq.top, oldq.left], newq); $('#boo').animate({ top: newq[0], left: newq[1] }, speed, function{           moveBoo;                }); }

function calcSpeed(prev, next) { var x = Math.abs(prev[1] - next[1]); var y = Math.abs(prev[0] - next[0]); var greatest = x > y ? x : y;       var speedModifier = 0.15; var speed = Math.ceil(greatest/speedModifier); return speed; }   function moveNewPosition{ var h = $(window).height - 50; var w = $(window).width - 50; var nh = Math.floor(Math.random * h); var nw = Math.floor(Math.random * w); return [nh,nw]; }

function moveBoo2{ var newq = moveNewPosition; var oldq = $('#boo2').offset; var speed = calculateSpeed([oldq.top, oldq.left], newq); $('#boo2').animate({ top: newq[0], left: newq[1] }, speed, function{           moveBoo2;              }); }

function calculateSpeed(prev, next) { var x = Math.abs(prev[1] - next[1]); var y = Math.abs(prev[0] - next[0]); var greatest = x > y ? x : y;       var speedModifier = 0.15; var speed = Math.ceil(greatest/speedModifier); return speed; }   $('Off').appendTo('.wds-community-header__top-container .wds-community-header__wiki-buttons').click(function {        body.toggleClass('lightsOut');        if (body.hasClass('lightsOut')) {            $('#flashlight').fadeToggle;            $('#flashlightBtn').text('On');            $('#boo, #boo2').show;        } else {            $('#flashlight').fadeToggle;            $('#flashlightBtn').text('Off');            $('#boo, #boo2').hide;        }    }); moveBoo; moveBoo2; });

importScriptPage('User:Robyn Grayson/wikia.js', 'clockwork-planet');