Make mirror rotate on click

This commit is contained in:
Sysy's
2026-03-31 09:32:59 +02:00
parent 4ba42f6566
commit 284e396d5f

View File

@@ -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)`;