treehouse/template/sandbox.hbs

33 lines
721 B
Handlebars
Raw Normal View History

2024-02-18 00:29:58 +01:00
<!DOCTYPE html>
<html>
<head>
<title>treehouse iframe sandbox</title>
<style>
body {
margin: 0;
overflow: hidden;
}
</style>
<script type="importmap">{ "imports": { "treehouse/": "{{ config.site }}/static/js/" } }</script>
<script type="module">
import { evaluate } from "treehouse/components/literate-programming/eval.js";
console.log("yo");
addEventListener("message", async event => {
let message = event.data;
if (message.action == "eval") {
document.body.replaceChildren();
evaluate(message.input);
}
});
</script>
</head>
<body></body>
</html>