CHUNITHM get JSON file

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

目前为 2024-10-21 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name CHUNITHM get JSON file
  3. // @version 1.0
  4. // @description Get JSON file that can be used in https://reiwa.f5.si
  5. // @author Alanimdeo
  6. // @match https://chunithm-net-eng.com/*
  7. // @grant none
  8. // @license MIT
  9. // @namespace https://greasyfork.org/users/1384234
  10. // ==/UserScript==
  11.  
  12. const css = `.jsonButton {
  13. background-color: #17a2b8;
  14. border-radius: 5px;
  15. border: 1px solid #17a2b8;
  16. display: block;
  17. width: fit-content;
  18. cursor: pointer;
  19. color: #ffffff;
  20. font-size: 1.5rem;
  21. padding: 0.7rem 1.4rem;
  22. text-decoration: none;
  23. margin: 1rem auto;
  24. }
  25. .green {
  26. background-color: #28a745;
  27. border: 1px solid #28a745;
  28. }
  29. .green:hover {
  30. background-color: #218838;
  31. }
  32. .green:active {
  33. background-color: #117828;
  34. }`;
  35.  
  36. const d = document;
  37.  
  38. (function () {
  39. "use strict";
  40. const downloadJsonBtn = d.createElement("button");
  41. downloadJsonBtn.className = "jsonButton green";
  42. downloadJsonBtn.innerText = "Download JSON";
  43. downloadJsonBtn.addEventListener("click", () => {
  44. var e = d.createElement("script");
  45. e.src =
  46. "https://reiwa.f5.si/chuni_scoredata/main.js?" +
  47. String(Math.floor(new Date().getTime() / 1e3));
  48. d.body.appendChild(e);
  49. });
  50. const style = d.createElement("style");
  51. if (style.styleSheet) {
  52. style.styleSheet.cssText = css;
  53. } else {
  54. style.appendChild(d.createTextNode(css));
  55. }
  56. d.getElementsByTagName("head")[0].appendChild(style);
  57. const cf = d.querySelector(".clearfix");
  58. cf?.insertAdjacentElement("afterend", downloadJsonBtn);
  59. })();