Neopets Event Icon Blocker

Blocks specific event icon on the Neopets homepage. Intended fir Christmas 2025.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Neopets Event Icon Blocker
// @namespace    http://tampermonkey.net/
// @version      1.0.0
// @description  Blocks specific event icon on the Neopets homepage. Intended fir Christmas 2025.
// @author       Logan Bell
// @match        https://www.neopets.com/home/
// @match        https://www.neopets.com/home/index.phtml
// @grant        none
// @run-at       document-idle
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Define the selector for the element you want to block.
    // This targets the main event icon container.
    const selectorToBlock = '.hp-event-icon';

    // Find the element in the DOM.
    const element = document.querySelector(selectorToBlock);

    if (element) {
        // Block the element by completely hiding it using 'display: none'.
        // If the element causes layout shift, you could alternatively use
        // element.remove(); to remove it completely from the DOM, but hiding is safer.
        element.style.display = 'none';

        // Log to console to confirm the script ran (optional)
        console.log(`[Neopets Event Blocker] Successfully hid element: ${selectorToBlock}`);
    } else {
        // Log to console if the element wasn't found (optional)
        console.log(`[Neopets Event Blocker] Element not found: ${selectorToBlock}`);
    }
})();