Steloization

제 2의 Steloize!

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==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;
    }
  }
}