aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'index.html')
-rw-r--r--index.html29
1 files changed, 21 insertions, 8 deletions
diff --git a/index.html b/index.html
index 0393d8c..d127106 100644
--- a/index.html
+++ b/index.html
@@ -154,14 +154,27 @@ qsplit = \(0 \\\\\((((0 ((4 \((((0 \\1) \\1) \\1) \\1)) \((((0 \\0) \\0) \\0) \\
clearScreen(worker);
clearErrors();
console.time("reduceLoop");
- reduceLoop(
- worker,
- root,
- app(parse(window.term.value))(
- parse("\\((((0 \\\\1) \\\\1) \\\\1) \\\\1)"),
- ),
- );
- console.timeEnd("reduceLoop");
+ window.render.disabled = true;
+ window.render.textContent = "Rendering...";
+
+ // button doesn't update text without timeout
+ setTimeout(() => {
+ try {
+ reduceLoop(
+ worker,
+ root,
+ app(parse(window.term.value))(
+ parse("\\((((0 \\\\1) \\\\1) \\\\1) \\\\1)"),
+ ),
+ );
+ } catch (e) {
+ console.error(e);
+ } finally {
+ window.render.textContent = "Render!";
+ window.render.disabled = false;
+ console.timeEnd("reduceLoop");
+ }
+ }, 0);
});
</script>
</body>