🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

微信阅读伙伴

微信阅读好伙伴

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name         微信阅读伙伴
// @namespace    betta-cyber - Overview
// @version      0.1.1
// @description  微信阅读好伙伴
// @author       betta-cyber
// @match        https://weread.qq.com/*
// @icon         https://rescdn.qqmail.com/node/wr/wrpage/style/images/independent/favicon/favicon_32h.png
// @require      https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js
// @grant        GM_addStyle
// @grant        GM_setValue
// @grant        GM_getValue
// @run-at       document-end
// @license MIT
// ==/UserScript==

(function() {
    ("use strict");

    /* globals jQuery, $, waitForKeyElements */

    // GM_setValue("custom_font", 'fantasy');
    // todo
    // add button to set GM_setValue

    var custom_font = (GM_getValue("custom_font"));
    console.log(custom_font);
    var font_css
    if (custom_font) {
        font_css = "*{font-family: " + custom_font + ", LXGWWenKai, SourceHanSerifCN-Medium, Kaiti, STKaiti, FangSong, SimSun; !important;}";
    } else {
        font_css = "*{font-family:LXGWWenKai, SourceHanSerifCN-Medium, Kaiti, STKaiti, FangSong, SimSun; !important;}";
    }

    var css = [
        ".readerContent {",
        "    max-width: 100% !important;",
        "}",
        ".app_content  {",
        "    max-width: 100% !important;",
        "}",
        ".readerTopBar {",
        "    max-width: 100% !important;",
        "}",
        ".readerControls {",
        "    right: 0 !important;;",
        "    margin-right: 15px !important;",
        "    left: unset !important;",
        "}",
        ".reader_pdf_outline {",
        "    right: 0 !important;",
        "    left: unset !important;",
        "}",
        ".readerNotePanel {",
        "    right: 0 !important;",
        "    left: unset !important;",
        "}",
        ".readerCatalog {",
        "    right: 0 !important;",
        "    left: unset !important;",
        "}",
        // 调整字体
        font_css,
        ".readerTopBar_title {font-family: LXGWWenKai,SourceHanSerifCN-Bold; !important; font-weight:bold !important;}",
    ].join("\n");
    if (typeof GM_addStyle != "undefined") {
        GM_addStyle(css);
    } else if (typeof PRO_addStyle != "undefined") {
        PRO_addStyle(css);
    } else if (typeof addStyle != "undefined") {
        addStyle(css);
    } else {
        var node = document.createElement("style");
        node.type = "text/css";
        node.appendChild(document.createTextNode(css));
        var heads = document.getElementsByTagName("head");
        if (heads.length > 0) {
            heads[0].appendChild(node);
        } else {
            // no head yet, stick it whereever
            document.documentElement.appendChild(node);
        }
    }

    // 隐藏topbar
    let windowTop = 0;
    $(window).scroll(() => {
        const scrollS = $(this).scrollTop();
        if (scrollS >= windowTop + 120) {
            $(".readerTopBar").fadeOut();
            windowTop = scrollS;
        }
        else if (scrollS < windowTop) {
            $(".readerTopBar").fadeIn();
            windowTop = scrollS;
        }
    });

    // 隐藏下载按钮
    $(".download").hide();
})();