User:Williek11/global.js

// Variables

var WhatIsIt = 0 var AdHid = 1 var WikiaBarHid = 0 var WidthIsIt = 0 var Website = window.location.origin var BodyTag = document.getElementsByTagName("body")[0]

// Create Element

var GearBackground = document.createElement("div") var GearBehind = document.createElement("div") var Gear = document.createElement("div") var SideBar = document.createElement("div") var RGBA = document.createElement("div") var BackgroundComplement = document.createElement("div") var BackgroundComplementSecond = document.createElement("div")

// HTML

GearBackground.innerHTML = ' '

GearBehind.style = "background-color: rgb(69, 43, 32);border: 5px solid rgb(54, 33, 25);border-radius:50px;padding:20px;position:fixed;display:block;right:30px;bottom:50px;z-index:999997" GearBehind.className = "GearBehind" GearBehind.innerHTML = '       '

Gear.style = 'background-color: rgb(69, 43, 32);background-image:url(https://static.wikia.nocookie.net/3b0de2fc-bfda-417b-af86-09a6a1bb4e31/scale-to-width-down/40);border: 5px solid rgb(54, 33, 25);border-radius:50%;padding:20px;position:fixed;display:block;right:30px;bottom:50px;z-index:1000000'

var HeaderSideBar = '' var SetupSideBar = ' ' SideBar.style = "background: rgb(66, 46, 36);width: 500px;height: 500px;z-index: 500000;position: fixed;top: 90px;color: rgb(255, 255, 255);box-shadow: rgb(0, 0, 0) 0px 0px 50px;border: 5px solid rgb(51, 35, 27);overflow: auto;display:inline-block;border-radius: 20px;left: calc(50% - 250px);" SideBar.innerHTML = HeaderSideBar + 'Customized Settings ' + SetupSideBar + 'Width make ThickShow AdsHide Wikia Bar ' + HeaderSideBar + 'Wikias and Social Media ' + SetupSideBar + 'FANDOM Requests</a></li>    Discord Requests</a></li>    Discord</a></li>    Starve.io Wiki</a></li>    ShootUp.io Wiki</a></li>    Global Forums</a></li>    Edit JS</a></li> '

RGBA.style = "background: rgba(0,0,0,.6);width: 100%;height: 100%;z-index: 499999;display: block;position: absolute;top: 0;color: #000;padding: 40px;right:0"

BackgroundComplement.style = "z-index: 999990;width: 150px;border: 5px solid rgb(54, 33, 25);background-color: rgb(69, 43, 32);position: fixed;padding: 40px;bottom: -10px;right:-90px"

BackgroundComplementSecond.style = "z-index: 999989;width: 135px;height:50px;border: 5px solid rgb(65, 40, 31);background-color: rgb(80, 51, 38);position: fixed;padding: 40px;bottom: -10px;right:-90px"

// Append

BodyTag.appendChild(GearBackground) BodyTag.appendChild(BackgroundComplement) BodyTag.appendChild(BackgroundComplementSecond) GearBackground.appendChild(GearBehind) GearBehind.appendChild(Gear)

// Animations (Attempt, atleast.)

Gear.addEventListener("mouseenter", GearRotateFunction) Gear.addEventListener("mouseleave", GearReverseRotate) Gear.addEventListener("click", SideBarHappens) RGBA.addEventListener("click", SideBarHide) GearBehind.addEventListener("mouseenter", GearAnimationFirst) GearBehind.addEventListener("mouseleave", GearReverse)

var GearPosition = 10 var GearFind = document.getElementsByClassName("GearBehind")[0]

function GearAnimationFirst { var GearIntervalStart = setInterval(GearAnimationStart, 1) var Counter = 0

function GearAnimationStart { if (GearPosition == 90 || addEventListener("mouseleave", GearReverse) || Counter == 90) { Counter = 0 clearInterval(GearIntervalStart) } else { Counter++ GearPosition++ GearFind.style.width = GearPosition + "px" } } }

