Zoom Hack

Użyj skrola by oddalić lub przybliżyć

  1. // ==UserScript==
  2. // @name Zoom Hack
  3. // @namespace KROKIk
  4. // @version 1
  5. // @description Użyj skrola by oddalić lub przybliżyć
  6. // @author KROKIk
  7. // @match http://vertix.io/*
  8. // @match http://www.vertix.io/*
  9. // @include http://vertix.io/*
  10. // @include http://www.vertix.io/*
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. var scrollDelta = 0,
  15. cvs = document.getElementById('cvs');
  16. cvs.addEventListener('mousewheel', zoom, false);
  17. cvs.addEventListener('DOMMouseScroll', zoom, false);
  18.  
  19.  
  20. function zoom(a) {
  21. userScroll = overlayFadeUp = overlayFadeDown = overlayMaxAlpha = 0
  22. animateOverlay = false
  23. a = window.event || a;
  24. a.preventDefault();
  25. a.stopPropagation();
  26. scrollDelta = Math.max(-1, Math.min(1, a.wheelDelta || -a.detail));
  27. if (socket && scrollDelta == -1 && maxScreenHeight < 4000) {
  28. (maxScreenHeight = maxScreenWidth += 250);
  29. resize();
  30. scrollDelta = 0;
  31. viewMult = 100 //dont want to calculate viewMult relative to the new screen width/height, so ill just hide it for now
  32. }
  33. if (socket && scrollDelta == 1 && maxScreenHeight > 1000) {
  34. (maxScreenHeight = maxScreenWidth -= 250);
  35. resize();
  36. scrollDelta = 0;
  37. viewMult = 100
  38. }
  39. }
  40.