Greasy Fork

Greasy Fork is available in English.

ESJ Zone:移动版通知

在移动版界面显示通知标志。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name               ESJ Zone: Notifications on Mobile
// @name:zh-TW         ESJ Zone:流動版通知
// @name:zh-CN         ESJ Zone:移动版通知
// @description        Enable notification dot on mobile UI.
// @description:zh-TW  在流動版界面顯示通知徽章。
// @description:zh-CN  在移动版界面显示通知标志。
// @icon               https://icons.duckduckgo.com/ip3/www.esjzone.cc.ico
// @author             Jason Kwok
// @namespace          https://jasonhk.dev/
// @version            1.2.0
// @license            MIT
// @match              https://www.esjzone.cc/*
// @match              https://www.esjzone.me/*
// @match              https://www.esjzone.one/*
// @run-at             document-end
// @grant              none
// @require            https://update.greasyfork.icu/scripts/483122/1304475/style-shims.js
// @supportURL         http://greasyfork.icu/scripts/481323/feedback
// ==/UserScript==

GM.addStyle(`
    @media (max-width: 991px)
    {
        .site-branding .account-msg::after
        {
            display: block;
            position: absolute;
            top: 10px;
            left: 54px;
            border-width: 1px;
            border-radius: 50%;
            width: 10px;
            height: 10px;
            content: " ";
            background: #fd3995;
        }
    }

    @media (max-width: 576px)
    {
        .site-branding .account-msg::after
        {
            left: 41px;
        }
    }

    #mobile-menu .account-msg::after
    {
        display: block;
        position: absolute;
        top: 5px;
        left: 45px;
        border-width: 1px;
        border-radius: 50%;
        width: 10px;
        height: 10px;
        content: " ";
        background: #fd3995;
    }
`);

const accountButton = document.querySelector(".tools .account");
if (accountButton.classList.contains("account-msg"))
{
    const menuToggle = document.querySelector(".site-branding .menu-toggle");
    menuToggle.classList.add("account-msg");

    const memberMenuToggle = document.querySelector("#mobile-menu .menu li:nth-child(2) .sub-menu-toggle");
    memberMenuToggle.classList.add("account-msg");
}