CHUNITHM get JSON file

Get JSON file that can be used in https://reiwa.f5.si

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         CHUNITHM get JSON file
// @version      1.0
// @description  Get JSON file that can be used in https://reiwa.f5.si
// @author       Alanimdeo
// @match        https://chunithm-net-eng.com/*
// @grant        none
// @license      MIT
// @namespace https://greasyfork.org/users/1384234
// ==/UserScript==

const css = `.jsonButton {
  background-color: #17a2b8;
  border-radius: 5px;
  border: 1px solid #17a2b8;
  display: block;
  width: fit-content;
  cursor: pointer;
  color: #ffffff;
  font-size: 1.5rem;
  padding: 0.7rem 1.4rem;
  text-decoration: none;
  margin: 1rem auto;
}
.green {
  background-color: #28a745;
  border: 1px solid #28a745;
}
.green:hover {
  background-color: #218838;
}
.green:active {
  background-color: #117828;
}`;

const d = document;

(function () {
  "use strict";
  const downloadJsonBtn = d.createElement("button");
  downloadJsonBtn.className = "jsonButton green";
  downloadJsonBtn.innerText = "Download JSON";
  downloadJsonBtn.addEventListener("click", () => {
    var e = d.createElement("script");
    e.src =
      "https://reiwa.f5.si/chuni_scoredata/main.js?" +
      String(Math.floor(new Date().getTime() / 1e3));
    d.body.appendChild(e);
  });
  const style = d.createElement("style");
  if (style.styleSheet) {
    style.styleSheet.cssText = css;
  } else {
    style.appendChild(d.createTextNode(css));
  }
  d.getElementsByTagName("head")[0].appendChild(style);
  const cf = d.querySelector(".clearfix");
  cf?.insertAdjacentElement("afterend", downloadJsonBtn);
})();