Make mirror rotate on click
This commit is contained in:
@@ -76,6 +76,9 @@ function loadGrid() {
|
|||||||
break;
|
break;
|
||||||
case legend.mirror:
|
case legend.mirror:
|
||||||
const currentAngle = mirrorOrientations[`${y},${x}`] || 0;
|
const currentAngle = mirrorOrientations[`${y},${x}`] || 0;
|
||||||
|
cell.onclick = () => {
|
||||||
|
rotateMirror(x, y);
|
||||||
|
}
|
||||||
const btnMirror = document.createElement("button");
|
const btnMirror = document.createElement("button");
|
||||||
btnMirror.classList.add("btn-mirror");
|
btnMirror.classList.add("btn-mirror");
|
||||||
btnMirror.style.transform = `rotate(${currentAngle}deg)`;
|
btnMirror.style.transform = `rotate(${currentAngle}deg)`;
|
||||||
|
|||||||
Reference in New Issue
Block a user