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") var Cookie = document.createElement("div")

// HTML

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

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(Cookie) 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)" } } }

// 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 } }