EZ Navigation - always updating

Replace old links & add new links for easier navigation.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         EZ Navigation - always updating
// @version      1.2
// @description  Replace old links & add new links for easier navigation.
// @author       Misery / bukubanz#9152
// @include      https://fairview.deadfrontier.com/*
// @grant        none
// @namespace
// @license MIT
// @namespace https://greasyfork.org/users/1264034
// ==/UserScript==

(function() {
    var navigationLinks = [
        { name: "Outpost", imgSrc: "https://i.imgur.com/O3oqMPN.png", link: "https://fairview.deadfrontier.com/onlinezombiemmo/index.php" },
        { name: "Credit Shop", imgSrc: "https://i.imgur.com/OI9zSwX.png", link: "https://fairview.deadfrontier.com/onlinezombiemmo/index.php?page=28" },
        { name: "Forum", imgSrc: "https://i.imgur.com/vWR4foN.png", link: "https://fairview.deadfrontier.com/onlinezombiemmo/index.php?action=forum" },
        { name: "Market", imgSrc: "https://i.imgur.com/GxniNWY.png", link: "https://fairview.deadfrontier.com/onlinezombiemmo/index.php?page=35" },
        { name: "Bank", imgSrc: "https://i.imgur.com/ZfFSTkE.png", link: "https://fairview.deadfrontier.com/onlinezombiemmo/index.php?page=15" },
        { name: "Storage", imgSrc: "https://i.imgur.com/4Y5Zsiz.png", link: "https://fairview.deadfrontier.com/onlinezombiemmo/index.php?page=50" },
        { name: "Logout", imgSrc: "https://i.imgur.com/hRgTcyV.png", link: getLogoutLink() },
        { name: "Profile", imgSrc: "https://i.imgur.com/cTQxxz4.png", link: "https://fairview.deadfrontier.com/onlinezombiemmo/index.php?action=profile" },
        { name: "The Yard", imgSrc: "https://i.imgur.com/ynkDl0H.png", link: "https://fairview.deadfrontier.com/onlinezombiemmo/index.php?page=24" }
    ];

    function createLinkElement(linkInfo) {
        var img = document.createElement("img");
        img.src = linkInfo.imgSrc;
        img.height = "60";

        var link = document.createElement("a");
        link.href = linkInfo.link;
        link.appendChild(img);

        return link;
    }

    function getLogoutLink() {
        return $("img[name=logout]").parent()[0].href;
    }

    var navigationContainer = document.createElement("div");
    navigationContainer.id = "navigation_holder";
    navigationContainer.style.overflow = "hidden";

    navigationLinks.forEach(function(linkInfo) {
        var linkElement = createLinkElement(linkInfo);
        linkElement.style.float = linkInfo.name === "Logout" ? "right" : "left";
        linkElement.style.textAlign = "center";
        linkElement.style.marginLeft = linkInfo.name === "Logout" ? "-6px" : "-13px";

        navigationContainer.appendChild(linkElement);
    });

    var table = document.getElementsByTagName("table")[6];
    table.innerHTML = ""; // Clear the table contents
    table.appendChild(navigationContainer);
    table.style.backgroundImage = "url()";
    table.style.transform = "scaleY(1.2)";
    table.style.position = "relative";
    table.style.top = "0px";

    var cookieCrumbleRow = document.getElementsByTagName("tr")[1];
    cookieCrumbleRow.style.height = "220px";
})();