pvp master

let your pvp better--jk:D||press "F" when pvp||copy by Advanced zoom->https://update.gf.qytechs.cn/scripts/493029/Advanced%20zoom.user.js

  1. // ==UserScript==
  2. // @name pvp master
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description let your pvp better--jk:D||press "F" when pvp||copy by Advanced zoom->https://update.gf.qytechs.cn/scripts/493029/Advanced%20zoom.user.js
  6. // @author You
  7. // @match https://bloxd.io/
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=bloxd.io
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // Define constants for zoom levels and increment
  17. const minZoom = -100; // 100%
  18. const maxZoom = -100; // 500% (adjusted maximum zoom)
  19. const zoomIncrement = 20; // 20% (increased for faster zooming)
  20.  
  21. // Initial zoom level
  22. let zoomLevel = -100; // 100%
  23.  
  24. // Function to smoothly zoom the canvas
  25. function zoomCanvas(zoom) {
  26. const canvas = document.querySelector('canvas');
  27.  
  28. if (!canvas) {
  29. console.error('Canvas not found.');
  30. return;
  31. }
  32.  
  33. // Calculate the new zoom level within the allowed range
  34. zoomLevel = Math.min(Math.max(zoomLevel + zoom, minZoom), maxZoom);
  35.  
  36. // Apply the zoom transformation with a smooth transition
  37. canvas.style.transition = 'transform 0.5s ease';
  38. canvas.style.transform = `scale(${zoomLevel / 100})`;
  39. }
  40. // Function to handle zooming when 'F' key is pressed
  41. function handleZoom(event) {
  42. if (event.key === 'f' || event.key === 'F') {
  43. if (event.type === 'keydown') {
  44. // Zoom in when 'F' key is pressed
  45. zoomCanvas(zoomIncrement);
  46. } else if (event.type === 'keyup') {
  47. // Reset zoom to 100% when 'F' key is released
  48. zoomCanvas(100 - zoomLevel);
  49. }
  50. }
  51. }
  52.  
  53. // Add event listeners for keydown and keyup events to handle zooming with 'F' key
  54. window.addEventListener('keydown', handleZoom);
  55. window.addEventListener('keyup', handleZoom);
  56.  
  57. // Event listener for zooming with mouse wheel
  58. document.addEventListener('wheel', function(event) {
  59. // Prevent the default scroll behavior
  60. event.preventDefault();
  61.  
  62. // Determine the direction of the scroll
  63. const direction = event.deltaY > 0 ? -1 : 1;
  64.  
  65. // Zoom the canvas if zooming is active
  66. if (event.key === 'f' || event.key === 'F') {
  67. if (document.hasFocus()) {
  68. zoomCanvas(zoomIncrement * direction);
  69. }
  70. }
  71. })
  72. })();

QingJ © 2025

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