forked from grimalschi/calque
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
76 lines (64 loc) · 2.08 KB
/
index.html
File metadata and controls
76 lines (64 loc) · 2.08 KB
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
68
69
70
71
72
73
74
75
76
<!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>
function getInput(){
return document.getElementById('input');
}
window.onload = function () {
var input = getInput();
var output = document.getElementById('output');
try {
var value = localStorage.getItem('area');
input.value = value;
} catch (e) {}
window.calque = new Calque(input, output);
input.focus();
}
window.onunload = function () {
var input = getInput();
try {
localStorage.setItem('area', input.value);
} catch (e) {}
}
</script>
</head>
<body>
<div class="interface">
<div class="output" id="output"></div>
<textarea class="input" id="input"></textarea>
</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/garipov/calque">GitHub</a>.</p>
</div>
</body>
</html>