akgccfocusreader.user.js
· 1.1 KiB · JavaScript
Raw
// ==UserScript==
// @name AKGCC Story Reader Focus Text
// @namespace http://veryroundbird.house
// @version 2026-10-08
// @description try to take over the world!
// @author Carly Smallbird
// @match https://akgcc.github.io/story/
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.io
// @grant none
// ==/UserScript==
(function() {
'use strict';
let running = false;
setInterval(() => {
if (!running && document.querySelectorAll('.interactable-text:not(.dialog-name):not(.highlighted)')) {
running = true;
document.querySelectorAll('.interactable-text:not(.dialog-name):not(.highlighted)').forEach((elt) => {
const text = elt.innerHTML;
const newstr = text.split(" ").map((w) => {
const length = w.length;
const third = Math.ceil(length / 3);
return "<b>"+w.slice(0, third)+"</b>"+w.slice(third);
}).join(" ");
elt.innerHTML = newstr;
elt.classList.add('highlighted');
});
running = false;
}
}, 1000);
})();
| 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=github.io |
| 9 | // @grant none |
| 10 | // ==/UserScript== |
| 11 | |
| 12 | (function() { |
| 13 | 'use strict'; |
| 14 | let running = false; |
| 15 | |
| 16 | setInterval(() => { |
| 17 | if (!running && document.querySelectorAll('.interactable-text:not(.dialog-name):not(.highlighted)')) { |
| 18 | running = true; |
| 19 | document.querySelectorAll('.interactable-text:not(.dialog-name):not(.highlighted)').forEach((elt) => { |
| 20 | const text = elt.innerHTML; |
| 21 | const newstr = text.split(" ").map((w) => { |
| 22 | const length = w.length; |
| 23 | const third = Math.ceil(length / 3); |
| 24 | return "<b>"+w.slice(0, third)+"</b>"+w.slice(third); |
| 25 | }).join(" "); |
| 26 | elt.innerHTML = newstr; |
| 27 | elt.classList.add('highlighted'); |
| 28 | }); |
| 29 | running = false; |
| 30 | } |
| 31 | }, 1000); |
| 32 | })(); |