function GearReverse { var GearIntervalReverse = setInterval(GearAnimationUndo, 1) var Counter = 0

function GearAnimationUndo { if (GearPosition == 0 || addEventListener("mouseenter", GearAnimationFirst) || Counter == 90) { Counter = 0 clearInterval(GearIntervalReverse) }   else { Counter++ GearPosition-- GearFind.style.width = GearPosition + "px" } } }

var CurrentGearRotation = 0

function GearRotateFunction { var GearInterval = setInterval(GearRotate, 1) var Counter = 0

function GearRotate { if (CurrentGearRotation == 360 || addEventListener("mouseleave", GearReverseRotate) || Counter == 90) { clearInterval(GearInterval) Counter = 0 } else { Counter++ CurrentGearRotation = CurrentGearRotation + 4 Gear.style.transform = "rotate(" + CurrentGearRotation + "deg)" } } }

function GearReverseRotate { var GearInterval = setInterval(GearReverseRot, 1) var Counter = 0

function GearReverseRot { if (CurrentGearRotation == 0 || addEventListener("mouseenter", GearRotateFunction) || Counter == 90) { clearInterval(GearInterval) Counter = 0 } else { Counter++ CurrentGearRotation = CurrentGearRotation - 4 Gear.style.transform = "rotate(" + CurrentGearRotation + "deg)" } } }

function GearReverseRot { if (CurrentGearRotation == 0 || addEventListener("mouseenter", GearRotateFunction) || Counter == 90) { clearInterval(GearInterval) Counter = 0 } else { Counter++ CurrentGearRotation = CurrentGearRotation - 4 Gear.style.transform = "rotate(" + CurrentGearRotation + "deg)" } }

// Functions

// Wikia function SideBarHappens { if (WhatIsIt == 0) { BodyTag.appendChild(SideBar) BodyTag.appendChild(RGBA) BodyTag.style.overflowY = "hidden" WhatIsIt = 1 } else { BodyTag.removeChild(SideBar) BodyTag.removeChild(RGBA) WhatIsIt = 0 BodyTag.style.overflowY = "auto" } }

function SideBarHide { BodyTag.removeChild(SideBar) BodyTag.removeChild(RGBA) WhatIsIt = 0 BodyTag.style.overflowY = "auto" }

function WidthChange { var a1 = document.getElementsByClassName("wds-community-header")[0] var a2 = document.getElementsByClassName("WikiaPage")[0] var a3 = document.getElementsByClassName("WidthChange")[0] if (WidthIsIt == 0) { a1.style.width = Number("100") + "%"; a2.style.width = Number("97") + "%"; a3.innerHTML = "Width make Thin" WidthIsIt = 1 } else { a1.style.width = Number("1066") + "px"; a2.style.width = Number("1024") + "px"; a3.innerHTML = "Width make Thick" WidthIsIt = 0 } }

function HideAd { var a1 = document.getElementById("bottomLeaderboardWrapper") var a2 = document.getElementById("WikiaTopAds") var a3 = document.getElementById("top-right-boxad-wrapper") var a4 = document.getElementsByClassName("HideAd")[0] if (AdHid == 0) { a1.style.display = "block" a2.style.display = "block" a3.style.display = "block" a4.innerHTML = "Hide Ads" AdHid = 1 } else { a1.style.display = "none" a2.style.display = "none" a3.style.display = "none" a4.innerHTML = "Show Ads" AdHid = 0 } }

function HideWikiaBar { var a1 = document.getElementById("WikiaBar") var a2 = document.getElementsByClassName("wds-global-navigation-wrapper")[0] var a3 = document.getElementsByClassName("HideWikiaBar")[0] if (WikiaBarHid == 0) { a1.style.display = "none" a2.style.display = "none" a3.innerHTML = "Display Wikia Bar" WikiaBarHid = 1 } else { a1.style.display = "block" a2.style.display = "block" a3.innerHTML = "Hide Wikia Bar" WikiaBarHid = 0 } }

// Cookies // Variables

