// ==UserScript== // @name 全局苹方 // @namespace franciszhao // @version 2.4.0 // @description 一款使用苹果品牌字体替换网页原有字体的用户样式表,为你呈现更统一美观的页面风格。 // @author Francis Zhao // @homepageURL https://n2o.io/go?page=userstyles // @supportURL https://n2o.io/go?page=userstyles // @license MIT // @grant GM_addStyle // @run-at document-start // @match *://*/* // @downloadURL none // ==/UserScript== (function() { let css = ""; css += ` /* 字体设定 */ html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; } body { font-family: 'PingFang SC', 'Source Han Sans SC', 'HanHei SC', system-ui, ui-sans-serif, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', emoji; } pre, code, kbd, samp { font-family: 'SF Mono', 'PingFang SC', ui-monospace, monospace, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', emoji; } button, input, keygen, optgroup, select, textarea { font-family: inherit; } /* 字体替换 */ /* 特定网站适配 */ `; if ((location.hostname === "423down.com" || location.hostname.endsWith(".423down.com"))) { css += ` .excerpt h2 { height: unset; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } `; } if ((location.hostname === "baidu.com" || location.hostname.endsWith(".baidu.com")) || new RegExp("^(?:https://www\\.baidu\\.com/(s|#)?.*)\$").test(location.href)) { css += ` * { font-family: 'PingFang SC', 'Source Han Sans SC', 'HanHei SC', system-ui, ui-sans-serif, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', emoji; } `; } if (new RegExp("^(?:https://(\\w+\\.)?bing\\.com/(search)?.*)\$").test(location.href)) { css += ` * { font-family: 'PingFang SC', 'Source Han Sans SC', 'HanHei SC', system-ui, ui-sans-serif, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', emoji; } `; } if ((location.hostname === "github.com" || location.hostname.endsWith(".github.com"))) { css += ` .text-mono { font-family: 'SF Mono', 'PingFang SC', ui-monospace, monospace, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', emoji !important; } .blob-num, .blob-code-inner { font-family: 'SF Mono', 'PingFang SC', ui-monospace, monospace, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', emoji; } `; } if (new RegExp("^(?:https://www\\.google(\\.\\w+){1,2}/(search)?.*)\$").test(location.href)) { css += ` * { font-family: 'PingFang SC', 'Source Han Sans SC', 'HanHei SC', system-ui, ui-sans-serif, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', emoji; } `; } if ((location.hostname === "greasyfork.org" || location.hostname.endsWith(".greasyfork.org"))) { css += ` #script_version_code, .ace_editor { font-family: 'SF Mono', 'PingFang SC', ui-monospace, monospace, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', emoji !important; } `; } if ((location.hostname === "ithome.com" || location.hostname.endsWith(".ithome.com"))) { css += ` .post_comment { font-family: 'PingFang SC', 'Source Han Sans SC', 'HanHei SC', system-ui, ui-sans-serif, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', emoji; } `; } if ((location.hostname === "jiemian.com" || location.hostname.endsWith(".jiemian.com"))) { css += ` .article-content { font-family: 'PingFang SC', 'Source Han Sans SC', 'HanHei SC', system-ui, ui-sans-serif, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', emoji !important; } #ad_header_top, .cnzz-ads, .jm-app { display: none !important; } `; } if (new RegExp("^(?:https://www\\.so\\.com/s?.*)\$").test(location.href)) { css += ` * { font-family: 'PingFang SC', 'Source Han Sans SC', 'HanHei SC', system-ui, ui-sans-serif, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', emoji; } `; } if (new RegExp("^(?:https://(www\\.)?sogou\\.com/(web|sogou)?.*)\$").test(location.href)) { css += ` * { font-family: 'PingFang SC', 'Source Han Sans SC', 'HanHei SC', system-ui, ui-sans-serif, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', emoji; } `; } if ((location.hostname === "sspai.com" || location.hostname.endsWith(".sspai.com"))) { css += ` h1, h2, h3, h4, h5, h6, .title, .content, p, a { font-family: 'PingFang SC', 'Source Han Sans SC', 'HanHei SC', system-ui, ui-sans-serif, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', emoji !important; } `; } if ((location.hostname === "userstyles.org" || location.hostname.endsWith(".userstyles.org"))) { css += ` .ad, #top_android_button, .android_button_button, .android_button_banner, .walking { display: none !important; } `; } if (typeof GM_addStyle !== "undefined") { GM_addStyle(css); } else { const styleNode = document.createElement("style"); styleNode.appendChild(document.createTextNode(css)); (document.querySelector("head") || document.documentElement).appendChild(styleNode); } })();