-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
71 lines (62 loc) · 3.21 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
68
69
70
71
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/11.1.0/math.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="./script.js"></script>
<link rel="shortcut icon" type="image/x-icon" href="https://simonwaldherr.github.io/liveCalc/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="https://simonwaldherr.github.io/liveCalc/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="https://simonwaldherr.github.io/liveCalc/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="256x256" href="https://simonwaldherr.github.io/liveCalc/favicon-256x256.png">
<meta name="msapplication-TileImage" content="https://simonwaldherr.github.io/liveCalc/ms-icon-144x144.png">
<title>liveCalc</title>
</head>
<body>
<div id="top">
<h1>liveCalc</h1>
<div class="links">
<a href="https://mathjs.org/"><img src="https://img.shields.io/badge/powered%20by-mathjs-blue" alt="Powered by Math.js"></a>
<a href="https://github.com/SimonWaldherr/liveCalc/"><img src="https://img.shields.io/badge/hosted%20on-github-green" alt="Hosted on GitHub"></a>
<a href="" onclick="clearTextarea(); return false;"><img src="https://img.shields.io/badge/clear-textarea-gray" alt="Clear Textarea"></a>
<a href="" onclick="insertExample(); return false;"><img src="https://img.shields.io/badge/insert-example-gray" alt="Insert Example"></a>
<a href="" onclick="downloadMath(); return false;"><img src="https://img.shields.io/badge/download%20math-as%20.txt-gray" alt="Download Math"></a>
<a href="" onclick="copyURLtoClipboard(); return false;"><img src="https://img.shields.io/badge/copy%20link-to%20clipboard-gray" alt="Copy Link to Clipboard"></a>
</div>
</div>
<div class="content">
<div class="split right">
<div class="bed-container">
<div class="bed-backdrop">
<div class="bed-highlights bed-content linked" id="highlights1"></div>
</div>
<textarea spellcheck="false" class="bed-input bed-content linked ta" name="frame1" id="frame1"></textarea>
</div>
</div>
</div>
<script type="text/javascript">
math.config({
number: 'BigNumber', // Default type of number: 'number' (default), 'BigNumber', or 'Fraction'
precision: 64, // Number of significant digits for BigNumbers
epsilon: 1e-60
})
document.addEventListener('DOMContentLoaded', function() {
var hashvalue = window.location.hash.substring(1);
if (hashvalue.length > 4) {
$('#frame1').val(b64_to_utf8(hashvalue));
}
evalMath();
$("#frame1").on("keyup change", function(e) {
evalMath();
var encodedMath = utf8_to_b64($('#frame1').val());
window.location.hash = encodedMath;
})
$('.linked').scroll(function() {
$('.bed-highlights').css('transform', `translateY(${-this.scrollTop}px)`);
});
}, false);
</script>
</body>
</html>