Neopets Custom Navigation

Adds a custom navigation to the new pages

// ==UserScript==
// @name         Neopets Custom Navigation
// @namespace    http://www.neopets.com/
// @version      1.0
// @description  Adds a custom navigation to the new pages
// @author       Bryan
// @license      MIT
// @match        https://www.neopets.com/*
// @grant        GM_addStyle
// ==/UserScript==

(function() {
    'use strict';

    // CSS styles for the custom navigation buttons
    var buttonStyles = `
        .neopets-nav-buttons-container {
            margin-top: 10px;
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            align-items: center;
            text-align: center;
        }

        .neopets-nav-buttons-container .neopets-nav-buttons {
            max-width: 800px;
            margin: 0 auto;
        }

        .neopets-nav-buttons-container .neopets-nav-buttons a {
            display: inline-block;
            padding: 4px 8px;
            margin: 2px;
            font-size: 12px;
            font-weight: bold;
            text-decoration: none;
            color: #000;
            background-color: #f1f1f1;
            border: 2px solid #ccc;
            border-radius: 0;
            transition: background-color 0.3s, border-color 0.3s;
            max-width: 200px;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .neopets-nav-buttons-container .neopets-nav-buttons a:hover {
            background-color: #ccc;
            border-color: #999;
        }
    `;

    // Create the custom navigation buttons
    var customNavButtonsContainer = document.createElement('div');
    customNavButtonsContainer.className = 'neopets-nav-buttons-container';

    var customNavButtons = document.createElement('div');
    customNavButtons.className = 'neopets-nav-buttons';
    customNavButtons.innerHTML = `
        <a href="https://www.neopets.com/objects.phtml">Neopia Central</a>
        <a href="https://www.neopets.com/market_bazaar.phtml">Bazaar</a>
        <a href="https://www.neopets.com/market_plaza.phtml">Plaza</a>
        <a href="https://www.neopets.com/market_map.phtml">Marketplace</a>
        <a href="https://www.neopets.com/market.phtml?type=wizard">Shop Wizard</a>
        <a href="https://www.neopets.com/auctions.phtml">Auctions</a>
        <a href="https://www.neopets.com/island/tradingpost.phtml">Trading Post</a>
        <a href="https://www.neopets.com/inventory.phtml">Inventory</a>
        <a href="https://www.neopets.com/closet.phtml">Closet</a>
        <a href="https://www.neopets.com/safetydeposit.phtml">Safety Deposit Box</a>
        <a href="https://www.neopets.com/bank.phtml">Bank</a>
        <a href="https://www.neopets.com/market.phtml?type=your">Your Shop</a>
        <a href="https://www.neopets.com/battledome/battledome.phtml">Battledome</a>
        <a href="https://www.neopets.com/guilds/index.phtml">Guild Headquarters</a>
        <a href="https://www.neopets.com/noticeboard.phtml">Notice Board</a>
        <a href="https://www.neopets.com/neohome/">Neohomes</a>
        <a href="https://www.neopets.com/neohome/shed">Storage Shed</a>
        <a href="https://www.neopets.com/neoboards/preferences.phtml">Neoboards Preferences</a>
        <a href="https://www.neopets.com/lab2.phtml">Laboratory</a>
        <a href="https://www.neopets.com/prehistoric/battleground/">Obelisk War</a>
        <a href="https://www.neopets.com/~aureihu74952">Top Battlers</a>
    `;

    customNavButtonsContainer.appendChild(customNavButtons);

    // Insert the custom navigation buttons after the target element
    var targetElement = document.getElementById('navsub-buffer__2020');
    if (targetElement) {
        targetElement.insertAdjacentElement('afterend', customNavButtonsContainer);

        // Inject the button styles
        GM_addStyle(buttonStyles);
    }
})();