-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
35 lines (35 loc) · 1.38 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<html>
<head>
<meta charset="utf8">
<title>The Coding Programming Language - Interpreter</title>
<script src="peg.js"></script>
<script src="coding.js"></script>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<style>
textarea{
font-family:monospace;
}
</style>
</head>
<body style="overflow:hidden">
<textarea id="x" style="resize:none;width:100%;height:100%;position:absolute;top:0;left:0;font-family:monospace;padding:1%;color:#333" placeholder="Code goes here..."></textarea>
<div style="z-index:100;position:fixed;top:0;right:0;font-family:monospace;color:#777;margin-right:1%;text-align:right">
<h3>The <a href='https://github.com/molarmanful/codinglang' target='_blank' style='color:#999'>Coding</a> Programming Language</h3><small>Official interpreter</small>
</div>
<button id="r" style="z-index:100;position:fixed;bottom:0;right:0;font-family:monospace;background-color:transparent;border:1px solid #777;color:#777">
<h1>Run Code</h1>
</button>
<script>
r.onclick=_=>{
[a,b]=Coding.eval(x.value)
dv=document.createElement('html')
b.map(i=>$(dv).append(i.outerHTML||i))
w=window.open('')
w.document.write(dv.innerHTML)
console.log(a)
console.log(b.map(x=>x.outerHTML||x))
}
</script>
</body>
</html>