Samlib Reader

Делает самиздатовские текста более читабельными: смена фона на тёмный, смена шрифта на verdana, смена цвета текста на светлый, текст выровнен по ширине строки, добавлен автоматический перенос слов

As of 10.01.2021. See ბოლო ვერსია.

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 Samlib Reader
// @description Делает самиздатовские текста более читабельными: смена фона на тёмный, смена шрифта на verdana, смена цвета текста на светлый, текст выровнен по ширине строки, добавлен автоматический перенос слов
// @copyright 2019, Angens (https://openuserjs.org/users/angens)
// @license MIT
// @version 2.0.2
// @match http://samlib.ru/*/*/*.shtml
// @exclude http://samlib.ru/*/*/index*.shtml
// @exclude http://samlib.ru/*/*/stat.shtml
// @grant none
// @namespace https://greasyfork.org/users/386214
// ==/UserScript==
//
// ==OpenUserJS==
// @author angens
// ==/OpenUserJS==



function changer(){

  document.querySelector("body").setAttribute("lang", "ru");
  document.querySelector("body").setAttribute("style", "-moz-hyphens: auto; -webkit-hyphens: auto; -ms-hyphens: auto; white-space: unset;");

  let nodes = document.querySelectorAll("dd, p");

  let new_element = document.createElement('div');

  new_element.id = "SamLibReader";
  new_element.style.color = "wheat";
  new_element.style.fontSize = "18px";
  new_element.style.fontFamily = "verdana";
  new_element.style.backgroundColor = "#212127";
  new_element.style.paddingTop = "5%";
  new_element.style.paddingLeft = "5%";
  new_element.style.paddingRight = "5%";
  new_element.style.marginLeft = "25%";
  new_element.style.marginRight = "25%";
  new_element.style.textAlign = "justify";

  nodes[0].parentElement.insertBefore(new_element, nodes[0]);

  for (let i = 0; i < nodes.length; i++){
    new_element.append(nodes[i]);
  }
}


document.addEventListener("DOMContentLoaded", changer());