Background reading color for Marxist.org

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

目前為 2023-03-19 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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();