UI MASTER+

A Bloxd.io custom client.press u to use.

当前为 2024-04-21 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name UI MASTER+
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.15
  5. // @description A Bloxd.io custom client.press u to use.
  6. // @author my_name_chinese(original) stm_cl(modify)
  7. // @match http://staging.bloxd.io/
  8. // @match https://bloxd.io/
  9. // @icon https://s3.bmp.ovh/imgs/2024/04/20/826b7c2c971bdf10.png
  10. // @grant none
  11. // @license GPLv3
  12. // ==/UserScript==
  13. (function() { //chat
  14. 'use strict';
  15. function Chat() {
  16. const chatMessages = document.querySelectorAll('.ChatMessages');
  17. const chatInput = document.querySelector('.ChatInput');
  18.  
  19. const messageStyles = {
  20. color: '#fff',
  21. padding: '10px',
  22. borderRadius: '15px 0 15px 15px',
  23. borderTopLeftRadius: '15px',
  24. boxShadow: '0 4px 8px rgba(0, 0, 0, 0.1), 0 0 20px rgba(0, 0, 0, 0.7)',
  25. backdropFilter: 'blur(5px)'
  26. };
  27.  
  28. const inputStyles = {
  29. color: '#fff',
  30. padding: '10px',
  31. borderRadius: '5px 0 5px 5px',
  32. borderTopLeftRadius: '5px',
  33. boxShadow: '0 4px 8px rgba(0, 0, 0, 0.1), 0 0 20px rgba(0, 0, 0, 0.7)',
  34. backdropFilter: 'blur(5px)'
  35. };
  36.  
  37. if (chatMessages.length > 0) {
  38. chatMessages.forEach((chatMessage) => {
  39. Object.assign(chatMessage.style, messageStyles);
  40. });
  41. }
  42.  
  43. if (chatInput) {
  44. Object.assign(chatInput.style, inputStyles);
  45. }
  46. }
  47.  
  48. setInterval(Chat, 730)
  49. })();
  50. (function () { //CPS COUNT
  51. var cpsButton = document.createElement('div');
  52. cpsButton.style.position = 'fixed';
  53. cpsButton.style.top = '10px';
  54. cpsButton.style.right = '10px';
  55. cpsButton.style.backgroundColor = 'black';
  56. cpsButton.style.color = 'white';
  57. cpsButton.style.padding = '5px';
  58. cpsButton.style.fontFamily = 'Arial';
  59. cpsButton.style.fontSize = '14px';
  60. cpsButton.style.zIndex = '9999';
  61. cpsButton.textContent = '';
  62.  
  63. var cpsLabel = document.createElement('span');
  64. cpsLabel.textContent = 'LMB CPS: ';
  65. var cpsValue = document.createElement('span');
  66. cpsValue.textContent = '0';
  67.  
  68. cpsButton.appendChild(cpsLabel);
  69. cpsButton.appendChild(cpsValue);
  70. document.body.appendChild(cpsButton);
  71.  
  72. cpsButton.addEventListener('click', function () {
  73. resetClickCount();
  74. });
  75.  
  76. var clickTimes = [];
  77.  
  78. document.addEventListener('mousedown', function (event) {
  79. if (event.button === 0) {
  80. countClick();
  81. }
  82. });
  83.  
  84. function countClick() {
  85. var currentTime = new Date().getTime();
  86. clickTimes.push(currentTime);
  87. updateCPS();
  88. }
  89.  
  90. function updateCPS() {
  91. var currentTime = new Date().getTime();
  92. var oneSecondAgo = currentTime - 1000;
  93. var count = 0;
  94.  
  95. for (var i = clickTimes.length - 1; i >= 0; i--) {
  96. if (clickTimes[i] >= oneSecondAgo) {
  97. count++;
  98. } else {
  99. break;
  100. }
  101. }
  102.  
  103. cpsValue.textContent = count;
  104. }
  105.  
  106. function resetClickCount() {
  107. clickTimes = [];
  108. updateCPS();
  109. }
  110. })();
  111.  
  112. // Create a div for right-click CPS
  113. var rmbCPSButton = document.createElement('div');
  114. rmbCPSButton.style.position = 'fixed';
  115. rmbCPSButton.style.top = '50px'; // Position it below the LMB CPS
  116. rmbCPSButton.style.right = '10px';
  117. rmbCPSButton.style.backgroundColor = 'black';
  118. rmbCPSButton.style.color = 'white';
  119. rmbCPSButton.style.padding = '5px';
  120. rmbCPSButton.style.fontFamily = 'Arial';
  121. rmbCPSButton.style.fontSize = '14px';
  122. rmbCPSButton.style.zIndex = '9999';
  123. rmbCPSButton.textContent = '';
  124.  
  125. var rmbCPSLabel = document.createElement('span');
  126. rmbCPSLabel.textContent = 'RMB CPS: ';
  127. var rmbCPSValue = document.createElement('span');
  128. rmbCPSValue.textContent = '0';
  129.  
  130. rmbCPSButton.appendChild(rmbCPSLabel);
  131. rmbCPSButton.appendChild(rmbCPSValue);
  132. document.body.appendChild(rmbCPSButton);
  133.  
  134. // Event listeners for right-click
  135. var rmbClickTimes = [];
  136.  
  137. document.addEventListener('mousedown', function (event) {
  138. if (event.button === 2) { // Check for right mouse button
  139. countRightClick(); // Function to track right-clicks
  140. }
  141. });
  142.  
  143. function countRightClick() {
  144. var currentTime = new Date().getTime();
  145. rmbClickTimes.push(currentTime);
  146. updateRightClickCPS();
  147. }
  148.  
  149. function updateRightClickCPS() {
  150. var currentTime = new Date().getTime();
  151. var oneSecondAgo = currentTime - 1000;
  152. var count = 0;
  153.  
  154. for (var i = rmbClickTimes.length - 1; i >= 0; i--) {
  155. if (rmbClickTimes[i] >= oneSecondAgo) {
  156. count++;
  157. } else {
  158. break;
  159. }
  160. }
  161.  
  162. rmbCPSValue.textContent = count;
  163. }
  164.  
  165. (function() { //UI MASTER
  166. 'use strict';
  167.  
  168. let bindpresscolor = "#3366ff";
  169. let bindunpresscolor = "#66ccff";
  170. // Define Main Menu
  171. let clientMainMenu;
  172. clientMainMenu = document.createElement("div");
  173. clientMainMenu.textContent = "UI MASTER";
  174. clientMainMenu.style.position = "fixed";
  175. clientMainMenu.style.color = "#1B4F72";
  176. clientMainMenu.style.textShadow = "3px 3px 4px white";
  177. clientMainMenu.style.top = "50%";
  178. clientMainMenu.style.left = "50%";
  179. clientMainMenu.style.transform = "translate(-50%, -50%)";
  180. clientMainMenu.style.zIndex = "10000";
  181. clientMainMenu.style.borderRadius = "10px";
  182. clientMainMenu.style.backgroundImage = "url(https://s3.bmp.ovh/imgs/2024/04/20/826b7c2c971bdf10.png)";
  183. clientMainMenu.style.backgroundRepeat = "no-repeat";
  184. clientMainMenu.style.backgroundSize = "cover";
  185. clientMainMenu.style.backgroundPosition = "center";
  186. clientMainMenu.style.boxShadow = "0px 0px 20px rgba(0, 0, 0, 0.5)";
  187. clientMainMenu.style.fontSize = "24px";
  188. clientMainMenu.style.height = "600px";
  189. clientMainMenu.style.width = "500px";
  190. clientMainMenu.style.textAlign = "center";
  191. clientMainMenu.style.lineHeight = "50px";
  192. clientMainMenu.style.visibility = "hidden";
  193. clientMainMenu.style.opacity = "99%";
  194. clientMainMenu.style.userSelect = "none";
  195.  
  196.  
  197. let bindMainMenu;
  198. bindMainMenu = document.createElement("div");
  199. bindMainMenu.style.position = "fixed";
  200. bindMainMenu.style.backgroundcolor = "#2E86C1"
  201. bindMainMenu.style.opacity = '0.1';
  202. bindMainMenu.style.color = "#1B4F72";
  203. bindMainMenu.style.textShadow = "3px 3px 4px white";
  204. bindMainMenu.style.top = "90%";
  205. bindMainMenu.style.left = "10%";
  206. bindMainMenu.style.transform = "translate(-50%, -50%)";
  207. bindMainMenu.style.zIndex = "10000";
  208. bindMainMenu.style.borderRadius = "10px";
  209. bindMainMenu.style.backgroundRepeat = "no-repeat";
  210. bindMainMenu.style.backgroundSize = "cover";
  211. bindMainMenu.style.backgroundPosition = "center";
  212. bindMainMenu.style.fontSize = "24px";
  213. bindMainMenu.style.height = "300px";
  214. bindMainMenu.style.width = "400px";
  215. bindMainMenu.style.textAlign = "center";
  216. bindMainMenu.style.lineHeight = "50px";
  217. bindMainMenu.style.visibility = "hidden";
  218. bindMainMenu.style.opacity = "99%";
  219. bindMainMenu.style.userSelect = "none";
  220.  
  221.  
  222. // Define Button Elements
  223. let wkey;
  224. wkey = document.createElement('div');
  225. wkey.style.position = "relative";
  226. wkey.style.color = "#ffffff";
  227. wkey.textContent = "W";
  228. wkey.style.top = "-5px";
  229. wkey.style.left = "160px";
  230. wkey.style.zIndex = "10000";
  231. wkey.style.fontWeight = "bold";
  232. wkey.style.borderRadius = "10px";
  233. wkey.style.backgroundColor = bindunpresscolor;
  234. wkey.style.fontSize = "24px";
  235. wkey.style.height = "50px";
  236. wkey.style.width = "50px";
  237. wkey.style.textAlign = "center";
  238. wkey.style.lineHeight = "50px";
  239. wkey.style.filter = "blur(1px)";
  240. bindMainMenu.appendChild(wkey);
  241.  
  242.  
  243. let skey;
  244. skey = document.createElement('div');
  245. skey.style.position = "relative";
  246. skey.style.color = "#ffffff";
  247. skey.textContent = "S";
  248. skey.style.top = "0px";
  249. skey.style.left = "50%";
  250. skey.style.transform = "translateX(-50%)";
  251. skey.style.zIndex = "10000";
  252. skey.style.fontWeight = "bold";
  253. skey.style.borderRadius = "10px";
  254. skey.style.backgroundColor = bindunpresscolor;
  255. skey.style.fontSize = "24px";
  256. skey.style.height = "50px";
  257. skey.style.width = "50px";
  258. skey.style.textAlign = "center";
  259. skey.style.lineHeight = "50px";
  260. skey.style.filter = "blur(1px)";
  261. bindMainMenu.appendChild(skey);
  262.  
  263. let akey;
  264. akey = document.createElement('div');
  265. akey.style.position = "relative";
  266. akey.style.color = "#ffffff";
  267. akey.textContent = "A";
  268. akey.style.top = "-50px";
  269. akey.style.left = "140px";
  270. akey.style.transform = "translateX(-50%)";
  271. akey.style.zIndex = "10000";
  272. akey.style.fontWeight = "bold";
  273. akey.style.borderRadius = "10px";
  274. akey.style.backgroundColor = bindunpresscolor;
  275. akey.style.fontSize = "24px";
  276. akey.style.height = "50px";
  277. akey.style.width = "50px";
  278. akey.style.textAlign = "center";
  279. akey.style.lineHeight = "50px";
  280. akey.style.filter = "blur(1px)";
  281. bindMainMenu.appendChild(akey);
  282.  
  283. let dkey;
  284. dkey = document.createElement('div');
  285. dkey.style.position = "relative";
  286. dkey.style.color = "#ffffff";
  287. dkey.textContent = "D";
  288. dkey.style.top = "-100px";
  289. dkey.style.left = "260px";
  290. dkey.style.transform = "translateX(-50%)";
  291. dkey.style.zIndex = "10000";
  292. dkey.style.fontWeight = "bold";
  293. dkey.style.borderRadius = "10px";
  294. dkey.style.backgroundColor = bindunpresscolor;
  295. dkey.style.fontSize = "24px";
  296. dkey.style.height = "50px";
  297. dkey.style.width = "50px";
  298. dkey.style.textAlign = "center";
  299. dkey.style.lineHeight = "50px";
  300. dkey.style.filter = "blur(1px)";
  301. bindMainMenu.appendChild(dkey);
  302.  
  303. let lmb;
  304. lmb = document.createElement('div');
  305. lmb.style.position = "relative";
  306. lmb.style.color = "#ffffff";
  307. lmb.textContent = "LMB";
  308. lmb.style.top = "-90px";
  309. lmb.style.left = "140px";
  310. lmb.style.transform = "translateX(-50%)";
  311. lmb.style.zIndex = "10000";
  312. lmb.style.fontWeight = "bold";
  313. lmb.style.borderRadius = "10px";
  314. lmb.style.backgroundColor = bindunpresscolor;
  315. lmb.style.fontSize = "18px";
  316. lmb.style.height = "50px";
  317. lmb.style.width = "100px";
  318. lmb.style.textAlign = "center";
  319. lmb.style.lineHeight = "50px";
  320. lmb.style.filter = "blur(1px)";
  321. bindMainMenu.appendChild(lmb);
  322.  
  323. let rmb;
  324. rmb = document.createElement('div');
  325. rmb.style.position = "relative";
  326. rmb.style.color = "#ffffff";
  327. rmb.textContent = "RMB";
  328. rmb.style.top = "-140px";
  329. rmb.style.left = "260px";
  330. rmb.style.transform = "translateX(-50%)";
  331. rmb.style.zIndex = "10000";
  332. rmb.style.fontWeight = "bold";
  333. rmb.style.borderRadius = "10px";
  334. rmb.style.backgroundColor = bindunpresscolor;
  335. rmb.style.fontSize = "18px";
  336. rmb.style.height = "50px";
  337. rmb.style.width = "100px";
  338. rmb.style.textAlign = "center";
  339. rmb.style.lineHeight = "50px";
  340. rmb.style.filter = "blur(1px)";
  341. bindMainMenu.appendChild(rmb);
  342.  
  343. let space;
  344. space = document.createElement('div');
  345. space.style.position = "relative";
  346. space.style.color = "#ffffff";
  347. space.textContent = "SPACE";
  348. space.style.top = "-125px";
  349. space.style.left = "200px";
  350. space.style.transform = "translateX(-50%)";
  351. space.style.zIndex = "10000";
  352. space.style.fontWeight = "bold";
  353. space.style.borderRadius = "10px";
  354. space.style.backgroundColor = bindunpresscolor;
  355. space.style.fontSize = "18px";
  356. space.style.height = "50px";
  357. space.style.width = "220px";
  358. space.style.textAlign = "center";
  359. space.style.lineHeight = "50px";
  360. space.style.filter = "blur(1px)";
  361. bindMainMenu.appendChild(space);
  362.  
  363. let shift;
  364. shift = document.createElement('div');
  365. shift.style.position = "relative";
  366. shift.style.color = "#ffffff";
  367. shift.textContent = "SHIFT";
  368. shift.style.top = "-240px";
  369. shift.style.left = "50px";
  370. shift.style.transform = "translateX(-50%)";
  371. shift.style.zIndex = "10000";
  372. shift.style.fontWeight = "bold";
  373. shift.style.borderRadius = "10px";
  374. shift.style.backgroundColor = bindunpresscolor;
  375. shift.style.fontSize = "18px";
  376. shift.style.height = "100px";
  377. shift.style.width = "50px";
  378. shift.style.textAlign = "center";
  379. shift.style.lineHeight = "100px";
  380. shift.style.filter = "blur(1px)";
  381. bindMainMenu.appendChild(shift);
  382.  
  383. let caps;
  384. caps = document.createElement('div');
  385. caps.style.position = "relative";
  386. caps.style.color = "#ffffff";
  387. caps.textContent = "C";
  388. caps.style.top = "-340px";
  389. caps.style.left = "350px";
  390. caps.style.transform = "translateX(-50%)";
  391. caps.style.zIndex = "10000";
  392. caps.style.fontWeight = "bold";
  393. caps.style.borderRadius = "10px";
  394. caps.style.backgroundColor = bindunpresscolor;
  395. caps.style.fontSize = "18px";
  396. caps.style.height = "100px";
  397. caps.style.width = "50px";
  398. caps.style.textAlign = "center";
  399. caps.style.lineHeight = "100px";
  400. caps.style.filter = "blur(1px)";
  401. bindMainMenu.appendChild(caps);
  402.  
  403. // Add the elements to the body and the clientMainMenu
  404. document.body.appendChild(bindMainMenu);
  405. document.body.appendChild(clientMainMenu);
  406.  
  407. // Add Event Listeners for the Keybinds
  408.  
  409. document.addEventListener('keydown', function(event) {
  410. if (event.key === 'w') {
  411. wkey.style.backgroundColor = bindpresscolor;
  412. }
  413. if (event.key === 's') {
  414. skey.style.backgroundColor = bindpresscolor;
  415. }
  416. if (event.key === 'a') {
  417. akey.style.backgroundColor = bindpresscolor;
  418. }
  419. if (event.key === 'd') {
  420. dkey.style.backgroundColor = bindpresscolor;
  421. }
  422. if (event.key === ' ') {
  423. space.style.backgroundColor = bindpresscolor;
  424. }
  425. if (event.key === 'Shift') {
  426. shift.style.backgroundColor = bindpresscolor;
  427. }
  428. if (event.key === 'c') {
  429. caps.style.backgroundColor = bindpresscolor;
  430. }
  431. });
  432.  
  433. document.addEventListener('keyup', function(event) {
  434. if (event.key === 'w') {
  435. wkey.style.backgroundColor = bindunpresscolor;
  436. }
  437. if (event.key === 's') {
  438. skey.style.backgroundColor = bindunpresscolor;
  439. }
  440. if (event.key === 'a') {
  441. akey.style.backgroundColor = bindunpresscolor;
  442. }
  443. if (event.key === 'd') {
  444. dkey.style.backgroundColor = bindunpresscolor;
  445. }
  446. if (event.key === ' ') {
  447. space.style.backgroundColor = bindunpresscolor;
  448. }
  449. if (event.key === 'Shift') {
  450. shift.style.backgroundColor = bindunpresscolor;
  451. }
  452. if (event.key === 'c') {
  453. caps.style.backgroundColor = bindunpresscolor;
  454. }
  455. });
  456.  
  457. document.addEventListener('mousedown', function(event) {
  458. if (event.button === 0) {
  459. lmb.style.backgroundColor = bindpresscolor;
  460. }
  461. if (event.button === 2) {
  462. rmb.style.backgroundColor = bindpresscolor;
  463. }
  464. });
  465.  
  466. document.addEventListener('mouseup', function(event) {
  467. if (event.button === 0) {
  468. lmb.style.backgroundColor = bindunpresscolor;
  469. }
  470. if (event.button === 2) {
  471. rmb.style.backgroundColor = bindunpresscolor;
  472. }
  473. });
  474.  
  475. // Define Main Menu dragging
  476.  
  477. let mainisDragging = false;
  478. let offsetX = 0;
  479. let offsetY = 0;
  480.  
  481. clientMainMenu.addEventListener('mousedown', function(event) {
  482. if (event.target.nodeName !== 'INPUT') {
  483. mainisDragging = true;
  484. offsetX = event.clientX;
  485. offsetY = event.clientY;
  486. }
  487. });
  488.  
  489. document.addEventListener('mousemove', function(event) {
  490. if (mainisDragging) {
  491. const left = event.clientX;
  492. const top = event.clientY;
  493.  
  494. clientMainMenu.style.left = left + "px";
  495. clientMainMenu.style.top = top + "px";
  496. }
  497. });
  498.  
  499. document.addEventListener('mouseup', function() {
  500. mainisDragging = false;
  501. });
  502.  
  503. let bindisDragging = false;
  504. let offsetX1 = 0;
  505. let offsetY1 = 0;
  506.  
  507. bindMainMenu.addEventListener('mousedown', function(event) {
  508. if (event.target.nodeName !== 'INPUT') {
  509. bindisDragging = true;
  510. offsetX = event.clientX;
  511. offsetY = event.clientY;
  512. }
  513. });
  514.  
  515. document.addEventListener('mousemove', function(event) {
  516. if (bindisDragging) {
  517. const left = event.clientX;
  518. const top = event.clientY;
  519.  
  520. bindMainMenu.style.left = left + "px";
  521. bindMainMenu.style.top = top + "px";
  522. }
  523. });
  524.  
  525. document.addEventListener('mouseup', function() {
  526. bindisDragging = false;
  527. });
  528. document.addEventListener('keydown', function(event) {
  529. if (event.key === 'U' || event.key === 'u') {
  530. clientMainMenu.style.visibility = clientMainMenu.style.visibility === "hidden" ? "visible" : "hidden";
  531. }
  532. });
  533.  
  534. // Define imputs and main menu text
  535.  
  536. let clientheader
  537. clientheader = document.createElement("div");
  538. clientheader.textContent = "Made By my_name_chinese";
  539. clientheader.style.position = "absolute";
  540. clientheader.style.top = "20px";
  541. clientheader.style.left = "50%";
  542. clientheader.style.transform = "translateX(-50%)";
  543. clientheader.style.fontSize = "15px";
  544. clientMainMenu.appendChild(clientheader);
  545.  
  546. // Create the button element
  547. const bilibutton = document.createElement("div");
  548. bilibutton.style.position = "absolute";
  549. bilibutton.style.top = "60px";
  550. bilibutton.style.left = "50%";
  551. bilibutton.style.transform = "translateX(-50%)";
  552. bilibutton.style.cursor = "pointer";
  553. bilibutton.style.backgroundColor = "#66ccff";
  554. bilibutton.style.backgroundImage = "linear-gradient(to bottom, #2E86C1, #AED6F1)";
  555. bilibutton.style.color = "#1B4F72";
  556. bilibutton.style.borderRadius = "10px";
  557. bilibutton.style.height = "40px";
  558. bilibutton.style.padding = "8px";
  559. bilibutton.addEventListener("click", function() {
  560. window.location.href = "https://space.bilibili.com/3546388900088449?spm_id_from=333.1007.0.0";
  561. });
  562.  
  563. // Create the text element
  564. const bilibuttonText = document.createElement("div");
  565. bilibuttonText.textContent = "my_name_bilibili_acc";
  566. bilibuttonText.style.fontSize = "20px";
  567. bilibuttonText.style.textAlign = "center";
  568. bilibuttonText.style.top = "50%";
  569. bilibuttonText.style.transform = "translateY(-25%)";
  570.  
  571. // Append the text element to the button element
  572. bilibutton.appendChild(bilibuttonText);
  573.  
  574. // Append the button element to the desired parent element
  575. clientMainMenu.appendChild(bilibutton);
  576.  
  577.  
  578. let clientsettingstext;
  579. clientsettingstext = document.createElement("div");
  580. clientsettingstext.textContent = "- Client Settings -";
  581. clientsettingstext.style.position = "absolute";
  582. clientsettingstext.style.color = "#1B4F72"
  583. clientsettingstext.style.top = "120px";
  584. clientsettingstext.style.left = "50%";
  585. clientsettingstext.style.transform = "translateX(-50%)";
  586. clientsettingstext.style.fontSize = "20px";
  587. clientMainMenu.appendChild(clientsettingstext);
  588.  
  589. let clientsettingsinput
  590. clientsettingsinput = document.createElement("input");
  591. clientsettingsinput.type = "text";
  592. clientsettingsinput.placeholder = "Client Background URL";
  593. clientsettingsinput.style.backgroundColor = '#AED6F1';
  594. clientsettingsinput.style.border = '3px double #1B4F72';
  595. clientsettingsinput.style.position = "absolute";
  596. clientsettingsinput.style.top = "160px";
  597. clientsettingsinput.style.left = "50%";
  598. clientsettingsinput.style.transform = "translateX(-50%)";
  599. clientMainMenu.appendChild(clientsettingsinput);
  600.  
  601. clientsettingsinput.addEventListener('input', function() {
  602. clientMainMenu.style.backgroundImage = `url(${clientsettingsinput.value})`;
  603. });
  604.  
  605. clientsettingsinput.addEventListener('mousedown', function(event) {
  606. event.stopPropagation();
  607. });
  608.  
  609. let hotbarsettingstext;
  610. hotbarsettingstext = document.createElement("div");
  611. hotbarsettingstext.textContent = "- HotBar Settings -";
  612. hotbarsettingstext.style.position = "absolute";
  613. hotbarsettingstext.style.top = "220px";
  614. hotbarsettingstext.style.left = "50%";
  615. hotbarsettingstext.style.transform = "translateX(-50%)";
  616. hotbarsettingstext.style.fontSize = "20px";
  617. clientMainMenu.appendChild(hotbarsettingstext);
  618.  
  619. let hotbarmaincolorinput
  620. hotbarmaincolorinput = document.createElement("input");
  621. hotbarmaincolorinput.type = "color";
  622. hotbarmaincolorinput.value = "#3d4b79"
  623. hotbarmaincolorinput.style.top = "250px";
  624. hotbarmaincolorinput.style.marginTop = "15px";
  625. hotbarmaincolorinput.style.position = "absolute";
  626. hotbarmaincolorinput.style.left = "44%";
  627. hotbarmaincolorinput.style.opacity = 1;
  628. hotbarmaincolorinput.style.transform = "translateX(-50%)";
  629. clientMainMenu.appendChild(hotbarmaincolorinput);
  630.  
  631. hotbarmaincolorinput.addEventListener("input", function() {
  632. const color = hotbarmaincolorinput.value;
  633. hotbarmaincolorinput.value = color;
  634. const hotbars = document.querySelectorAll(".item");
  635. hotbars.forEach(function(hotbar) {
  636. hotbar.style.backgroundColor = color;
  637. });
  638. });
  639.  
  640. let hotbarbordercolorinput;
  641. hotbarbordercolorinput = document.createElement("input");
  642. hotbarbordercolorinput.type = "color";
  643. hotbarbordercolorinput.style.top = "250px";
  644. hotbarbordercolorinput.value = "#303a59";
  645. hotbarbordercolorinput.style.marginTop = "15px";
  646. hotbarbordercolorinput.style.position = "absolute";
  647. hotbarbordercolorinput.style.left = "56%";
  648. hotbarbordercolorinput.style.transform = "translateX(-50%)";
  649. hotbarbordercolorinput.style.opacity = 1;
  650. clientMainMenu.appendChild(hotbarbordercolorinput);
  651.  
  652. hotbarbordercolorinput.addEventListener("input", function() {
  653. const color = hotbarbordercolorinput.value;
  654. hotbarbordercolorinput.value = color;
  655. const hotbars = document.querySelectorAll(".item");
  656.  
  657. hotbars.forEach(function(hotbar) {
  658. hotbar.style.borderColor = color;
  659. });
  660. });
  661.  
  662. let hotbarborderradiusinput;
  663. hotbarborderradiusinput = document.createElement("input");
  664. hotbarborderradiusinput.type = "range";
  665. hotbarborderradiusinput.style.top = "280px";
  666. hotbarborderradiusinput.style.marginTop = "10px";
  667. hotbarborderradiusinput.style.position = "absolute";
  668. hotbarborderradiusinput.value = "20";
  669. hotbarborderradiusinput.style.left = "50%";
  670. hotbarborderradiusinput.min = "0";
  671. hotbarborderradiusinput.max = "30";
  672. hotbarborderradiusinput.style.transform = "translateX(-50%)";
  673. clientMainMenu.appendChild(hotbarborderradiusinput);
  674.  
  675. hotbarborderradiusinput.addEventListener("input", function() {
  676. const hotbarrounding = hotbarborderradiusinput.value;
  677. const hotbars = document.querySelectorAll(".item");
  678.  
  679. hotbars.forEach(function(hotbar) {
  680. hotbar.style.borderRadius = hotbarrounding + "px";
  681. });
  682. });
  683.  
  684. let crosshairsettingstext
  685. crosshairsettingstext = document.createElement("div");
  686. crosshairsettingstext.textContent = "- Crosshair Settings -";
  687. crosshairsettingstext.style.position = "absolute";
  688. crosshairsettingstext.style.top = "320px";
  689. crosshairsettingstext.style.left = "50%";
  690. crosshairsettingstext.style.transform = "translateX(-50%)";
  691. crosshairsettingstext.style.fontSize = "20px";
  692. clientMainMenu.appendChild(crosshairsettingstext);
  693.  
  694. let crosshairsettingsinput;
  695. crosshairsettingsinput = document.createElement("input");
  696. crosshairsettingsinput.type = "text";
  697. crosshairsettingsinput.placeholder = "Crosshair URL";
  698. crosshairsettingsinput.style.backgroundColor = '#AED6F1';
  699. crosshairsettingsinput.style.border = '3px double #1B4F72';
  700. crosshairsettingsinput.style.position = "absolute";
  701. crosshairsettingsinput.style.top = "360px";
  702. crosshairsettingsinput.value = "https://s3.bmp.ovh/imgs/2024/04/14/7f04eab3528d86ab.png";
  703. crosshairsettingsinput.style.left = "50%";
  704. crosshairsettingsinput.style.transform = "translateX(-50%)";
  705. clientMainMenu.appendChild(crosshairsettingsinput);
  706.  
  707. let crosshairurl;
  708. crosshairurl = `url(${crosshairsettingsinput.value})`;
  709. crosshairsettingsinput.addEventListener('input', function() {
  710. crosshairurl = `url(${crosshairsettingsinput.value})`;
  711. });
  712.  
  713. crosshairsettingsinput.addEventListener('mousedown', function(event) {
  714. event.stopPropagation();
  715. });
  716.  
  717. let keybindsettingstext;
  718. keybindsettingstext = document.createElement("div");
  719. keybindsettingstext.textContent = "- Keybind Settings -";
  720. keybindsettingstext.style.position = "absolute";
  721. keybindsettingstext.style.top = "420px";
  722. keybindsettingstext.style.left = "50%";
  723. keybindsettingstext.style.transform = "translateX(-50%)";
  724. keybindsettingstext.style.fontSize = "20px";
  725. clientMainMenu.appendChild(keybindsettingstext);
  726.  
  727. let keybindsettingbotton;
  728. keybindsettingbotton = document.createElement("div");
  729. keybindsettingbotton.textContent = "- Keybind Settings -";
  730. keybindsettingbotton.style.position = "absolute";
  731. keybindsettingbotton.style.top = "420px";
  732. keybindsettingbotton.style.left = "50%";
  733. keybindsettingbotton.style.transform = "translateX(-50%)";
  734. keybindsettingbotton.style.fontSize = "20px";
  735. clientMainMenu.appendChild(keybindsettingbotton);
  736.  
  737. // Create the button element
  738. const bindbutton = document.createElement("div");
  739. bindbutton.style.position = "absolute";
  740. bindbutton.style.top = "470px";
  741. bindbutton.style.fontSize = "20px";
  742. bindbutton.style.left = "50%";
  743. bindbutton.style.transform = "translateX(-50%)";
  744. bindbutton.style.cursor = "pointer";
  745. bindbutton.style.borderRadius = "10px";
  746. bindbutton.style.backgroundColor = "#AED6F1";
  747. bindbutton.style.color = "#1B4F72";
  748. bindbutton.style.borderRadius = "10px";
  749. bindbutton.style.height = "40px";
  750. bindbutton.style.padding = "8px";
  751. bindbutton.innerHTML = 'keybind:ON'; // 初始文本为"ON"
  752. var isOn = true; // 初始状态为true
  753. bindMainMenu.style.visibility = 'visible';
  754. bindbutton.addEventListener("click", function() {
  755. isOn = !isOn; // 切换状态
  756. bindbutton.innerHTML = isOn ? 'keybind:ON' : 'keybind:OFF'; // 根据状态设置按钮文本
  757.  
  758. // 根据状态显示或隐藏元素
  759. bindMainMenu.style.visibility = isOn ? 'visible' : 'hidden';
  760. });
  761.  
  762. // Append the button element to the desired parent element
  763. clientMainMenu.appendChild(bindbutton);
  764.  
  765. let bindbgcolorinput
  766. bindbgcolorinput = document.createElement("input");
  767. bindbgcolorinput.type = "color";
  768. bindbgcolorinput.value = bindunpresscolor;
  769. bindbgcolorinput.style.top = "520px";
  770. bindbgcolorinput.style.marginTop = "15px";
  771. bindbgcolorinput.style.position = "absolute";
  772. bindbgcolorinput.style.left = "44%";
  773. bindbgcolorinput.style.transform = "translateX(-50%)";
  774. clientMainMenu.appendChild(bindbgcolorinput);
  775.  
  776. bindbgcolorinput.addEventListener("input", function() {
  777. const bindcolor = bindbgcolorinput.value;
  778. bindunpresscolor = bindcolor;
  779. wkey.style.backgroundColor = bindunpresscolor;
  780. skey.style.backgroundColor = bindunpresscolor;
  781. akey.style.backgroundColor = bindunpresscolor;
  782. dkey.style.backgroundColor = bindunpresscolor;
  783. rmb.style.backgroundColor = bindunpresscolor;
  784. lmb.style.backgroundColor = bindunpresscolor;
  785. space.style.backgroundColor = bindunpresscolor;
  786. shift.style.backgroundColor = bindunpresscolor;
  787. caps.style.backgroundColor = bindunpresscolor;
  788. });
  789.  
  790. let bindpresscolorinput;
  791. bindpresscolorinput = document.createElement("input");
  792. bindpresscolorinput.type = "color";
  793. bindpresscolorinput.style.top = "520px";
  794. bindpresscolorinput.value = bindpresscolor;
  795. bindpresscolorinput.style.marginTop = "15px";
  796. bindpresscolorinput.style.position = "absolute";
  797. bindpresscolorinput.style.left = "56%";
  798. bindpresscolorinput.style.transform = "translateX(-50%)";
  799. clientMainMenu.appendChild(bindpresscolorinput);
  800.  
  801. bindpresscolorinput.addEventListener("input", function() {
  802. const bindprcolor = bindpresscolorinput.value;
  803. bindpresscolor = bindprcolor;
  804. });
  805.  
  806. let bindtextcolorinput;
  807. bindtextcolorinput = document.createElement("input");
  808. bindtextcolorinput.type = "color";
  809. bindtextcolorinput.style.top = "550px";
  810. bindtextcolorinput.value = "#ffffff";
  811. bindtextcolorinput.style.marginTop = "15px";
  812. bindtextcolorinput.style.position = "absolute";
  813. bindtextcolorinput.style.left = "50%";
  814. bindtextcolorinput.style.transform = "translateX(-50%)";
  815. clientMainMenu.appendChild(bindtextcolorinput);
  816.  
  817. bindtextcolorinput.addEventListener("input", function() {
  818. const bindtextcolor = bindtextcolorinput.value;
  819. bindMainMenu.style.textShadow = "3px 3px 4px" + bindtextcolor;
  820. wkey.style.color = bindtextcolor;
  821. skey.style.color = bindtextcolor;
  822. akey.style.color = bindtextcolor;
  823. dkey.style.color = bindtextcolor;
  824. rmb.style.color = bindtextcolor;
  825. lmb.style.color = bindtextcolor;
  826. space.style.color = bindtextcolor;
  827. shift.style.color = bindtextcolor;
  828. caps.style.color = bindtextcolor;
  829. });
  830.  
  831.  
  832. setInterval(function() {
  833. const color1 = hotbarmaincolorinput.value;
  834. const color2 = hotbarbordercolorinput.value
  835. const hotbarrounding = hotbarborderradiusinput.value;
  836. const hotbars = document.querySelectorAll(".item");
  837. hotbars.forEach(function(hotbar) {
  838. hotbar.style.borderRadius = hotbarrounding + "px";
  839. hotbar.style.borderColor = color2;
  840. hotbar.style.backgroundColor = color1;
  841. });
  842. const crosshair = document.querySelector(".CrossHair");
  843. if (crosshair) {
  844. crosshair.textContent = "";
  845. crosshair.style.backgroundImage = crosshairurl; // Use the crosshairurl variable here
  846. crosshair.style.backgroundRepeat = "no-repeat";
  847. crosshair.style.backgroundSize = "contain";
  848. crosshair.style.width = "30px";
  849. crosshair.style.height = "30px";
  850. }
  851. }, 1000);
  852.  
  853. })();