Agma Animation Panel

animation

当前为 2024-06-15 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Agma Animation Panel
  3. // @version 0.1
  4. // @match *://agma.io/*
  5. // @icon https://www.google.com/s2/favicons?sz=64&domain=agma.io
  6. // @grant unsafeWindow
  7. // @author Anonymous Agma
  8. // @run-at document-start
  9. // @description animation
  10. // @namespace hi
  11. // ==/UserScript==
  12.  
  13. let send;
  14. let status = false;
  15. const osend = WebSocket.prototype.send
  16. WebSocket.prototype.send = function () {
  17. send = (...args) => osend.call(this, ...args)
  18. return osend.apply(this, arguments)
  19. }
  20. unsafeWindow.anim = (id) => send(new Uint8Array([0xb3, id]));
  21. window.addEventListener('load', (event) => {
  22. $('body').append(`
  23. <div id="fushykng" style="
  24. background-color: #2b2929a6;
  25. position: fixed;
  26. right: 10px;
  27. top: 54%;
  28. border-radius: 5px;
  29. transform: translateY(-50%);
  30. display: grid;
  31. gap: 10px 10px;
  32. margin-top: 20px;
  33. grid-template-columns: repeat(5, 1fr);
  34. ">
  35. <style >#fushykng>div{
  36. padding: 5px;
  37. background-color: #ffffff26;
  38. border-radius: 5px;
  39. border: 1px #ffffff40 solid;
  40. }</style>
  41. `);
  42. for(let i = 1; i < 60; i++) $('#fushykng').append(`<div onclick="anim(${i})">${i}</div>`);
  43. document.addEventListener("keydown", event => {
  44. if (event.code == 'Numpad1') {
  45. if(status == false){
  46. status = true;
  47. document.getElementById("fushykng").style.visibility = "hidden";
  48. } else {
  49. status = false;
  50. document.getElementById("fushykng").style.visibility = "visible";
  51. }
  52. }
  53. });
  54. });