Parkour Helper for miniblox.io

parkour helper for miniblox.io

  1. // ==UserScript==
  2. // @name Parkour Helper for miniblox.io
  3. // @namespace http://tampermonkey.net/
  4. // @description parkour helper for miniblox.io
  5. // @match https://miniblox.io/
  6. // @grant none
  7. // @license Redistribution prohibited
  8. // @version 0.0.1.20240921150824
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. const xpath = "/html/body/div[2]/div/div[5]/div[1]/div[2]/span[22]/span/text()[1]";
  15. const offsetY = -260;
  16. const offsetX = 50;
  17.  
  18. const centerElement = () => {
  19. const element = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
  20.  
  21. if (element) {
  22. const parent = element.parentNode;
  23. const rect = parent.getBoundingClientRect();
  24. const viewportWidth = window.innerWidth;
  25. const viewportHeight = window.innerHeight;
  26.  
  27. parent.style.position = 'absolute';
  28. parent.style.left = `${(viewportWidth - rect.width) / 2 + offsetX}px`;
  29. parent.style.top = `${(viewportHeight - rect.height) / 2 + offsetY}px`;
  30.  
  31. // remove"Rotation: "
  32. const originalText = element.textContent;
  33. const newText = originalText.replace(/Rotation: /, '');
  34. element.textContent = newText.trim();
  35. }
  36. };
  37.  
  38. centerElement();
  39.  
  40. const observer = new MutationObserver(centerElement);
  41. observer.observe(document.body, { childList: true, subtree: true });
  42. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址