mirror of
https://github.com/ParkerTenBroeck/automata.git
synced 2026-06-07 05:28:45 -04:00
moved to deno to bundle website
This commit is contained in:
parent
c35d7a9192
commit
7629bdab6d
28 changed files with 1534 additions and 41961 deletions
25
web/root/src/wasm.ts
Normal file
25
web/root/src/wasm.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
console.debug("Loading wasm…");
|
||||
import init, * as wasm from "../../wasm/automata_web.js";
|
||||
try{
|
||||
console.debug("Wasm loaded. Starting app…");
|
||||
await init();
|
||||
console.debug("App started.");
|
||||
document.getElementById("center_text")!.innerHTML = '';
|
||||
document.getElementById("app")!.style.display = '';
|
||||
wasm.init();
|
||||
}catch(e){
|
||||
console.error("Failed to start: " + e);
|
||||
document.getElementById("the_canvas_id")!.remove();
|
||||
document.getElementById("center_text")!.innerHTML = `
|
||||
<p>
|
||||
An error occurred during loading:
|
||||
</p>
|
||||
<p style="font-family:Courier New">
|
||||
${e}
|
||||
</p>
|
||||
<p style="font-size:14px">
|
||||
Make sure you use a modern browser with WebGL and WASM enabled.
|
||||
</p>`;
|
||||
}
|
||||
|
||||
export default wasm
|
||||
Loading…
Add table
Add a link
Reference in a new issue