button for me tetr.js short

20-07-25

29.07.2020 itibariyledir. En son verisyonu görün.

// ==UserScript==
// @name         button for me tetr.js short
// @namespace    http://tampermonkey.net/
// @version      1.23
// @author       ore100
// @description  20-07-25
// @match        http://farter*/t*
// @match        http*://*/tetr.js*
// @match        https://doktorocelot.com/tetr.js/
// @grant        none
// ==/UserScript==


(function() {
    window.addEventListener('load', function(){

key = `
⤓"114"47"80"22
↷"110"47"66"22
↶"141"22"65"22
→"-179"-20"66"22
←"-67"-20"80"22
↓"120"-111"66"22
⇄"-132"-118"66"22
⟳"-36"-80"66"22
`
lines = key.split("\n")
ids = ["", "touchDrop", "touchRotRight", "touchRotLeft", "touchRight", "touchLeft", "touchDown", "touchHold", "touchRot180"]

for (var i = 0; i < lines.length; i++) {
    if(lines[i]){
        pos = lines[i].split("\"")
        x = document.getElementById(ids[i]).style
        x.marginLeft= pos[1] + "px";
        x.marginTop= pos[2] +"px";
        x.maxWidth= pos[3] + "px";
        x.paddingBottom= pos[4] + "px";
        x.backgroundColor="#777";
        console.log(x)
    }
}
});
})();