testbed: mount agents in a seperate div

mostly to test that works
This commit is contained in:
Lily Tsuru 2024-07-10 07:15:19 -04:00
parent 7e1999f117
commit d5b7e174a1
2 changed files with 7 additions and 2 deletions

View file

@ -24,5 +24,8 @@
<input type="submit" value="Load"/>
</form>
</div>
<!-- This is where all Agents go -->
<div id="agent-mount">
</div>
</body>
</html>

View file

@ -6,6 +6,8 @@ let w = window as any;
w.agents = [];
let input = document.getElementById("testbed-input") as HTMLInputElement;
let mount = document.getElementById("agent-mount") as HTMLDivElement;
input.addEventListener("change", async () => {
let buffer = await input.files![0].arrayBuffer();
@ -14,7 +16,7 @@ input.addEventListener("change", async () => {
w.agents.push(agent);
agent.addToDom(document.body);
agent.addToDom(mount);
agent.show();
console.log("Agent created");