CHUNITHM get JSON file Plus

Get JSON file that can be used in https://reiwa.f5.si + Link to Best 30, My Constants Generator

  1. // ==UserScript==
  2. // @name CHUNITHM get JSON file Plus
  3. // @version 1.0
  4. // @description Get JSON file that can be used in https://reiwa.f5.si + Link to Best 30, My Constants Generator
  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. .cyan {
  36. background-color: #17a2b8;
  37. border: 1px solid #17a2b8;
  38. }
  39. .cyan:hover {
  40. background-color: #138496;
  41. }
  42. .cyan:active {
  43. background-color: #037486;
  44. }`;
  45.  
  46. const d = document;
  47.  
  48. (function () {
  49. "use strict";
  50. const downloadJsonBtn = d.createElement("button");
  51. downloadJsonBtn.className = "jsonButton green";
  52. downloadJsonBtn.innerText = "Download JSON";
  53. downloadJsonBtn.addEventListener("click", () => {
  54. var e = d.createElement("script");
  55. e.src =
  56. "https://reiwa.f5.si/chuni_scoredata/main.js?" +
  57. String(Math.floor(new Date().getTime() / 1e3));
  58. d.body.appendChild(e);
  59. });
  60. const bestImageBtn = d.createElement("button");
  61. bestImageBtn.className = "jsonButton cyan";
  62. bestImageBtn.innerText = "Best 30";
  63. bestImageBtn.addEventListener("click", () =>
  64. window.open("https://reiwa.f5.si/newbestimg/chunithm_int")
  65. );
  66. const constBtn = d.createElement("button");
  67. constBtn.className = "jsonButton cyan";
  68. constBtn.innerText = "MY CONSTANTS";
  69. constBtn.addEventListener("click", () =>
  70. window.open("https://reiwa.f5.si/newmyconstants/chunithm-int")
  71. );
  72. const style = d.createElement("style");
  73. if (style.styleSheet) {
  74. style.styleSheet.cssText = css;
  75. } else {
  76. style.appendChild(d.createTextNode(css));
  77. }
  78. d.getElementsByTagName("head")[0].appendChild(style);
  79. const cf = d.querySelector(".clearfix");
  80. cf?.insertAdjacentElement("afterend", constBtn);
  81. cf?.insertAdjacentElement("afterend", bestImageBtn);
  82. cf?.insertAdjacentElement("afterend", downloadJsonBtn);
  83. })();