Voxiom.io Key and Mouse Tracker // For Lives

Keyboard Tracker

  1. // ==UserScript==
  2. // @name Voxiom.io Key and Mouse Tracker // For Lives
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2
  5. // @description Keyboard Tracker
  6. // @author Whoami
  7. // @match *://voxiom.io/*
  8. // @grant none
  9. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js
  10. // @require https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. // CSS styles
  18. const styles = `
  19. @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600&display=swap');
  20. body {
  21. margin: 0;
  22. padding: 0;
  23. }
  24. #initialScreen {
  25. position: fixed;
  26. top: 0;
  27. left: 0;
  28. width: 100%;
  29. height: 100%;
  30. background-color: black;
  31. display: flex;
  32. align-items: center;
  33. justify-content: center;
  34. z-index: 1000;
  35. }
  36. #initialScreenText {
  37. font-family: 'Montserrat', sans-serif;
  38. font-size: 48px;
  39. color: white;
  40. cursor: pointer;
  41. }
  42. #keyMouseMenu {
  43. position: fixed;
  44. top: 50%;
  45. left: 0;
  46. transform: translateY(-50%);
  47. font-family: 'Montserrat', sans-serif;
  48. font-size: 18px;
  49. color: white;
  50. background-color: rgba(0, 0, 0, 0.8);
  51. padding: 20px;
  52. border-radius: 10px;
  53. display: none;
  54. z-index: 1000;
  55. }
  56. #keyboard {
  57. display: grid;
  58. grid-template-columns: repeat(14, 30px);
  59. gap: 5px;
  60. justify-content: center;
  61. margin-top: 20px;
  62. }
  63. .key {
  64. width: 30px;
  65. height: 30px;
  66. background-color: white;
  67. color: black;
  68. display: flex;
  69. align-items: center;
  70. justify-content: center;
  71. border-radius: 5px;
  72. font-size: 12px;
  73. text-align: center;
  74. }
  75. .key.pressed {
  76. background-color: red;
  77. }
  78. `;
  79.  
  80. // Add styles to the document
  81. const styleSheet = document.createElement("style");
  82. styleSheet.type = "text/css";
  83. styleSheet.innerText = styles;
  84. document.head.appendChild(styleSheet);
  85.  
  86. // Create initial screen
  87. const initialScreen = document.createElement('div');
  88. initialScreen.id = 'initialScreen';
  89. const initialScreenText = document.createElement('div');
  90. initialScreenText.id = 'initialScreenText';
  91. initialScreenText.innerText = '[L] To Show/Hide Keyboard';
  92. initialScreen.appendChild(initialScreenText);
  93. document.body.appendChild(initialScreen);
  94.  
  95. // Create key and mouse menu
  96. const keyMouseMenu = document.createElement('div');
  97. keyMouseMenu.id = 'keyMouseMenu';
  98. keyMouseMenu.innerHTML = '<div id="keyboard"></div>';
  99. document.body.appendChild(keyMouseMenu);
  100.  
  101. // List of keys
  102. const keys = ['ESC', 'F1', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8', 'F9', 'F10', 'F11', 'F12', 'PRTSC',
  103. '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', 'BACKSPACE',
  104. 'TAB', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '[', ']', '\\',
  105. 'CAPSLOCK', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ';', '\'', 'ENTER',
  106. 'SHIFT', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', ',', '.', '/', 'SHIFT',
  107. 'CTRL', 'WIN', 'ALT', 'SPACE', 'ALT', 'WIN', 'MENU', 'CTRL'];
  108.  
  109. // Add keys to keyboard
  110. const keyboard = document.getElementById('keyboard');
  111. keys.forEach(key => {
  112. const keyDiv = document.createElement('div');
  113. keyDiv.className = 'key';
  114. keyDiv.innerText = key;
  115. keyDiv.dataset.key = key;
  116. keyboard.appendChild(keyDiv);
  117. });
  118.  
  119. // Function to handle key presses
  120. function handleKeyPress(event) {
  121. const key = event.key.toUpperCase();
  122. const keyDiv = [...document.querySelectorAll('.key')].find(k => k.dataset.key === key);
  123. if (keyDiv) keyDiv.classList.add('pressed');
  124. }
  125.  
  126. // Function to handle key releases
  127. function handleKeyRelease(event) {
  128. const key = event.key.toUpperCase();
  129. const keyDiv = [...document.querySelectorAll('.key')].find(k => k.dataset.key === key);
  130. if (keyDiv) keyDiv.classList.remove('pressed');
  131. }
  132.  
  133. // Toggle menu visibility
  134. function toggleMenu() {
  135. if (keyMouseMenu.style.display === 'none') {
  136. keyMouseMenu.style.display = 'block';
  137. anime({
  138. targets: '#keyMouseMenu',
  139. opacity: [0, 1],
  140. duration: 500,
  141. easing: 'easeInOutQuad'
  142. });
  143. } else {
  144. anime({
  145. targets: '#keyMouseMenu',
  146. opacity: [1, 0],
  147. duration: 500,
  148. easing: 'easeInOutQuad',
  149. complete: function() {
  150. keyMouseMenu.style.display = 'none';
  151. }
  152. });
  153. }
  154. }
  155.  
  156. // Add event listeners
  157. document.addEventListener('keydown', handleKeyPress);
  158. document.addEventListener('keyup', handleKeyRelease);
  159. document.addEventListener('keydown', (event) => {
  160. if (event.key.toUpperCase() === 'L') toggleMenu();
  161. });
  162.  
  163. // Initial screen animation
  164. initialScreenText.addEventListener('mouseover', () => {
  165. anime({
  166. targets: '#initialScreen',
  167. opacity: [1, 0],
  168. duration: 6000,
  169. easing: 'easeInOutQuad',
  170. complete: function() {
  171. initialScreen.style.display = 'none';
  172. }
  173. });
  174. });
  175.  
  176. })();

QingJ © 2025

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