forked from grimalschi/calque
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
67 lines (58 loc) · 2.18 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Calque</title>
<link rel="icon" type='image/png' href="favicon.png">
<link rel="stylesheet" href="style.css">
<script src="math.min.js"></script>
<script src="lodash.min.js"></script>
<script src="calque.js"></script>
<script>
window.onload = function () {
var input = document.getElementById('input'),
output = document.getElementById('output'),
saveFileBtn = document.getElementById('save-file-btn'),
openFileBtn = document.getElementById('open-file-btn');
window.calque = new Calque(input, output);
calque.facilitySaveOpen(saveFileBtn, openFileBtn);
input.select();
}
</script>
</head>
<body>
<div class="interface">
<div class="output" id="output"></div>
<textarea class="input" id="input"></textarea>
</div>
<div class="file-interface">
<span class="small-btn" id="save-file-btn">Save (ctrl + enter)</span>
<span class="small-btn" id="open-file-btn">Open (shift + enter)</span>
</div>
<div class="info">
<h1>Calque</h1>
<hr>
<h2>Expressions</h2>
<pre data-result=" = 5">sqrt(3^2 + 4^2)</pre>
<pre data-result=" = 2i">sqrt(-4)</pre>
<pre data-result=" = 5.08 cm">2 inch to cm</pre>
<pre data-result=" = 0.70711">cos(45 deg)</pre>
<h2>Variables</h2>
<pre data-result=" = 6">a = 2 + 2 * 2</pre>
<pre data-result=" = 5">b = a - 1</pre>
<pre data-result=" = 30">a * b</pre>
<h2>Functions</h2>
<pre data-result=" fn">pow2(x) = x ^ 2</pre>
<pre data-result=" = 36">pow2(6)</pre>
<h2>Comments</h2>
<pre># This is a comment</pre>
<pre data-result=" = 4">a = 2 * 2 # And this</pre>
<h2>Last result</h2>
<pre data-result=" = 4">2 * 2</pre>
<pre data-result=" = 5">last + 1</pre>
<hr>
<p>Using <a target="blank" href="https://github.com/josdejong/mathjs">math.js</a>.</p>
<p>View on <a target="blank" href="https://github.com/grimalschi/calque">GitHub</a>.</p>
</div>
</body>
</html>