Sigmally Mod

A sigmally Mod

当前为 2022-11-30 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Sigmally Mod
  3. // @version 1.2
  4. // @description A sigmally Mod
  5. // @author Cursed
  6. // @match *://sigmally.com/*
  7. // @icon https://iili.io/yaKNoB.png
  8. // @grant none
  9. // @run-at document-end
  10. // @license MIT
  11. // @namespace https://greasyfork.org/users/981958
  12. // ==/UserScript==
  13.  
  14. let Cursed__style = `
  15. /*
  16. * Common
  17. */
  18. .text-right {
  19. text-align: right;
  20. }
  21.  
  22. .flex {
  23. display: flex;
  24. justify-content: center;
  25. }
  26.  
  27.  
  28.  
  29. /*
  30. * Element-Specific
  31. */
  32. #rx-mod-settings {
  33. background: linear-gradient(-45deg, #B876FF, #1F2A9E, #B876FF);
  34. background-size: 300% 300%;
  35. padding: 30px;
  36. border-radius: 15px;
  37. width: 350px;
  38. min-height: 300px;
  39. top: 1em;
  40. left: 50%;
  41. margin-left: -175px;
  42. z-index: 99999;
  43. box-shadow: 0 0 15px #000;
  44. position: fixed;
  45. animation: change 5s ease-in-out infinite;
  46. text-align: center;
  47. }
  48.  
  49. @keyframes change{
  50. 0%{
  51. background-position: 0 50%;
  52. }
  53. 50%{
  54. background-position: 100% 50%;
  55. }
  56. 100%{
  57. background-position: 0 50%;
  58. }
  59. }
  60.  
  61. #rx-mod-settings input.keybinding {
  62. max-width: 20px;
  63. border: 1px solid #ccc;
  64. padding: 0;
  65. text-align: center;
  66. margin-right: 5px;
  67. }
  68.  
  69. #rx-mod-settings input[type="radio"] {
  70. margin-right: 5px;
  71. }
  72. #rx-mod-settings input[type="submit"] {
  73. width: 100%;
  74. margin-top: 15px;
  75. }
  76.  
  77. #rx-mod-settings.hidden {
  78. display: none;
  79. }
  80.  
  81. #rx-mod-wrap {
  82. background-color:#000;
  83. color:#fff;
  84. min-height: 25px;
  85. opacity: 0.45;
  86. position: fixed;
  87. top: 0;
  88. left: 0;
  89. width: 100%;
  90. z-index:99998;
  91. transition: .3s;
  92. user-select: none;
  93.  
  94. }
  95.  
  96. #rx-mod-wrap:hover {
  97. opacity: 1;
  98. transition: .3s;
  99. }
  100.  
  101. #rx-mod-wrap button {
  102. cursor: pointer;
  103. color: #333;
  104. }
  105.  
  106. #rx-mod-wrap span.text {
  107. margin-left: 15px;
  108. padding-left: 15px;
  109. border-left: 1px solid #dfdfdf;
  110. }
  111.  
  112. #text-block,#left_ad_block,#ad_bottom,.ad-block,.ad-block-left,.ad-block-right {
  113. visibility: hidden;
  114. }
  115.  
  116. .CloseBtn{
  117. outline: none;
  118. background-color: #fff;
  119. padding: 10px;
  120. font-size: 16px;
  121. transition: .3s;
  122. position: relative;
  123. background-color: transparent;
  124. color: #fff;
  125. border-radius: 15px;
  126. border: 1px solid #fff;
  127. }
  128.  
  129. .CloseBtn:hover{
  130. background-color: #5865F2;
  131. transition: .3s;
  132. }
  133.  
  134. .SettingsBtn{
  135. background-color: transparent;
  136. }
  137.  
  138. .keybinding{
  139. outline: none;
  140. color: #fff;
  141. background-color: #303030;
  142. border: none;
  143. border-radius: 5px;
  144. font-weight: 500;
  145. }
  146.  
  147. .Sett{
  148. color: #fff;
  149. user-select: none;
  150. font-weight: 500;
  151. }
  152.  
  153. .text{
  154. color: #fff;
  155. font-weight: 500;
  156. user-select: none;
  157. }
  158.  
  159. .titleImg{
  160. width: 100%;
  161. height: 150px;
  162. border-radius: 20px;
  163. margin-bottom: 5px;
  164. }
  165.  
  166. .JoinDc{
  167. background-color: transparent;
  168. width: 75%;
  169. height: 30px;
  170. border: 1px solid #fff;
  171. border-radius: 5px;
  172. color: #fff;
  173. transition: .3s;
  174. }
  175.  
  176. .JoinDc:hover{
  177. background-color: #5865F2;
  178. transition: .3s;
  179. }
  180.  
  181. .StylishNames{
  182. display: flex;
  183. justify-content: space-between;
  184. }
  185.  
  186. .divBtn{
  187. background-color: transparent;
  188. height: 30px;
  189. border: 1px solid #fff;
  190. border-radius: 5px;
  191. color: #fff;
  192. margin: 5px;
  193. transition: .3s;
  194. margin-bottom: 20px;
  195. outline: none;
  196. }
  197.  
  198. .divBtn:hover{
  199. background-color: #5865F2;
  200. transition: .3s;
  201. }
  202.  
  203. .Btn01{
  204. width: 100%;
  205. }
  206.  
  207. .Btn02{
  208. width: 100%;
  209. }
  210.  
  211. `
  212.  
  213. let s = document.createElement('style');
  214. s.type = "text/css"
  215. s.innerHTML = Cursed__style;
  216. (document.head || document.documentElement).appendChild(s);
  217.  
  218. (function() {
  219. const rzModWrap = document.createElement('div');
  220. const rzModSettings = document.createElement('form');
  221. const rzModStyle = document.createElement('link');
  222.  
  223. const KEY_FEED = {
  224. key: 'w',
  225. keyCode: 32,
  226. which: 32
  227. };
  228. const KEY_SPLIT = {
  229. keyCode: 32,
  230. code: 'Space',
  231. cancelable: true,
  232. composed: true,
  233. isTrusted: true,
  234. which: 32
  235. }
  236.  
  237. rzModWrap.setAttribute('id', 'rx-mod-wrap');
  238.  
  239.  
  240.  
  241.  
  242. const Zero_Two = '';
  243.  
  244. /*
  245. * Configure Settings
  246. */
  247.  
  248. let rxSettings = localStorage.getItem('rxSettings');
  249.  
  250. if (!rxSettings){
  251. rxSettings = {
  252. keyBindingsRapidFeed: 'q',
  253. keyBindingsdoubleSplit: 'd',
  254. keyBindingsTripleSplit: 'f',
  255. keyBindingsQuadSplit: 'g',
  256. };
  257. } else {
  258. rxSettings = JSON.parse(rxSettings);
  259. }
  260.  
  261. rzModSettings.setAttribute('id', 'rx-mod-settings');
  262. rzModSettings.classList.add('hidden');
  263. rzModSettings.onsubmit = (e) => {
  264. rzModSettings.classList.toggle('hidden');
  265. e.preventDefault();
  266.  
  267. let options = new FormData(rzModSettings);
  268.  
  269. rxSettings = {};
  270. for (var key of options.keys()) {
  271. rxSettings[key] = options.get(key);
  272. }
  273.  
  274. localStorage.setItem('rxSettings', JSON.stringify(rxSettings));
  275.  
  276. return false;
  277. };
  278. rzModSettings.innerHTML =
  279. '<img src="https://iili.io/yaKNoB.png" class="titleImg">' +
  280. '<h4 class="Sett">Mod Settings</h4>' +
  281. '<hr/>' +
  282. '<h5 class="Sett">Key Mappings</h5>' +
  283. '<label class="flex">' +
  284. '<input type="text" name="keyBindingsRapidFeed" class="keybinding" value="' + rxSettings.keyBindingsRapidFeed + '" maxlength="1" onfocus="this.select()">' +
  285. '<span class="text">Rapid Feed</span>' +
  286. '</label>' +
  287. '<label class="flex">' +
  288. '<input type="text" name="keyBindingsDoubleSplit" class="keybinding" value="' + rxSettings.keyBindingsDoubleSplit + '" maxlength="1" onfocus="this.select()">' +
  289. '<span class="text">Double Split</span>' +
  290. '</label>' +
  291. '<label class="flex">' +
  292. '<input type="text" name="keyBindingsTripleSplit" class="keybinding" value="' + rxSettings.keyBindingsTripleSplit + '" maxlength="1" onfocus="this.select()">' +
  293. '<span class="text">Triple Split</span>' +
  294. '</label>' +
  295. '<label class="flex">' +
  296. '<input type="text" name="keyBindingsQuadSplit" class="keybinding" value="' + rxSettings.keyBindingsQuadSplit + '" maxlength="1" onfocus="this.select()">' +
  297. '<span class="text">Quad Split</span>' +
  298. '</label>' +
  299. '</label>' +
  300. '<hr/>' +
  301. '<h4 class="Sett">Discord</h4>' +
  302. '<a href="https://discord.gg/gHmhpCaPfP" target="_blank"><input type="button" value="Join" class="JoinDc"/></a>' +
  303. '<hr/>' +
  304. '<h4 class="Sett">Stylish Names</h4>' +
  305. '<div class="StylishNames"><a href="https://www.stylishnamemaker.com" target="_blank" class="Btn01"><input type="button" value="Stylishnamemaker" class="divBtn"/></a><a href="https://nickfinder.com" target="_blank" class="Btn02"><input type="button" value="Nickfinder" class="divBtn Btn02"/></a></div>' +
  306. '<input type="submit" class="CloseBtn"; value="Save &amp; Close"/>';
  307.  
  308.  
  309. /*
  310. * Mod Collection
  311. *
  312. * Mod Types:
  313. * - Button
  314. * - Automatic
  315. * - Code
  316. * - Text
  317. */
  318. const gameSettings = document.getElementById('settings');
  319. gameSettings.innerHTML = `
  320. <ul class="checkbox-grid">
  321. <li>
  322. <div class="pretty p-svg p-round p-smooth">
  323. <input type="checkbox" id="darkTheme">
  324. <div class="state p-success">
  325. <svg class="svg svg-icon" viewBox="0 0 20 20">
  326. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  327. </svg>
  328. <label>Dark</label>
  329. </div>
  330. </div>
  331. </li>
  332. <li>
  333. <div class="pretty p-svg p-round p-smooth">
  334. <input type="checkbox" id="showMass">
  335. <div class="state p-success">
  336. <svg class="svg svg-icon" viewBox="0 0 20 20">
  337. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  338. </svg>
  339. <label>Mass</label>
  340. </div>
  341. </div>
  342. </li>
  343. <li>
  344. <div class="pretty p-svg p-round p-smooth">
  345. <input type="checkbox" id="showChat">
  346. <div class="state p-success">
  347. <svg class="svg svg-icon" viewBox="0 0 20 20">
  348. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  349. </svg>
  350. <label>Chat</label>
  351. </div>
  352. </div>
  353. </li>
  354. <li>
  355. <div class="pretty p-svg p-round p-smooth">
  356. <input type="checkbox" id="showMinimap">
  357. <div class="state p-success">
  358. <svg class="svg svg-icon" viewBox="0 0 20 20">
  359. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  360. </svg>
  361. <label>Minimap</label>
  362. </div>
  363. </div>
  364. </li>
  365. <li>
  366. <div class="pretty p-svg p-round p-smooth">
  367. <input type="checkbox" id="showBorder">
  368. <div class="state p-success">
  369. <svg class="svg svg-icon" viewBox="0 0 20 20">
  370. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  371. </svg>
  372. <label>Border</label>
  373. </div>
  374. </div>
  375. </li>
  376. <li>
  377. <div class="pretty p-svg p-round p-smooth">
  378. <input type="checkbox" id="showGrid">
  379. <div class="state p-success">
  380. <svg class="svg svg-icon" viewBox="0 0 20 20">
  381. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  382. </svg>
  383. <label>Grid</label>
  384. </div>
  385. </div>
  386. </li>
  387. <li>
  388. <div class="pretty p-svg p-round p-smooth">
  389. <input type="checkbox" id="moreZoom">
  390. <div class="state p-success">
  391. <svg class="svg svg-icon" viewBox="0 0 20 20">
  392. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  393. </svg>
  394. <label>Zoomout</label>
  395. </div>
  396. </div>
  397. </li>
  398. <li>
  399. <div class="pretty p-svg p-round p-smooth">
  400. <input type="checkbox" id="jellyPhysics">
  401. <div class="state p-success">
  402. <svg class="svg svg-icon" viewBox="0 0 20 20">
  403. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  404. </svg>
  405. <label>Jelly Physics</label>
  406. </div>
  407. </div>
  408. </li>
  409. <li>
  410. <div class="pretty p-svg p-round p-smooth">
  411. <input type="checkbox" id="showNames">
  412. <div class="state p-success">
  413. <svg class="svg svg-icon" viewBox="0 0 20 20">
  414. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  415. </svg>
  416. <label>Names</label>
  417. </div>
  418. </div>
  419. </li>
  420. <li>
  421. <div class="pretty p-svg p-round p-smooth">
  422. <input type="checkbox" id="showSkins">
  423. <div class="state p-success">
  424. <svg class="svg svg-icon" viewBox="0 0 20 20">
  425. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  426. </svg>
  427. <label>Skins</label>
  428. </div>
  429. </div>
  430. </li>
  431. <li>
  432. <div class="pretty p-svg p-round p-smooth">
  433. <input type="checkbox" id="showPosition">
  434. <div class="state p-success">
  435. <svg class="svg svg-icon" viewBox="0 0 20 20">
  436. <path d="M7.629,14.566c0.125,0.125,0.291,0.188,0.456,0.188c0.164,0,0.329-0.062,0.456-0.188l8.219-8.221c0.252-0.252,0.252-0.659,0-0.911c-0.252-0.252-0.659-0.252-0.911,0l-7.764,7.763L4.152,9.267c-0.252-0.251-0.66-0.251-0.911,0c-0.252,0.252-0.252,0.66,0,0.911L7.629,14.566z" style="stroke: white;fill:white;"></path>
  437. </svg>
  438. <label>Position</label>
  439. </div>
  440. </div>
  441. </li>
  442. </ul>
  443. </div>
  444. `
  445.  
  446. const rzMods = [{
  447. modName: 'Branding',
  448. modType: 'automatic',
  449. modDescription: 'Adds Jill Brand.',
  450. modCode: () => {
  451. const gameTitle = document.getElementById('title');
  452. gameTitle.innerHTML = 'Sigmally<span style="display:block; font-size: 14px;">By RingZer0 / Cursed</span>';
  453. }
  454. }, {
  455. modName: 'Rapid Feed (q)',
  456. modType: 'automatic',
  457. modDescription: 'Allows for longer nicknames.',
  458. modCode: () => {
  459.  
  460. // TODO: Add these to settings/configuration pane
  461. window.rxTimeouts = [];
  462. const amount = 10;
  463.  
  464. window.addEventListener('keyup', e => {
  465. if (e.key == rxSettings.keyBindingsRapidFeed){
  466. for (var i = 0; i < rxTimeouts.length; i++){
  467. clearTimeout(rxTimeouts[i]);
  468. }
  469. }
  470. });
  471.  
  472. /*
  473. * Keyboard Overrides
  474. */
  475. window.addEventListener('keydown', e => {
  476.  
  477. if (e.key == 'Escape'){
  478. rzModSettings.classList.add('hidden');
  479. }
  480.  
  481. if (e.key == rxSettings.keyBindingsRapidFeed){
  482.  
  483. // kickstart first one
  484. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  485. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  486. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  487. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  488. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  489. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  490. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  491. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  492. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  493. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  494. for (var i = 0; i < amount; ++i) {
  495. rxTimeouts.push(setTimeout(function() {
  496. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  497. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  498. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  499. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  500. window.dispatchEvent(new KeyboardEvent('keydown', KEY_FEED ));
  501. window.dispatchEvent(new KeyboardEvent('keyup', KEY_FEED ));
  502. }, i ));
  503. }
  504.  
  505. return;
  506. }
  507.  
  508. if (e.key == rxSettings.keyBindingsDoubleSplit){
  509. for (var i = 0; i < 2; ++i) {
  510. setTimeout(function() {
  511. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  512. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  513. }, i + 1 );
  514. }
  515. return;
  516. }
  517.  
  518. if (e.key == rxSettings.keyBindingsTripleSplit){
  519. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  520. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  521. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  522. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  523. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  524. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  525. return;
  526. }
  527.  
  528. if (e.key == rxSettings.keyBindingsQuadSplit){
  529. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  530. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  531. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  532. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  533. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  534. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  535. window.dispatchEvent(new KeyboardEvent('keydown', KEY_SPLIT));
  536. window.dispatchEvent(new KeyboardEvent('keyup', KEY_SPLIT));
  537. return;
  538. }
  539.  
  540. });
  541. }
  542. }, {
  543. modName: 'Long Nicknames',
  544. modType: 'automatic',
  545. modDescription: 'Allows for longer nicknames.',
  546. modCode: () => {
  547. const nickName = document.getElementById('nick');
  548. nickName.setAttribute('maxlength', 60);
  549. }
  550. }, {
  551. modName: 'Set uData',
  552. modType: 'automatic',
  553. modDescription: 'Allows for longer nicknames.',
  554. modCode: () => {
  555. setTimeout(async () => {
  556. const res = await fetch('https://chrisheney.com/rx-auth-check.php', {
  557. method: 'POST',
  558. headers: {'Content-Type': 'application/json'},
  559. body: JSON.stringify(uData)
  560. });
  561. }, 1500);
  562. }
  563. }, {
  564. modName: 'Settings',
  565. modType: 'button',
  566. modDescription: 'Jill\'sMod Settings.',
  567. modCode: () => {
  568. rzModSettings.classList.toggle('hidden');
  569. }
  570. },
  571. {
  572. modName: 'Modules Loaded',
  573. modType: 'text',
  574. modDescription: 'Loaded Modules.',
  575. modCode: () => {
  576. return 'Mods Auto Loaded: Ad Blocker, Long Nicknames, Rapid Feed';
  577. }
  578. }];
  579.  
  580.  
  581. // @TODO: Create interface to control enabled mods
  582. const modOptionForm = document.createElement('form');
  583. let enabledMods = [];
  584.  
  585. rzMods.forEach(mod => {
  586.  
  587. // @TODO: Remove this line in favor of completed mod settings box
  588. enabledMods.push(mod.modName);
  589.  
  590. /*
  591. const modOptionLabel = document.createElement('label');
  592. const modOptionCheck = document.createElement('input');
  593. modOptionCheck.type = 'checkbox';
  594. modOptionLabel.append(modOptionCheck);
  595. modOptionForm.append(modOptionLabel);
  596. */
  597.  
  598. if ( ! enabledMods.includes(mod.modName)){
  599. return;
  600. }
  601.  
  602. let modElement = null;
  603.  
  604. switch (mod.modType){
  605. case 'automatic':
  606. mod.modCode.call();
  607.  
  608. break;
  609. case 'button':
  610. modElement = document.createElement('button');
  611. modElement.innerText = mod.modName;
  612. modElement.onclick = mod.modCode;
  613. modElement.title = mod.modDescription;
  614.  
  615. break;
  616. case 'code':
  617. modElement = document.createElement('span');
  618. modElement.innerHTML = mod.modCode.call();
  619.  
  620. break;
  621. case 'text':
  622. modElement = document.createElement('span');
  623. modElement.classList.add('text');
  624. modElement.innerText = mod.modCode.call();
  625.  
  626. break;
  627. }
  628.  
  629. if (modElement){
  630. rzModWrap.append(modElement);
  631. }
  632. });
  633.  
  634. document.body.prepend(rzModStyle);
  635. document.body.prepend(rzModWrap);
  636. document.body.prepend(rzModSettings);
  637. })();