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

veryroundbird's Avatar veryroundbird revised this gist 1 month ago. Go to revision

1 file changed, 16 insertions, 10 deletions

akgccfocusreader.user.js

@@ -1,8 +1,8 @@
1 1 // ==UserScript==
2 - // @name AKGCC Story Reader Focus Text
2 + // @name AKGCC Story Reader Tweaks
3 3 // @namespace http://veryroundbird.house
4 4 // @version 2026-10-08
5 - // @description try to take over the world!
5 + // @description some slight interface improvements for AKGCC story reader
6 6 // @author Carly Smallbird
7 7 // @match https://akgcc.github.io/story/
8 8 // @icon https://www.google.com/s2/favicons?sz=64&domain=akgcc.github.io
@@ -18,7 +18,6 @@
18 18 });
19 19
20 20 const recurseHighlight = (node) => {
21 - console.log(node.childNodes.length);
22 21 if (node.childNodes.length === 0) return;
23 22 if (node.childNodes.length === 1) {
24 23 const newstr = node.textContent.split(" ").map((w) => {
@@ -27,7 +26,6 @@
27 26 return "<b>"+w.slice(0, third)+"</b>"+w.slice(third);
28 27 }).join(" ");
29 28 node.innerHTML = newstr;
30 - console.log(node);
31 29 return;
32 30 }
33 31 Array.from(node.childNodes).forEach((n) => {
@@ -36,13 +34,21 @@
36 34 };
37 35
38 36 setInterval(() => {
39 - if (!running && document.querySelectorAll('.interactable-text:not(.dialog-name):not(.highlighted)')) {
37 + if (!running) {
40 38 running = true;
41 - document.querySelectorAll('.interactable-text:not(.dialog-name):not(.highlighted)').forEach((elt) => {
42 - recurseHighlight(elt);
43 - elt.classList.add('highlighted');
44 - });
45 - running = false;
39 + if (document.querySelectorAll('.interactable-text:not(.dialog-name):not(.highlighted)')) {
40 + document.querySelectorAll('.interactable-text:not(.dialog-name):not(.highlighted)').forEach((elt) => {
41 + recurseHighlight(elt);
42 + elt.classList.add('highlighted');
43 + });
44 + }
45 + if (document.querySelectorAll('.scene:not(.indexed)')) {
46 + document.querySelectorAll('.scene:not(.indexed)').forEach((elt, i) => {
47 + elt.style.setProperty('--index', i+1);
48 + elt.classList.add('indexed');
49 + });
50 + }
46 51 }
52 + running = false;
47 53 }, 1000);
48 54 })();

veryroundbird's Avatar veryroundbird revised this gist 1 month ago. Go to revision

1 file changed, 1 insertion, 1 deletion

akgccfocusreader.user.js

@@ -23,7 +23,7 @@
23 23 if (node.childNodes.length === 1) {
24 24 const newstr = node.textContent.split(" ").map((w) => {
25 25 const length = w.length;
26 - const third = Math.max(Math.floor((length / 5)*2), 1);
26 + const third = Math.max(Math.floor(length / 3), 1);
27 27 return "<b>"+w.slice(0, third)+"</b>"+w.slice(third);
28 28 }).join(" ");
29 29 node.innerHTML = newstr;

veryroundbird's Avatar veryroundbird revised this gist 1 month ago. Go to revision

1 file changed, 6 insertions, 2 deletions

akgccfocusreader.user.js

@@ -2,7 +2,7 @@
2 2 // @name AKGCC Story Reader Focus Text
3 3 // @namespace http://veryroundbird.house
4 4 // @version 2026-10-08
5 - // @description 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
5 + // @description try to take over the world!
6 6 // @author Carly Smallbird
7 7 // @match https://akgcc.github.io/story/
8 8 // @icon https://www.google.com/s2/favicons?sz=64&domain=akgcc.github.io
@@ -13,13 +13,17 @@
13 13 'use strict';
14 14 let running = false;
15 15
16 + window.addEventListener('load', (_e) => {
17 + document.querySelector('head').innerHTML += `<meta name="viewport" content="width=device-width" />`;
18 + });
19 +
16 20 const recurseHighlight = (node) => {
17 21 console.log(node.childNodes.length);
18 22 if (node.childNodes.length === 0) return;
19 23 if (node.childNodes.length === 1) {
20 24 const newstr = node.textContent.split(" ").map((w) => {
21 25 const length = w.length;
22 - const third = Math.max(Math.floor(length / 3), 1);
26 + const third = Math.max(Math.floor((length / 5)*2), 1);
23 27 return "<b>"+w.slice(0, third)+"</b>"+w.slice(third);
24 28 }).join(" ");
25 29 node.innerHTML = newstr;

veryroundbird's Avatar veryroundbird revised this gist 1 month ago. Go to revision

1 file changed, 1 insertion, 1 deletion

akgccfocusreader.user.js

@@ -2,7 +2,7 @@
2 2 // @name AKGCC Story Reader Focus Text
3 3 // @namespace http://veryroundbird.house
4 4 // @version 2026-10-08
5 - // @description try to take over the world!
5 + // @description 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
6 6 // @author Carly Smallbird
7 7 // @match https://akgcc.github.io/story/
8 8 // @icon https://www.google.com/s2/favicons?sz=64&domain=akgcc.github.io

veryroundbird's Avatar veryroundbird revised this gist 1 month ago. Go to revision

1 file changed, 20 insertions, 8 deletions

akgccfocusreader.user.js

@@ -5,7 +5,7 @@
5 5 // @description try to take over the world!
6 6 // @author Carly Smallbird
7 7 // @match https://akgcc.github.io/story/
8 - // @icon https://www.google.com/s2/favicons?sz=64&domain=github.io
8 + // @icon https://www.google.com/s2/favicons?sz=64&domain=akgcc.github.io
9 9 // @grant none
10 10 // ==/UserScript==
11 11
@@ -13,17 +13,29 @@
13 13 'use strict';
14 14 let running = false;
15 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 +
16 34 setInterval(() => {
17 35 if (!running && document.querySelectorAll('.interactable-text:not(.dialog-name):not(.highlighted)')) {
18 36 running = true;
19 37 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;
38 + recurseHighlight(elt);
27 39 elt.classList.add('highlighted');
28 40 });
29 41 running = false;

veryroundbird's Avatar veryroundbird revised this gist 1 month ago. Go to revision

1 file changed, 32 insertions

akgccfocusreader.user.js(file created)

@@ -0,0 +1,32 @@
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 + })();
Newer Older