mirror of
https://github.com/marcoallegretti/WEFT_OS.git
synced 2026-11-22 08:13:59 +00:00
32 lines
1.1 KiB
HTML
32 lines
1.1 KiB
HTML
|
|
<!DOCTYPE html>
|
||
|
|
<html>
|
||
|
|
<head>
|
||
|
|
<meta charset="utf-8">
|
||
|
|
<title>WEFT input reference</title>
|
||
|
|
<style>
|
||
|
|
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; }
|
||
|
|
body { display: grid; grid-template-columns: 1fr 1fr; }
|
||
|
|
#left { background: rgb(255, 0, 0); }
|
||
|
|
#right { background: rgb(0, 0, 255); }
|
||
|
|
</style>
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<div id="left"></div>
|
||
|
|
<div id="right"></div>
|
||
|
|
<script>
|
||
|
|
// Each input the harness sends changes one half to a colour it checks for.
|
||
|
|
const left = document.getElementById("left");
|
||
|
|
const right = document.getElementById("right");
|
||
|
|
left.addEventListener("click", () => { left.style.background = "rgb(0, 255, 0)"; });
|
||
|
|
right.addEventListener("click", () => { right.style.background = "rgb(255, 255, 255)"; });
|
||
|
|
document.addEventListener("keydown", (event) => {
|
||
|
|
if (event.key === "a" && !event.shiftKey) {
|
||
|
|
right.style.background = "rgb(255, 255, 0)";
|
||
|
|
} else if (event.key === "A" && event.shiftKey) {
|
||
|
|
right.style.background = "rgb(255, 0, 255)";
|
||
|
|
}
|
||
|
|
});
|
||
|
|
</script>
|
||
|
|
</body>
|
||
|
|
</html>
|