// ==UserScript==// @name Heyuri Yeah Highlighter (better)// @namespace heyuri-yeah-highlight-better// @version 1.0// @description Highlights reply posts based on Yeah count (like a Futaba★Channel userscript)// @author Heyuri Applicable Research & Development// @match https://img.heyuri.net/*// @grant none// ==/UserScript==(function () { "use strict"; const red_initial = 235; const green_initial = 224; const blue_initial = 210; const red_reach = 0; const green_reach = 239; const blue_reach = 55; const reach = 15; //how many "Yeah" needed to make the post go from color initial to color reach function applyHighlighting() { document.querySelectorAll(".post.reply").forEach(post => { post.removeAttribute("style"); const sod = post.querySelector(".sod"); if (!sod) return; const match = sod.textContent.match(/\d+/); if (!match) return; const count = parseInt(match[0], 10); const red = Math.round(red_initial - (((red_initial - red_reach) / reach) * count)); const green = Math.round(green_initial - (((green_initial - green_reach) / reach) * count)); const blue = Math.round(blue_initial - (((blue_initial - blue_reach) / reach) * count)); const color = "rgb(" + red + ", " + green + ", " + blue + ")"; post.style.backgroundColor = color; }); } const observer = new MutationObserver(() => { applyHighlighting(); }); observer.observe(document.body, { childList: true, subtree: true, characterData: true }); applyHighlighting();})();