長文を書くほど自分のアイコンがデカくなるUserScript
ネタUserScriptです。
目的
ひとりぼっちで黙々と作業するのを防ぎたい。
Cosenseを書いて自分の意見を言語化していくべきだが、文章の量で相手を圧倒させてないか見直したい。
/shokai/WOM(Write Only Member)になっていないか見直したい。
一人で黙々と作業してScrapboxを書くほど、自分のアイコンが大きくなる。
インタラクティブに会話しているときは、自分のアイコンが小さくなる仕組みです。
UserScriptは自分にしか適用されないので、デカイ表示は自分のブラウザだけにしか適用されません。
UserScriptを入れたとしても、デカくなるのは自分のアイコンだけです。
自分のアイコンがデカくなること自体には、良い意味も悪い意味もないと思っている。
強調するだけ。英語でいうveryの意味だけを持っている。
script.js// 長文を書くほど自分のアイコンがデカくなるUserScript// 2022/10/16const meAPIResponse = await fetch("https://scrapbox.io/api/users/me");const { id: myUserID, name: myUsername } = await meAPIResponse.json();const handleLinesChanged = () => { scrapbox.Page.lines.forEach((line, lineIndex) => { for (const iconElement of document.querySelectorAll( `#L${line.id} .icon[title="${myUsername}"]` )) { const depth = line.text.match(/^\s*/)[0].length; let length = 0; for (const line2 of scrapbox.Page.lines.slice(lineIndex)) { const depth2 = line2.text.match(/^\s*/)[0].length; const isMyLine = line2.userId === myUserID; if (depth2 < depth || (depth2 === depth && !isMyLine)) { break; } if (isMyLine) { length++; } } const rate = Math.min(length / 30, 1.0); iconElement.style.transform = `scale(${1 + rate*2})`; iconElement.style.transformOrigin = "top left"; } });};if (scrapbox.Layout === "page") { handleLinesChanged();}scrapbox.on("lines:changed", handleLinesChanged);