var Round = Math.round var BodyTag = document.getElementsByTagName("body")[0] var MineAmt = 0 var FarmAmt = 0 var GrandmaAmt = 0 var CookieAmt = 0 var MiniSetup = "border: 5px solid rgb(54, 33, 25);background-color: rgb(69, 43, 32);width:65px;height:30px;position:fixed;left:-30px;border-radius:30px;text-align:right;padding-top:10px;z-index:999998" var MiniInnerSetup = '<span style = "position:relative;padding:10px;color:#fff;font-weight:700;font-size:15px' var GramEyeSetup = 'background:#4acfed;position:fixed;bottom:175px;height:10px;width:8px;border-radius:50%' var GramHairSetup = 'position:fixed;height:20px;width:20px;border-radius:50%;background:#' const ChocolateSetup = "background:#2e2118;width:10px;position:fixed;height:10px;border-radius:3px;" const TitleSetup = "Amount of cookies needed to buy it: "

BodyTag.style.marginLeft = 80 + "px"

// Documents

var Cookie = document.createElement("div") var CookieBckground = document.createElement("div") var MiniCookie = document.createElement("div") var SmallCookie = document.createElement("div")

var MiniGrandma = document.createElement("div") var SmallGrandma = document.createElement("div")

var MiniFarm = document.createElement("div") var SmallFarm = document.createElement("div")

var MiniMine = document.createElement("div") var SmallMine = document.createElement("div")

// Items and Cookies

var GrandmaCost = 50 var GrandmaCookieMakes = 0 var Grandma1 = 0

var FarmCost = 250 var FarmCookieMakes = 0 var Farm1 = 0

var MineCost = 1250 var MineCookieMakes = 0 var Mine1 = 0

var CookieAmt1 = 0 var CookieAmt2 = 0 var CookieAmt3 = 0 var CookieAmt4 = 0 var CookieAmt5 = 0

// HTML

MiniMine.style = MiniSetup + ";bottom:275px" MiniMine.innerHTML = MiniInnerSetup + '" class = "MineAmt">' + MineAmt + ' '

SmallMine.title = TitleSetup + MineCost SmallMine.style = "background:#402818;position:fixed;border-radius:0 30px 10px 0;width:30px;height:30px;position:fixed;bottom:280px;left:-2px;z-index:999998;border:5px solid #332013" SmallMine.innerHTML = '<div style = "background:#402818;position:fixed;border-radius:30px;width:30px;height:30px;position:fixed;bottom:288px;left:-10px;z-index:999999;border:5px solid #332013"><div style = "background:#1f130b;position:fixed;width:25px;height:20px;position:fixed;bottom:280px;left:4px;z-index:999999"><div style = "background:#331e13;position:fixed;width:2px;height:20px;position:fixed;bottom:280px;left:4px;z-index:999999;border:2px #2e1c11 solid""> <div style = "background:#331e13;position:fixed;width:2px;height:20px;position:fixed;bottom:280px;left:25px;z-index:999999;border:2px #2e1c11 solid"> <div style = "background:#331e13;position:fixed;width:25px;height:2px;position:fixed;bottom:300px;left:4px;z-index:999999;border:2px #2e1c11 solid"">  '

MiniFarm.style = MiniSetup + ";bottom:215px" MiniFarm.innerHTML = MiniInnerSetup + '" class = "FarmAmt">' + FarmAmt + ' '

SmallFarm.title = TitleSetup + FarmCost SmallFarm.style = "background:#755c4c;position:fixed;border-radius:30px;border:5px solid #524035;width:30px;height:30px;position:fixed;bottom:220px;left:-2px;z-index:999999"

MiniGrandma.style = MiniSetup + ";bottom:155px" MiniGrandma.innerHTML = MiniInnerSetup + '" class = "GrandmaAmt">' + GrandmaAmt + ' '

SmallGrandma.title = TitleSetup + GrandmaCost SmallGrandma.style = "background:#e6c493;position:fixed;border-radius:50%;border:5px solid #d9b889;width:30px;height:30px;position:fixed;bottom:160px;left:0;z-index:999999" SmallGrandma.innerHTML = '<div style = "' + GramEyeSetup + ';left:10px"> <div style = "' + GramEyeSetup + ';left:25px"> <div style = "' + GramHairSetup + 'b4b7b8;bottom:180px;left:25px"> <div style = "' + GramHairSetup + 'c5c8c9;bottom:185px;left:10px"> <div style = "' + GramHairSetup + 'd4d8d9;bottom:180px;left:-5px"> '

