html-tower/static/debug.js

9 lines
333 B
JavaScript

const ptr = document.querySelectorAll ("#pointer") [0];
const toggler = document.querySelectorAll("#toggle-engine")[0];
const toggleEngine = () => engine("state") == "running"
? engine("halt")
: engine("start");
toggler.addEventListener("click", () => {
toggleEngine();
toggler.dataset.state=engine("state");
});