A quick page to host a snippet emulator for development
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Snippet Emulator Demo</title>
|
||||||
|
<link rel="stylesheet" href="app.css"/>
|
||||||
|
<link rel="stylesheet" href="snippet_emulator_demo.css">
|
||||||
|
<script type="module" src="snippet_emulator_demo.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="react-root"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { createRoot } from 'react-dom/client'
|
||||||
|
import React from "react";
|
||||||
|
import SnippetEmulator from "./snippet_emulator";
|
||||||
|
import init, { WasmCPU, assemble_snippet } from '../pkg/vweb.js'
|
||||||
|
|
||||||
|
init().then(async () => {
|
||||||
|
createRoot(document.getElementsByClassName('react-root')[0])
|
||||||
|
.render(React.createElement(SnippetEmulator, {snippet: 'push 0'}))
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user