aboutsummaryrefslogtreecommitdiff
path: root/docs/try.html
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-08-20 17:24:06 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-08-20 17:25:35 -0400
commit1cb804a87b394416cc1f8b6cc85e6bda163030bd (patch)
tree84a8cc1a9aa07525765fa863d5826c1c65def36c /docs/try.html
parent7a7cc09523a03d6ca4158bb8959c44a840dfbe9f (diff)
Use classes for try.html styling and move most of it to style.css
Diffstat (limited to 'docs/try.html')
-rw-r--r--docs/try.html33
1 files changed, 11 insertions, 22 deletions
diff --git a/docs/try.html b/docs/try.html
index a054e8c6..3d91e728 100644
--- a/docs/try.html
+++ b/docs/try.html
@@ -5,33 +5,22 @@
<title>BQN online REPL</title>
<link href="style.css" rel="stylesheet"/>
<style>
- * { box-sizing: border-box; }
li { margin:0.7em 0; }
- #code { width:100%; outline:none; }
- #run, #perm { float:right; }
- #perm { font-size:0.7em; margin:-0.2em 1.6em 0 0; }
- .cont { margin:1.3em 0; }
- #rslt { border:none; background:none; min-height:8em; }
- #rslt.err { color:#d11; }
- #kb { line-height:1.5; width:100%; padding:0.3em 0; background:inherit; }
- #kb span { cursor:default; padding:1px; }
- #kb span:hover { background-color:#bce; }
- #kb.backslash { background-color:#cee; }
- @media (prefers-color-scheme:dark) {
- #kb span:hover { background-color:#237; }
- #kb.backslash { background-color:#1e2430; }
- }
+ textarea { padding:0.2em; }
+ .perm { font-size:0.7em; margin:-0.2em 1.6em 0 0; }
+ .run, .perm { float:right; }
+ .rslt { border:none; background:none; min-height:8em; }
</style>
</head>
<body>
<a href="https://mlochbaum.github.io/BQN/" title='BQN homepage'>BQN</a>
<div class="cont">
- <div id="kb" class="bqn"></div>
- <textarea id="code" class="bqn" rows="8" autofocus></textarea>
- <input id="run" type="submit" value="Run (or shift-enter)">
- <a id="perm" href="#" title="Link with the code above embedded">permalink</a>
+ <div class="kb"></div>
+ <textarea class="code" rows="8" autofocus></textarea>
+ <input class="run" type="submit" value="Run (or shift-enter)">
+ <a class="perm" href="#" title="Link with the code above embedded">permalink</a>
</div>
- <pre id="rslt"></pre>
+ <pre class="rslt"></pre>
<p>
Notes:
<ul>
@@ -45,8 +34,8 @@
<script src="bqn.js"></script>
<script>
let body = document.body;
-let doc={}; // html elements with an id
-body.querySelectorAll('[id]').forEach(e=>doc[e.id]=e);
+let doc={}; // html elements with a class
+body.querySelectorAll('[class]').forEach(e=>doc[e.classList[0]]=e);
let repl = ()=>{
try {
let s=doc.code.value;