微信读书护眼模式

给微信读书增加护眼模式

目前為 2022-05-22 提交的版本,檢視 最新版本

// ==UserScript==
// @namespace yunyuyuan
// @name 微信读书护眼模式
// @description 给微信读书增加护眼模式
// @match *://*.weread.qq.com/web/reader/*
// @version 0.0.1.1
// @license MIT
// ==/UserScript==

(function () {
  'use strict';
  const epClass = '.epTheme';
  const epColor = '#f1e5c9';
  const style = document.createElement("style");
  style.innerHTML = `
    html body${epClass},${epClass} .readerContent .app_content, ${epClass} .readerTopBar, ${epClass} .readerControls_fontSize, ${epClass} .readerControls_item {
      background: ${epColor} !important;
    }
    ${epClass} .readerFooter_button {
      background-color: ${epColor};
      color: black;
      border: 1px solid black;
    }
  `;
  document.head.appendChild(style);

  const controlContainer = document.querySelector('.readerControls');
  const getInEP = document.createElement('button');
  getInEP.className = 'readerControls_item';
  getInEP.onclick = () => {
    document.body.classList.toggle(epClass.substring(1));
  }
  getInEP.innerHTML = '<span>护眼</span>';
  setTimeout(() => {
    controlContainer.appendChild(getInEP);
  },1000)
})()

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址