User:Williek11/global.js

// Structure

// Variables

var WhatIsIt = 0 var AdHid = 1 var WikiaBarHid = 0 var WidthIsIt = 0 var Website = window.location.origin

// HTML Creations

var GearBackground = document.createElement("div") GearBackground.innerHTML = ' '

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

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

document.getElementsByClassName("WikiaSiteWrapper")[0].appendChild(GearBackground) GearBackground.appendChild(GearBehind) GearBehind.appendChild(Gear)

var SideBar = document.createElement("div") SideBar.style = "background: #422e24;width: 300px;height: 1300px;z-index: 500000;display: block;position: fixed;top: 55px;color: #fff;box-shadow: 0 0 50px #000;border:5px #33231b solid;overflow:auto" SideBar.innerHTML = 'Customized Settings Width make ThickShow AdsHide Wikia Bar   Wikias and Social Media 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> '

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

var BackgroundComplement = document.createElement("div") 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" document.getElementsByTagName("body")[0].appendChild(BackgroundComplement)

// Animations (Attempt, atleast.)

Gear.addEventListener("click", SideBarHappens) GearBehind.addEventListener("mouseenter", GearAnimationFirst) GearBehind.addEventListener("mouseleave", GearReverse)

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

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

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

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

// Functions

// Wikia function SideBarHappens { if (WhatIsIt == 0) { document.getElementsByClassName("WikiaSiteWrapper")[0].appendChild(SideBar) document.getElementsByClassName("WikiaSiteWrapper")[0].appendChild(RGBA) document.getElementsByTagName("body")[0].style.overflowY = "hidden" WhatIsIt = 1 } else { document.getElementsByClassName("WikiaSiteWrapper")[0].removeChild(SideBar) document.getElementsByClassName("WikiaSiteWrapper")[0].removeChild(RGBA) WhatIsIt = 0 document.getElementsByTagName("body")[0].style.overflowY = "auto" } }

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

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

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