MiniCookie.style = MiniSetup + ';bottom:95px' MiniCookie.innerHTML = MiniInnerSetup + '" class = "CookieAmt">' + CookieAmt + ' '

SmallCookie.style = "background:#6e4c30;bottom:10px;position:fixed;border-radius:50%;border:5px solid #61422c;width:30px;height:30px;position:fixed;bottom:100px;left:-2px;z-index:999999" SmallCookie.innerHTML = '<div style = "' + ChocolateSetup + 'bottom:115px;left:15px"> '

CookieBckground.style = 'border: 5px solid rgb(54, 33, 25);background-color: rgb(69, 43, 32);width:80px;height:100%;left:-10px;bottom:0px;position:fixed;z-index:999997'

Cookie.style = "border: 5px solid rgb(54, 33, 25);background-color: rgb(69, 43, 32);border-radius:0 50px 0 0;width:150px;height:80px;left:-30px;bottom:-30px;position:fixed;z-index:999998"

Cookie.innerHTML = '<div style = "background:rgb(54, 33, 25);width:70px;height:70px;left:5px;bottom:5px;position:fixed;border-radius:50%;border:5px solid rgb(54, 33, 25);z-index:999999"><div style = "background:#6e4c30;width:60px;height:60px;left:10px;bottom:10px;position:fixed;border-radius:50%;border:5px solid #61422c"><div style = "' + ChocolateSetup + 'bottom:50px;left:50px"> <div style = "' + ChocolateSetup + 'bottom:35px;left:25px;"> <div style = "' + ChocolateSetup + 'bottom:20px;left:45px">  '

// Append

BodyTag.appendChild(CookieBckground) BodyTag.appendChild(Cookie) BodyTag.appendChild(MiniCookie) BodyTag.appendChild(SmallCookie)

BodyTag.appendChild(MiniGrandma) BodyTag.appendChild(SmallGrandma)

BodyTag.appendChild(MiniFarm) BodyTag.appendChild(SmallFarm)

BodyTag.appendChild(MiniMine) BodyTag.appendChild(SmallMine)

// Events

Cookie.addEventListener("click", CookieAdd) MiniCookie.addEventListener("mouseenter", CookieThicken) MiniCookie.addEventListener("click", CookieUnThicken)

SmallGrandma.addEventListener("click", GrandmaAdd) MiniGrandma.addEventListener("mouseenter", GrandmaThicken) MiniGrandma.addEventListener("click", GrandmaUnThicken)

SmallFarm.addEventListener("click", FarmAdd) MiniFarm.addEventListener("mouseenter", FarmThicken) MiniFarm.addEventListener("click", FarmUnThicken)

SmallMine.addEventListener("click", MineAdd) MiniMine.addEventListener("mouseenter", MineThicken) MiniMine.addEventListener("click", MineUnThicken)

// Animation

var CookieRegister = document.getElementsByClassName("CookieAmt")[0] var CookieWidth = 65

function CookieThicken { var CookieInterval = setInterval(CookieThickenAnimation, 1) var Counter = 0 function CookieThickenAnimation { if (CookieWidth == 150 || Counter == 150) { clearInterval(CookieInterval) } else { Counter++ CookieWidth++ MiniCookie.style.width = CookieWidth + "px" } } }

function CookieUnThicken { var CookieInterval = setInterval(CookieUnThickenAnimation, 1) var Counter = 0 function CookieUnThickenAnimation { if (CookieWidth == 65 || Counter == 300) { clearInterval(CookieInterval) } else { Counter++ CookieWidth-- MiniCookie.style.width = CookieWidth + "px" } } }

var GrandmaRegister = document.getElementsByClassName("GrandmaAmt")[0] var GrandmaWidth = 65

