No Dating Sim for Me

Removes Tears of Themis from HoYoLAB search and home menu.

// ==UserScript==
// @name         No Dating Sim for Me
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Removes Tears of Themis from HoYoLAB search and home menu.
// @match        https://www.hoyolab.com/*
// @grant        none
// @icon         https://webstatic.hoyoverse.com/upload/op-public/2021/04/12/bbeb16029152ef690abb1d41dd1a8f78_7756606814264622244.png
// ==/UserScript==

(function() {
    'use strict';

    function removeGameItem() {
        const homeItems = document.querySelectorAll("li.game-item.active");
        homeItems.forEach(item => {
            if (item.textContent.includes("Tears of Themis")) {
                item.style.display = "none";
            }
        });
        const searchItems = document.querySelectorAll("li.mhy-selectmenu__item");
        searchItems.forEach(item => {
            if (item.querySelector(".mhy-selectmenu__label")?.textContent.trim() === "TearsofThemis") {
                item.style.display = "none";
            }
        });
    }
    removeGameItem();
    const observer = new MutationObserver(removeGameItem);
    observer.observe(document.body, { childList: true, subtree: true });
})();