Customs Map Survivio

Change color map for you!

目前为 2021-03-16 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Customs Map Survivio
  3. // @namespace https://github.com/notKaiAnderson/
  4. // @version 0.2
  5. // @description Change color map for you!
  6. // @author VN BPM
  7. // @match *://surviv.io/*
  8. // @match *://surviv2.io/*
  9. // @match *://2dbattleroyale.com/*
  10. // @match *://2dbattleroyale.org/*
  11. // @match *://piearesquared.info/*
  12. // @match *://thecircleisclosing.com/*
  13. // @match *://archimedesofsyracuse.info/*
  14. // @match *://secantsecant.com/*
  15. // @match *://parmainitiative.com/*
  16. // @match *://nevelskoygroup.com/*
  17. // @match *://kugahi.com/*
  18. // @match *://chandlertallowmd.com/*
  19. // @match *://ot38.club/*
  20. // @match *://kugaheavyindustry.com/*
  21. // @match *://drchandlertallow.com/*
  22. // @match *://rarepotato.com/*
  23. // @grant none
  24. // @icon https://i.imgur.com/sr7Dfqh.png
  25. // ==/UserScript==
  26. (function() {
  27. 'use strict';
  28. var left = document.querySelector('#ad-block-left');
  29. left.innerHTML = `<div class="wrapper">
  30. <div class="header">
  31. <h2>Select map</h2>
  32. </div>
  33. <div class="maps">
  34. <div class="map normalmap">
  35. <img src="https://i.imgur.com/xB2vbaR.png" alt="" class="map-img" />
  36. <h4 class="map-name">Normal Map</h4>
  37. </div>
  38. <div class="map mapcobalt">
  39. <img src="https://i.imgur.com/9BUv05j.png" alt="" class="map-img" />
  40. <h4 class="map-name">Map Cobalt</h4>
  41. </div>
  42. <div class="map desertmap">
  43. <img src="https://i.imgur.com/f410XOg.png" alt="" class="map-img" />
  44. <h4 class="map-name">Desert Map</h4>
  45. </div>
  46. <div class="map spookymap">
  47. <img src="https://i.imgur.com/orsTb9S.png" alt="" class="map-img" />
  48. <h4 class="map-name">Halloween Map</h4>
  49. </div>
  50. <div class="map fanctionmap">
  51. <img src="https://i.imgur.com/n2XHuMb.png" alt="" class="map-img" />
  52. <h4 class="map-name">50v50 Map</h4>
  53. </div>
  54. <div class="map savannahmap">
  55. <img src="https://i.imgur.com/spGZ26Q.png" alt="" class="map-img" />
  56. <h4 class="map-name">Savannah Map</h4>
  57. </div>
  58. <div class="map springmap">
  59. <img src="https://i.imgur.com/gYSwFG2.png" alt="" class"map-img" />
  60. <h4 class="map-name">Autumn Map</h4>
  61. </div>
  62. <div class="map snowmap">
  63. <img src="https://i.imgur.com/DDOkX2e.png" alt="" class"map-img />
  64. <h4 class="map-name">Winter Map</h4>
  65. </div>
  66. <div class="map woodsmap">
  67. <img src="https://i.imgur.com/VJJ7e28.png" alt="" class="map-img" />
  68. <h4 class="map-name">Woods Map</h4>
  69. </div>
  70. </div>
  71. `;
  72. var wrapper = document.querySelector('.wrapper');
  73. wrapper.setAttribute("style", "width: 100%; overflow-y: scroll; height: 100%;text-align: center; box-sizing: border-box;" );
  74. var maps = document.querySelector('.maps');
  75. maps.setAttribute("style", "display: flex; flex-wrap: wrap; box-sizing: border-box;");
  76. left.setAttribute("style", "height: 325px; box-sizing: border-box;");
  77. var map = document.querySelectorAll('.map');
  78. map.forEach(item => {item.setAttribute("style", "flex-grow: 1; flex-basis: 25%; cursor: pointer; box-sizing: border-box;")})
  79. function addStyleString(str) {
  80. var node = document.createElement('style');
  81. node.innerHTML = str;
  82. document.body.appendChild(node);
  83. }
  84. addStyleString('.active { color: green; border: 2px solid #668e38; }');
  85. function mapcobalt() {
  86. var xx = webpackJsonp([],null,["d5ec3c16"]);
  87. xx.biome.colors.beach= 0x443D3A ;
  88. xx.biome.colors.grass= 0x4D5A68 ;
  89. xx.biome.colors.underground= 0x1B0D03 ;
  90. xx.biome.colors.riverbank= 0x653313 ;
  91. xx.biome.colors.water= 0x003571 ;
  92. xx.biome.colors.background= 0x020E18 ;
  93. }
  94. function normalmap() {
  95. var xx = webpackJsonp([],null,["d5ec3c16"]);
  96. xx.biome.colors.beach= 0xcdb35b ;
  97. xx.biome.colors.grass= 0x80af49 ;
  98. xx.biome.colors.underground= 0x1b0d03 ;
  99. xx.biome.colors.water= 0x3282ab ;
  100. xx.biome.colors.riverbank= 0x905e24 ;
  101. }
  102. function desertmap() {
  103. var xx = webpackJsonp([],null,["d5ec3c16"]);
  104. xx.biome.colors.beach= 0xc9843a ;
  105. xx.biome.colors.grass= 0xdfa757 ;
  106. xx.biome.colors.underground= 0x3d0d03 ;
  107. xx.biome.colors.riverbank= 0xb25e24 ;
  108. xx.biome.colors.water= 0x8a9b4e ;
  109. }
  110. function spookymap() {
  111. var xx = webpackJsonp([],null,["d5ec3c16"]);
  112. xx.biome.colors.beach= 0x64410e ;
  113. xx.biome.colors.grass= 0x212404 ;
  114. xx.biome.colors.underground= 0x120801 ;
  115. xx.biome.colors.water= 0x280000 ;
  116. xx.biome.colors.riverbank= 0x3c1b05 ;
  117. }
  118. function aquaticAvenger() {
  119. var xx = webpackJsonp([],null,["d5ec3c16"]);
  120. xx.biome.colors.beach= 0xCB7132 ;
  121. xx.biome.colors.grass= 0xB4B02E ;
  122. xx.biome.colors.underground= 0x3D0D03 ;
  123. xx.biome.colors.water= 0x41A4AA ;
  124. xx.biome.colors.riverbank= 0x653313 ;
  125. xx.biome.colors.background= 0x1C5B5F ;
  126. }
  127. function factionmap() {
  128. var xx = webpackJsonp([],null,["d5ec3c16"]);
  129. xx.biome.colors.beach= 0x8e5632 ;
  130. xx.biome.colors.grass= 0x4e6128 ;
  131. xx.biome.colors.underground= 0x1b0d03 ;
  132. xx.biome.colors.water= 0x071B36 ;
  133. xx.biome.colors.riverbank= 0x653313 ;
  134. }
  135. function springmap() {
  136. var xx = webpackJsonp([],null,["d5ec3c16"]);
  137. xx.biome.colors.beach= 0xefb35b ;
  138. xx.biome.colors.grass= 0x8e832a ;
  139. xx.biome.colors.underground= 0x1b0d03 ;
  140. xx.biome.colors.water= 0x3282ab ;
  141. xx.biome.colors.riverbank= 0x77360b ;
  142. }
  143. function snowmap() {
  144. var xx = webpackJsonp([],null,["d5ec3c16"]);
  145. xx.biome.colors.beach= 0xcdb35b ;
  146. xx.biome.colors.grass= 0xbdbdbd ;
  147. xx.biome.colors.underground= 0x1b0d03 ;
  148. xx.biome.colors.water= 0x0c4d51 ;
  149. xx.biome.colors.riverbank= 0x905e24 ;
  150. }
  151. // woods map
  152. function woodsmap () {
  153. var xx = webpackJsonp([],null,["d5ec3c16"]);
  154. xx.biome.colors.beach= 0xf4ae48 ;
  155. xx.biome.colors.grass= 0x5c910a ;
  156. xx.biome.colors.underground= 0x1b0d03 ;
  157. xx.biome.colors.water= 0x3282ab ;
  158. xx.biome.colors.riverbank= 0x8a8a8a ;
  159. }
  160. function removeBorder() {
  161. map.forEach(item => { item.classList.remove('active') })
  162. }
  163. map.forEach(function (item) {
  164. var background = document.querySelector('#background');
  165. item.addEventListener('click', function () {
  166. if (item.className == "map mapcobalt") {
  167. mapcobalt();
  168. removeBorder();
  169. item.className += " active";
  170. }
  171. if (item.className == "map normalmap") {
  172. normalmap();
  173. removeBorder();
  174. item.className += " active";
  175. }
  176. if (item.className == "map desertmap") {
  177. desertmap();
  178. removeBorder();
  179. item.className += " active";
  180. }
  181. if (item.className == "map spookymap") {
  182. background.style.backgroundImage = "url('https://i.imgur.com/u5jH3co.png')";
  183. spookymap();
  184. removeBorder();
  185. item.className += " active";
  186. }
  187. if (item.className == "map savannahmap") {
  188. aquaticAvenger();
  189. removeBorder();
  190. item.className += " active";
  191. }
  192. if (item.className == "map fanctionmap") {
  193. factionmap();
  194. removeBorder();
  195. item.className += " active";
  196. }
  197. if (item.className == "map woodsmap") {
  198. woodsmap();
  199. removeBorder();
  200. item.className += " active";
  201. }
  202. if (item.className == "map snowmap") {
  203. snowmap();
  204. removeBorder();
  205. item.className += " active";
  206. }
  207. if (item.className == "map springmap") {
  208. springmap();
  209. removeBorder();
  210. item.className += " active";
  211. }
  212. });
  213. });
  214. })();