Make Paragraphs Readable

Style paragraphs for better readability

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Make Paragraphs Readable
// @namespace    http://tampermonkey.net/
// @version      2025-05-14
// @description  Style paragraphs for better readability
// @author       You
// @match        *://*/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=reddit.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function makeItReadable() {
        document.querySelectorAll('p').forEach(el => {
            Object.assign(el.style, {
                backgroundColor: '#fdf6e3',
                color: '#333333',
                fontFamily: 'Georgia, serif',
                fontSize: '18px',
                lineHeight: '1.6',
                maxWidth: '700px',
                margin: '2rem auto',
                padding: '0 1rem'
            });
        });
    }

    // Create and style button
    const button = document.createElement('button');
    button.innerText = 'R';
    Object.assign(button.style, {
        position: 'fixed',
        top: '10px',
        left: '10px',
        zIndex: 9999,
        padding: '0px 12px',
        fontSize: '14px',
        backgroundColor: '#fdf6e3',
        color: '#333',
        border: '1px solid #ccc',
        borderRadius: '4px',
        cursor: 'pointer',
        opacity: 0.4
    });
    button.onclick = makeItReadable;

    document.body.append(button);
})();