menu

digdig thing (useless)

  1. // ==UserScript==
  2. // @name menu
  3. // @description digdig thing (useless)
  4. // @version 1
  5. // @author delta-1
  6. // @match *://digdig.io/
  7. // @license MIT
  8. // @grant none
  9. // @namespace https://greasyfork.org/users/843887
  10. // ==/UserScript==
  11.  
  12.  
  13.  
  14.  
  15. 'use strict';
  16. const HTML = `
  17. <table style="width:100%" class="greenthing">
  18. <tr>
  19. <td><b style="text-shadow:1px 1px 0 #444">digdig.io menu thing?</td>
  20. <td>
  21.  
  22.  
  23.  
  24.  
  25. <a>diep.io hybrid and slave my first image!!!!!</a>
  26. <img src="https://share.sketchpad.app/21/5be-db3a-ac1934.png" alt="diep cool pic". style="width:200px;height:100px;">
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37. </div>
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46. </tr>
  47. </table>
  48. `
  49. const styles = `
  50. .greenthing {border: 1px solid green;
  51. padding-left:10px;
  52. padding-right:10px;
  53. border-collapse: collapse;
  54. overflow-y:auto;
  55. word-wrap:break-all;
  56. }
  57. div#greenthing > table, th, td {
  58. }
  59. div#greenthing > button {
  60. font-family: inherit;
  61. font-size: 1em;
  62. }
  63. }
  64. `
  65. const menuStyles = {
  66. position: "absolute",
  67. top: "25%",
  68. width:"50vw",
  69. height:"60vh",
  70. left: "25%",
  71. display: "none",
  72. "background-color": "rgba(0, 80, 89, 1)",
  73. "font-family":'"Montserrat","Verdana"'
  74. }
  75. // <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat">
  76. const menu = document.createElement("div")
  77. for (var prop in menuStyles) {
  78. menu.style[prop] = menuStyles[prop]
  79. }
  80. menu.innerHTML = HTML
  81. menu.id = "dt-menu"
  82. const styleElement = document.createElement("style")
  83. const font = document.createElement("link")
  84. font.rel = "stylesheet"
  85. font.href = "https://fonts.googleapis.com/css?family=Montserrat"
  86. styleElement.innerHTML = styles
  87. document.head.appendChild(styleElement)
  88. document.head.appendChild(font)
  89. document.body.appendChild(menu)
  90. const myEvent = function(event) {
  91. switch (event.key) {
  92. case "Escape":
  93. if (menu.style.display == "none") {
  94. menu.style.display = "block"
  95. console.log("Menu Enabled!")
  96. }
  97. else {
  98. menu.style.display = "none"
  99. console.log("Menu Disabled!")
  100. }
  101. break
  102. }
  103. }
  104. window.addEventListener("keydown",myEvent)
  105. console.log("digdig menu loaded!")
  106.  
  107.