From 7200e0862983957ffb2384241cc59c18f4559ee6 Mon Sep 17 00:00:00 2001 From: Matt Hillsdon Date: Fri, 31 Mar 2023 15:09:10 +0100 Subject: [PATCH] Hack a "nearly headless" sim. Needs a play button for audio context initialization. Obviously would be done as an option if this ends up being desirable. Needed for a student group. --- src/board/index.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/board/index.ts b/src/board/index.ts index deff7fa7..4eb39c33 100644 --- a/src/board/index.ts +++ b/src/board/index.ts @@ -81,6 +81,13 @@ export function createBoard(notifications: Notifications, fs: FileSystem) { if (!svg) { throw new Error("No SVG"); } + // Hack for Oxford student group for a nearly headless sim with a play button. + svg.style.display = "none"; + const playButton = document.querySelector(".play-button") as HTMLElement; + playButton.style.width = "100px"; + playButton.style.height = "100px"; + playButton.style.margin = "0"; + return new Board(notifications, fs, svg); } @@ -373,6 +380,9 @@ export class Board { } private displayRunningState() { + // Hack for Oxford group. + return; + this.svg.style.opacity = "unset"; const svgButtons = this.svg.querySelectorAll("[role='button']"); for (const button of svgButtons) {