Background reading color for Marxist.org

3/4/2023, 8:27:32 PM

当前为 2023-03-19 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        Background reading color for Marxist.org
// @match       https://www.marxists.org/*
// @version     1.1
// @author      Pentarasm
// @description 3/4/2023, 8:27:32 PM
// @license  Unlicense
// @namespace https://greasyfork.org/users/1044494
// ==/UserScript==

/*
  Good Background Colors for Readers:
  A Study of People with and without Dyslexia
  https://www.cs.cmu.edu/~jbigham/pubs/pdfs/2017/colors.pdf

  #96ADFC - blue
  #DBE1F1 - blue grey
  #D8D3D6 - Grey
  #EDD1B0 - peach
  #F8FD89 - yellow
  #A5F7E1 - tourquouise
*/


function setBackgroundColor() {
  const body = document.querySelector("body");

  //schimba culoarea la background
  body.style.background = "#DBE1F1"; // - poti sa inlocuiesti HEX-ul din "" cu alta culoare
}

function hideScrollbar() {
  const style = document.createElement("style");

  //adds the style tag into the head and inserts CSS rule that hides scrollbar
  document.head.append(style);
  style.sheet.insertRule(" html { scrollbar-width: none; } ");
}


setBackgroundColor();
hideScrollbar();