Moving touch buttons in tetr.js

title

当前为 2020-02-02 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Moving touch buttons in tetr.js
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.6
  5. // @author Oki
  6. // @description title
  7. // @match http://farter.cn/tetr.js/
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. window.addEventListener('load', function(){
  15.  
  16.  
  17. /*
  18. if(typeof trim != "function"){var trim=a=>{a=a.slice(0,-1);a=a.substr(a.indexOf("{")+1);return a}}
  19.  
  20. function onTouchPressed() {
  21. //execute stuff after placing block
  22. alert("test");
  23. }
  24.  
  25. var placeBlockFunc = window.touchButtonsLayout.toString()
  26. placeBlockFunc = trim(onTouchPressed.toString()) + trim(placeBlockFunc)
  27. window.touchButtonsLayout = new Function(placeBlockFunc);
  28. */
  29. touchLeft.style.height = "1.5in"
  30.  
  31.  
  32.  
  33. });
  34. })();