button for me tetr.JS short

20-07-25

< Feedback on button for me tetr.JS short

Review: Good - script works

ore100Author
§
Posted: 2020-08-17
Edited: 2020-08-31

/*
* tetr for via browser
* const whiteList = ['Domain Name'];
* No blank at the end of each line
* 注意每行行尾不要留空白
* delete these lines
*/
(function(){
/* const whiteList = ['farter.cn/tetr.js']; */
window.addEventListener('load', function(){
time.style.position = "absolute";
time.style.left="1.4in";
time.style.bottom="3in";
time.style.transform="scale(2,2)";
a.style.bottom="-70px";
b.style.bottom="-1.2in";
c.style.bottom="-70px";
key = `
⤓"119"48"76"22
↷"209"230"68"22
↶"141"308"68"22
→"-181"-20"68"22
←"-65"-19"76"22
↓"108"-98"80"1
⇄"0"69"80"1
⟳"0"242"80"1
`
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="blue";
console.log(x)
}
}
});
})();




//* tetr for lit *//
time.style.position = "absolute";time.style.left="1.4in";time.style.bottom="3in";time.style.transform="scale(2,2)";a.style.bottom="-126px";b.style.bottom="-1.62in";c.style.bottom="-1.4in";
key = `
⤓"119"48"76"22
↷"209"250"68"22
↶"141"330"68"22
→"-181"-20"68"22
←"-65"-19"76"22
↓"108"-91"80"1
⇄"0"96"80"1
⟳"0"269"80"1
`
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="blue";
console.log(x)
}
}

Post reply

Sign in to post a reply.