id=horeyeus-zen-reader name=HOR EYE US Zen Reader version=1.0.0 author=by_roman_a_s_arco description=Distraction-free Sacred Lapis article reader mode (Alt+R or bottom-right toggle) with word/time estimate, soft glare reduction, and instant non-destructive restore. site_pattern=* global=1 enabled=1 ---CODE--- (function () { if (location.protocol === "prowseir:" || location.protocol === "about:") return; if (window.__horeyeusZenReaderLoaded) return; window.__horeyeusZenReaderLoaded = true; const STYLE_ID = "__horeyeus_zen_reader_css"; const words = ((document.body && (document.body.innerText || document.body.textContent)) || "") .trim().split(/\s+/).filter(Boolean).length; const mins = Math.max(1, Math.round(words / 220)); let active = false; const host = document.createElement("div"); host.setAttribute("data-prowseir-ext", "horeyeus-zen-reader"); const shadow = host.attachShadow({ mode: "open" }); shadow.innerHTML = ` `; const btn = shadow.getElementById("toggle"); const lbl = shadow.getElementById("lbl"); function setReader(on) { active = !!on; let st = document.getElementById(STYLE_ID); if (active) { if (!st) { st = document.createElement("style"); st.id = STYLE_ID; st.textContent = [ "html, body { background: #14110D !important; color: #F3EAD6 !important; }", "body { max-width: 72ch !important; margin: 36px auto !important; padding: 0 22px !important; font-family: Georgia, serif !important; font-size: 19px !important; line-height: 1.75 !important; }", "nav, aside, footer, header, [role='banner'], [role='navigation'], .sidebar, [id*='cookie'] { display: none !important; }", "a { color: #D4A93B !important; } img, video { max-width: 100% !important; height: auto !important; }" ].join("\n"); (document.head || document.documentElement).appendChild(st); } } else if (st) { st.remove(); } if (btn) btn.classList.toggle("on", active); if (lbl) lbl.textContent = active ? "EXIT ZEN" : "ZEN READER"; } if (btn) btn.addEventListener("click", () => setReader(!active)); const onKey = (ev) => { if (ev && ev.altKey && !ev.ctrlKey && !ev.metaKey && String(ev.key || "").toLowerCase() === "r") { if (typeof ev.preventDefault === "function") ev.preventDefault(); setReader(!active); } }; window.addEventListener("keydown", onKey); (document.body || document.documentElement).appendChild(host); if (typeof prowseirExt !== "undefined" && typeof prowseirExt.onCleanup === "function") { prowseirExt.onCleanup(() => { setReader(false); window.removeEventListener("keydown", onKey); host.remove(); delete window.__horeyeusZenReaderLoaded; }); } })(); ---CSS--- /* Activated dynamically only when Zen Reader is toggled on */