function GrandmaThicken { var GrandmaInterval = setInterval(GrandmaThickenAnimation, 1) var Counter = 0 function GrandmaThickenAnimation { if (GrandmaWidth == 150 || Counter == 150) { clearInterval(GrandmaInterval) } else { Counter++ GrandmaWidth++ MiniGrandma.style.width = GrandmaWidth + "px" } } }

function GrandmaUnThicken { var GrandmaInterval = setInterval(GrandmaUnThickenAnimation, 1) var Counter = 0 function GrandmaUnThickenAnimation { if (GrandmaWidth == 65 || Counter == 300) { clearInterval(GrandmaInterval) } else { Counter++ GrandmaWidth-- MiniGrandma.style.width = GrandmaWidth + "px" } } }

var FarmRegister = document.getElementsByClassName("FarmAmt")[0] var FarmWidth = 65

function FarmThicken { var FarmInterval = setInterval(FarmThickenAnimation, 1) var Counter = 0 function FarmThickenAnimation { if (FarmWidth == 150 || Counter == 150) { clearInterval(FarmInterval) } else { Counter++ FarmWidth++ MiniFarm.style.width = FarmWidth + "px" } } }

function FarmUnThicken { var FarmInterval = setInterval(FarmUnThickenAnimation, 1) var Counter = 0 function FarmUnThickenAnimation { if (FarmWidth == 65 || Counter == 300) { clearInterval(FarmInterval) } else { Counter++ FarmWidth-- MiniFarm.style.width = FarmWidth + "px" } } }

var MineRegister = document.getElementsByClassName("MineAmt")[0] var MineWidth = 65

function MineThicken { var MineInterval = setInterval(MineThickenAnimation, 1) var Counter = 0 function MineThickenAnimation { if (MineWidth == 150 || Counter == 150) { clearInterval(MineInterval) } else { Counter++ MineWidth++ MiniMine.style.width = MineWidth + "px" } } }

function MineUnThicken { var MineInterval = setInterval(MineUnThickenAnimation, 1) var Counter = 0 function MineUnThickenAnimation { if (MineWidth == 65 || Counter == 300) { clearInterval(MineInterval) } else { Counter++ MineWidth-- MiniMine.style.width = MineWidth + "px" } } }

// Functions

function MineAdd { if (CookieAmt > MineCost - 1) { CookieAmt4 = CookieAmt - MineCost CookieAmt = Round(CookieAmt4) CookieAmt4 = 0 CookieRegister.innerHTML = CookieAmt Mine1 = MineCost * 1.2 MineCost = Round(Mine1) SmallMine.title = TitleSetup + MineCost MineAmt++ MineRegister.innerHTML = MineAmt } else {} }

function FarmAdd { if (CookieAmt > FarmCost - 1) { CookieAmt3 = CookieAmt - FarmCost CookieAmt = Round(CookieAmt3) CookieAmt3 = 0 CookieRegister.innerHTML = CookieAmt Farm1 = FarmCost * 1.2 FarmCost = Round(Farm1) SmallFarm.title = TitleSetup + FarmCost FarmAmt++ FarmRegister.innerHTML = FarmAmt } else {} }

function GrandmaAdd { if (CookieAmt > GrandmaCost - 1) { CookieAmt2 = CookieAmt - GrandmaCost CookieAmt = Round(CookieAmt2) CookieAmt2 = 0 CookieRegister.innerHTML = CookieAmt Grandma1 = GrandmaCost * 1.2 GrandmaCost = Round(Grandma1) SmallGrandma.title = TitleSetup + GrandmaCost GrandmaAmt++ GrandmaRegister.innerHTML = GrandmaAmt } else {} }

function CookieAdd { CookieAmt++ CookieRegister.innerHTML = CookieAmt }

setInterval(AddCookies, 500) function AddCookies { GrandmaCookieMakes = GrandmaAmt * 1.25 FarmCookieMakes = FarmAmt * 3 MineCookieMakes = MineAmt * 15 CookieAmt1 = CookieAmt + FarmCookieMakes + GrandmaCookieMakes + MineCookieMakes CookieAmt = Round(CookieAmt1) CookieAmt1 = 0 CookieRegister.innerHTML = CookieAmt }