diff --git a/vweb/build.sh b/vweb/build.sh index 2826551..fe24bf7 100755 --- a/vweb/build.sh +++ b/vweb/build.sh @@ -2,4 +2,4 @@ wasm-pack build --target web npm run bundle -cp pkg/vweb_bg.wasm src/index.html src/snippet_emulator_demo.html src/basics.html build +cp pkg/vweb_bg.wasm src/index.html src/snippet_emulator_demo.html src/basics.html src/forge_editor_demo.html src/simulator.css build diff --git a/vweb/esbuild.js b/vweb/esbuild.js index 2f408e8..56eb73f 100644 --- a/vweb/esbuild.js +++ b/vweb/esbuild.js @@ -1,5 +1,5 @@ require('esbuild').build({ - entryPoints: ['src/app.js', 'src/snippet_emulator_demo.jsx'], + entryPoints: ['src/app.js', 'src/snippet_emulator_demo.jsx', 'src/forge_editor_demo.jsx'], bundle: true, minify: true, outdir: 'build', diff --git a/vweb/src/forge_editor_demo.html b/vweb/src/forge_editor_demo.html new file mode 100644 index 0000000..8e36059 --- /dev/null +++ b/vweb/src/forge_editor_demo.html @@ -0,0 +1,22 @@ + + +
+ +
+ fn main() {
+ var n = 0;
+ while (n < 40 * 30) {
+ asm(72, n + 0x10000) { store }
+ n = n + 1;
+ }
+ }
+
+s in the content */
+.content pre {
+ margin: 0;
+}
+
+/* Make the textarea look presentable (TODO: replace with CodeMirror) */
+.content textarea {
+ height: 100%;
+ width: 100%;
+ padding: 0;
+ margin: 0;
+ background: #000000;
+ color: #a0a0a0;
+ border: none;
+ resize: none;
+ outline: none;
+}
+
+.forge-editor textarea:focus {
+ border: none;
+ outline: none;
+}
+
+/* Status, btns, tabs all look right */
+.status, .buttons, .tabbar { font-weight: bold; }
+.tabbar a, .buttons a { cursor: pointer; }
+
+/* Make the display the right size by centering the canvas in a rectangle*/
+.display {
+ height: 100%;
+ display: grid;
+ grid-template:
+ "lt top rt" 1fr
+ "lt screen rt" calc(480px + 4em)
+ "lt btm rt" 1fr / 1fr calc(640px + 4em) 1fr;
+}
+
+/* The beige monitor border around the screen */
+.display { background-color: #0f0f0f }
+.display canvas {
+ grid-area: screen;
+ border: 2em solid #bb9;
+ border-radius: 2em;
+}
+
+/* Colors of tabs and buttons */
+.tabbar a.active { background-color: #686868; }
+.buttons .run { color: #66bb66 }
+.buttons .stop { color: #bb6666 }
+.buttons .build { color: #aaaaff; }
\ No newline at end of file