Steloization

제 2의 Steloize!

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Steloization
// @namespace    https://tampermonkey.net/
// @version      1.1
// @description  제 2의 Steloize!
// @author       You
// @match        https://openuserjs.org/user/add/scripts/new
// @icon         https://www.google.com/s2/favicons?domain=openuserjs.org
// @grant        none
// @copyright    2021, 나무스튜
// @license      MIT
// @include      *://*/*
// ==/UserScript==

fetch("https://szmanager.prnm789.repl.co/fontface")
.then(function(res){
    return res.text();
})
.then(function(data){
    var newstyletag = document.createElement("style");
    var newstyle = document.createTextNode(data);
    newstyletag.appendChild(newstyle);
    document.body.appendChild(newstyletag);
});

setInterval(load, 500);

function load() {
  var elems = document.querySelectorAll(".se-text-paragraph > span, p:not(.se-text-paragraph), h2, h3, strong.tit, strong.title, a.tit, a.article > span.inner, span.tx > span");
  var reg = /(\|\|)(.+?)(\|)(.+?)(\|\|)/;

  for (let elem of elems) {
    if (reg.test(elem.innerText)) {
      let oldtext = elem.innerText;
      let font = oldtext.match(/(\|\|)(.+?)(\|)/)[0].substr(2).slice(0, -1);
      let newtext = oldtext.replace(/(\|\|)(.+?)(\|)/, '<span style="font-family: \'' + font + '\', sans-serif">');
      newtext = newtext.replace('||', '</span>');
      elem.innerHTML = newtext;
    }
  }
}