Moomoo.io - Styles

Remove unnecessary menu elements, and modify ping and shutdown warning.

  1. // ==UserScript==
  2. // @name Moomoo.io - Styles
  3. // @author Seryo
  4. // @description Remove unnecessary menu elements, and modify ping and shutdown warning.
  5. // @version 0.2
  6. // @match *://*.moomoo.io/*
  7. // @namespace https://greasyfork.org/users/1190411
  8. // @icon https://cdn.glitch.com/82ae8945-dcc6-4276-98a9-665381b4cd2b/cursor12.png
  9. // @license MIT
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. const elementsToRemove = document.querySelectorAll('.menuText, .menuHeader, .menuLink');
  17. elementsToRemove.forEach(element => {
  18. element.remove();
  19. });
  20.  
  21. const specificElementToRemove = document.getElementById('desktopInstructions');
  22. if (specificElementToRemove) {
  23. specificElementToRemove.remove();
  24. }
  25.  
  26. const pingDisplayDiv = document.querySelector('#pingDisplay');
  27. if (pingDisplayDiv) {
  28. pingDisplayDiv.style.color = '#fff';
  29. pingDisplayDiv.style.textShadow = '3px 3px 3px black';
  30. }
  31.  
  32. const shadowStyle = 'box-shadow: 0 0 10px 10px rgba(0, 0, 0, 0.4)';
  33.  
  34. const setupCardDiv = document.getElementById('setupCard');
  35. if (setupCardDiv) {
  36. setupCardDiv.style.cssText += shadowStyle;
  37. }
  38.  
  39. const serverBrowserSelect = document.getElementById('serverBrowser');
  40. if (serverBrowserSelect) {
  41. serverBrowserSelect.style.color = '#333';
  42. serverBrowserSelect.style.backgroundColor = '#e5e3e4';
  43. }
  44.  
  45. const enterGameButton = document.getElementById('enterGame');
  46. if (enterGameButton) {
  47. enterGameButton.style.backgroundColor = '#333';
  48. }
  49.  
  50. if (pingDisplayDiv) {
  51. document.body.appendChild(pingDisplayDiv);
  52. }
  53.  
  54. const style = document.createElement('style');
  55. style.innerHTML = `
  56. .menuLink {
  57. font-size: 20px;
  58. color: #333;
  59. }
  60. a {
  61. color: #333;
  62. text-decoration: none;
  63. }
  64. `;
  65. document.head.appendChild(style);
  66.  
  67. const nameInputElement = document.getElementById('nameInput');
  68. if (nameInputElement) {
  69. nameInputElement.style.color = '#333';
  70. }
  71.  
  72. const guideCardDiv = document.getElementById('guideCard');
  73. if (guideCardDiv) {
  74. guideCardDiv.style.cssText += shadowStyle;
  75. setupCardDiv.style.backgroundColor = '#181818';
  76. guideCardDiv.style.backgroundColor = '#181818';
  77. }
  78.  
  79. const shutdownDisplayDiv = document.querySelector('#shutdownDisplay');
  80. if (shutdownDisplayDiv) {
  81. shutdownDisplayDiv.style.position = 'absolute';
  82. shutdownDisplayDiv.style.top = '15px';
  83. shutdownDisplayDiv.style.left = '150px';
  84. shutdownDisplayDiv.style.color = '#820000';
  85. shutdownDisplayDiv.style.fontSize = '200%';
  86. shutdownDisplayDiv.style.textShadow = '2px 2px 4px rgba(0, 0, 0, 0.7)';
  87. }
  88. })();