Vanis.io color name + color menu

some stuff for vanis

目前为 2022-03-05 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Vanis.io color name + color menu
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description some stuff for vanis
  6. // @author Nuro#9999
  7. // @match *://vanis.io/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=vanis.io
  9. // @require http://code.jquery.com/jquery-3.3.1.min.js
  10. // @require https://code.jquery.com/ui/1.12.0/jquery-ui.min.js
  11. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.js
  12. // @run-at document-start
  13. // @grant none
  14. // ==/UserScript==
  15.  
  16.  
  17. (function() {
  18. var local = {
  19. SCRIPT_CONFIG: {
  20. NAME_COLOR: "red", // the color, which the target name should be changed to
  21. },
  22. MENU_CONFIG: {
  23.  
  24. /* https://htmlcolorcodes.com/color-picker/ */
  25.  
  26. COLOR_1: "#20687C", // you can use color codes, rgba, hsl, rgb or just color names.
  27. COLOR_2:"#484430", // you can use color codes, rgba, hsl, rgb or just color names.
  28. RAINBOW: false, // replace false with true if you want the menu to be rainbow.
  29. },
  30.  
  31. // DO NOT CHANGE ANYTHING BELOW HERE UNLESS YOU KNOW WHAT YOU'RE DOING \\
  32.  
  33. COLOR_HUE: 0,
  34. COLOR_HUE2: 300,
  35. GAME_WS: null,
  36. GAME_INIT: false,
  37. PLAYER_PACKET_SPAWN: [],
  38. PLAYER_SOCKET: null,
  39. PLAYER_IS_DEAD: false,
  40. PLAYER_MOUSE: {
  41. x: null,
  42. y: null,
  43. },
  44. GAME_BYPASS: {
  45. mouseFrozen: Symbol(),
  46. utf8: new TextEncoder()
  47. }
  48. }
  49.  
  50. function changeHue() {
  51. 355 == local.COLOR_HUE && (local.COLOR_HUE = 0), local.COLOR_HUE++;
  52. 355 == local.COLOR_HUE2 && (local.COLOR_HUE2 = 0), local.COLOR_HUE2++;
  53. $('.fade-box').css({
  54. background: 'linear-gradient(to right bottom,hsl('+local.COLOR_HUE+', 50%, 50%),hsl('+local.COLOR_HUE2+', 50%, 50%)'
  55. })
  56. }
  57. function ready() {
  58. setInterval(() => {
  59. if(local.MENU_CONFIG.RAINBOW) {
  60. changeHue()
  61. } else {
  62. $('.fade-box').css({
  63. background: `linear-gradient(to right bottom,${local.MENU_CONFIG.COLOR_1},${local.MENU_CONFIG.COLOR_2})`
  64. })
  65. }
  66. }, 10)
  67. }
  68. const { fillText } = CanvasRenderingContext2D.prototype;
  69. CanvasRenderingContext2D.prototype.fillText = function(text, x, y) {
  70. let config = local.SCRIPT_CONFIG
  71. if(text == document.getElementById("nickname").value) {
  72. this.fillStyle = config.NAME_COLOR;
  73. }
  74. fillText.call(this, ...argments);
  75. }
  76. document.addEventListener("DOMContentLoaded", ready)
  77. })();
  78.  
  79.  
  80.  
  81.  

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址