Last active 1 month ago

bolds the first third-ish of each word to make it easier to read for some reason. no i don't know why it works

Revision ef8d037029b3fd4467811f7f59931a4a1cce371a

akgccfocusreader.user.js Raw
1// ==UserScript==
2// @name AKGCC Story Reader Focus Text
3// @namespace http://veryroundbird.house
4// @version 2026-10-08
5// @description try to take over the world!
6// @author Carly Smallbird
7// @match https://akgcc.github.io/story/
8// @icon https://www.google.com/s2/favicons?sz=64&domain=akgcc.github.io
9// @grant none
10// ==/UserScript==
11
12(function() {
13 'use strict';
14 let running = false;
15
16 const recurseHighlight = (node) => {
17 console.log(node.childNodes.length);
18 if (node.childNodes.length === 0) return;
19 if (node.childNodes.length === 1) {
20 const newstr = node.textContent.split(" ").map((w) => {
21 const length = w.length;
22 const third = Math.max(Math.floor(length / 3), 1);
23 return "<b>"+w.slice(0, third)+"</b>"+w.slice(third);
24 }).join(" ");
25 node.innerHTML = newstr;
26 console.log(node);
27 return;
28 }
29 Array.from(node.childNodes).forEach((n) => {
30 recurseHighlight(n);
31 });
32 };
33
34 setInterval(() => {
35 if (!running && document.querySelectorAll('.interactable-text:not(.dialog-name):not(.highlighted)')) {
36 running = true;
37 document.querySelectorAll('.interactable-text:not(.dialog-name):not(.highlighted)').forEach((elt) => {
38 recurseHighlight(elt);
39 elt.classList.add('highlighted');
40 });
41 running = false;
42 }
43 }, 1000);
44})();