Greasy Fork is available in English.

KEK UI

Hordes UI Script

  1. // ==UserScript==
  2. // @name KEK UI
  3. // @description Hordes UI Script
  4. // @namespace https://hordes.io/
  5. // @match https://hordes.io/play
  6. // @run-at document-start
  7. // @icon https://www.google.com/s2/favicons?sz=64&domain=hordes.io
  8. // @license KEK
  9. // @author Scrizz and Grigory
  10. // @version 0.0.1
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. 'use strict';
  15.  
  16. const checkLayoutInterval = setInterval(() => {
  17. const layout = document.querySelector(".l-ui.layout");
  18. if (layout) {
  19. clearInterval(checkLayoutInterval);
  20. fetch("https://api.github.com/repos/hordesmod/kek-ui/releases/latest")
  21. .then(response => response.json())
  22. .then(data => {
  23. const newWindow = document.createElement("div");
  24. newWindow.classList.add("window", "panel-black");
  25. newWindow.style.position = "absolute";
  26. newWindow.style.width = "366px";
  27. newWindow.style.top = "50%";
  28. newWindow.style.left = "50%";
  29. newWindow.style.textAlign = "center";
  30. newWindow.style.padding = "12px";
  31. newWindow.style.transform = "translate(-50%, -50%)";
  32.  
  33. const titleFrame = document.createElement("div");
  34. titleFrame.classList.add("titleframe");
  35. titleFrame.style.cursor = "pointer";
  36.  
  37. const closeBtn = document.createElement("img");
  38. closeBtn.src = "/data/ui/icons/cross.svg";
  39. closeBtn.style.float = "right";
  40. closeBtn.classList.add("btn", "black", "svgicon");
  41. closeBtn.addEventListener("click", () => newWindow.remove());
  42. titleFrame.appendChild(closeBtn);
  43. newWindow.appendChild(titleFrame);
  44.  
  45. const updateHeader = document.createElement("h3");
  46. updateHeader.textContent = `Update KEK UI to Version ${data.tag_name}.`;
  47. updateHeader.classList.add("textprimary");
  48. newWindow.appendChild(updateHeader);
  49.  
  50. const description1 = document.createElement("p");
  51. description1.textContent = "To complete the update, make sure to press the";
  52. newWindow.appendChild(description1);
  53.  
  54. const description2 = document.createElement("p");
  55. description2.classList.add("textparty");
  56. description2.textContent = "Overwrite";
  57. newWindow.appendChild(description2);
  58.  
  59. const description3 = document.createElement("p");
  60. description3.textContent = "button in Tampermonkey.";
  61. newWindow.appendChild(description3);
  62.  
  63. const updateBtn = document.createElement("div");
  64. updateBtn.classList.add("btn", "green", "textblack");
  65. updateBtn.textContent = "Update Now";
  66. updateBtn.addEventListener("click", () => {window.open(data.assets[0].browser_download_url);window.location.href = "/"});
  67. newWindow.appendChild(updateBtn);
  68.  
  69. layout.appendChild(newWindow);
  70. })
  71. .catch(error => {
  72. console.error("Error fetching data:", error);
  73. });
  74. }
  75. }, 100);