-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
195 lines (194 loc) · 7.16 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>Math Notes</title>
<meta name="description" content="Inline calculator for modern browsers.">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script src="./js/index.js" type="module"></script>
<link rel="stylesheet" href="./style.css">
<link rel="manifest" href="manifest.json" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<link rel="apple-touch-icon" href="images/icons/icon-72.png" />
<link rel="apple-touch-icon" href="images/icons/icon-96.png" />
<link rel="apple-touch-icon" href="images/icons/icon-128.png" />
<link rel="apple-touch-icon" href="images/icons/icon-144.png" />
<link rel="apple-touch-icon" href="images/icons/icon-152.png" />
<link rel="apple-touch-icon" href="images/icons/icon-192.png" />
<link rel="apple-touch-icon" href="images/icons/icon-384.png" />
<link rel="apple-touch-icon" href="images/icons/icon-512.png" />
<meta name="apple-mobile-web-app-status-bar" content="#0A3190" />
<meta name="theme-color" content="#0A3190" />
</head>
<body style="font-size: 14px;">
<div class="layout">
<div class="calculator">
<div id="input" class="input">
<div id="view" class="view">
<div class="placeholder">
Type your calculations…<br />
Results will appear on sidebar
</div>
</div>
<div id="content-editable" role="textbox" aria-placeholder="5-digit zipcode" class="content-editable" spellcheck="false" contenteditable="true"></div>
</div>
<div>
<div id="results" class="results"></div>
</div>
</div>
<div class="footer">
<div class="button-wrap">
<b>Size: <button id="font-minus">-</button><button id="font-plus">+</button><button id="font-reset">reset</button></b>
<button id="help-button" class="help">Help</button>
<a href="https://github.com/imaginamundo/math-notes" rel="noopener" target="_blank">GitHub</a>
</div>
<b class="total-label">total:</b>
<span id="total" class="total">0</span>
</div>
</div>
<div id="help-modal" class="modal">
<p><small>(click anywhere to close help)</small></p>
<p><b>Preface</b></p>
<p>This is an inline calculator, each calculation will be calculated line by line.</p>
<p>You can store values in variables to use on other lines.</p>
<p><b>How to use it?</b></p>
<p><code>1 + 1</code> will return <code>2</code></p>
<table class="operator-table">
<thead>
<tr>
<th>Operator</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>+</code></td>
<td>Add</td>
</tr>
<tr>
<td><code>-</code></td>
<td>Subtract</td>
</tr>
<tr>
<td><code>*</code></td>
<td>Multiply</td>
</tr>
<tr>
<td><code>/</code></td>
<td>Divide</td>
</tr>
<tr>
<td><code>^</code></td>
<td>Power</td>
</tr>
<tr>
<td><code>sqrt(n)</code></td>
<td>Square Root</td>
</tr>
</tbody>
</table>
<p>To see more possible operations, to go <a href="https://mathjs.org/docs/expressions/syntax.html#operators" rel="noopener" target="_blank">mathjs operators documentation</a>.</p>
<p><b>Comments</b></p>
<p>If you want to create a comment, just use the <code>#</code> sign, everything after the <code>#</code> will be ignored.</p>
<p><b>Variables</b></p>
<p>You can assign variables to use later.</p>
<p><code>pizzas = 2</code></p>
<p><code>pizzaPrice = 30</code></p>
<p><code>people = 4</code></p>
<p><code>(pizzas * pizzaPrice) / people</code> will return <code>15</code></p>
<p><b>Function Variables</b></p>
<p>To store a function in a variable, just type:</p>
<p><code>myCustomFunction = f(x) = x * 2</code></p>
<p>The body of the function can be whatever you want.</p>
<p>To use a function, type:</p>
<p><code>myCustomFunction(4)</code> will return <code>8</code></p>
<p><b>Unit conversion</b></p>
<p>You can convert some units.</p>
<p><code>1cm to m</code> will return <code>0.01 m</code></p>
<table class="units-table">
<thead>
<tr>
<th>Base</th>
<th>Unit</th>
</tr>
</thead>
<tbody>
<tr>
<td>Length</td>
<td>meter (m), inch (in), foot (ft), yard (yd), mile (mi), link (li), rod (rd), chain (ch), angstrom, mil</td>
</tr>
<tr>
<td>Surface area</td>
<td>m2, sqin, sqft, sqyd, sqmi, sqrd, sqch, sqmil, acre, hectare</td>
</tr>
<tr>
<td>Volume</td>
<td>m3, litre (l, L, lt, liter), cc, cuin, cuft, cuyd, teaspoon, tablespoon</td>
</tr>
<tr>
<td>Liquid volume</td>
<td>minim (min), fluiddram (fldr), fluidounce (floz), gill (gi), cup (cp), pint (pt), quart (qt), gallon (gal), beerbarrel (bbl), oilbarrel (obl), hogshead, drop (gtt)</td>
</tr>
<tr>
<td>Angles</td>
<td>rad (radian), deg (degree), grad (gradian), cycle, arcsec (arcsecond), arcmin (arcminute)</td>
</tr>
<tr>
<td>Time</td>
<td>second (s, secs, seconds), minute (mins, minutes), hour (h, hr, hrs, hours), day (days), week (weeks), month (months), year (years), decade (decades), century (centuries), millennium (millennia)</td>
</tr>
<tr>
<td>Frequency</td>
<td>hertz (Hz)</td>
</tr>
<tr>
<td>Mass</td>
<td>gram(g), tonne, ton, grain (gr), dram (dr), ounce (oz), poundmass (lbm, lb, lbs), hundredweight (cwt), stick, stone</td>
</tr>
<tr>
<td>Electric current</td>
<td>ampere (A)</td>
</tr>
<tr>
<td>Temperature</td>
<td>kelvin (K), celsius (degC), fahrenheit (degF), rankine (degR)</td>
</tr>
<tr>
<td>Amount of substance</td>
<td>mole (mol)</td>
</tr>
<tr>
<td>Luminous intensity</td>
<td>candela (cd)</td>
</tr>
<tr>
<td>Force</td>
<td>newton (N), dyne (dyn), poundforce (lbf), kip</td>
</tr>
<tr>
<td>Energy</td>
<td>joule (J), erg, Wh, BTU, electronvolt (eV)</td>
</tr>
<tr>
<td>Power</td>
<td>watt (W), hp</td>
</tr>
<tr>
<td>Pressure</td>
<td>Pa, psi, atm, torr, bar, mmHg, mmH2O, cmH2O</td>
</tr>
<tr>
<td>Electricity and magnetism</td>
<td>ampere (A), coulomb (C), watt (W), volt (V), ohm, farad (F), weber (Wb), tesla (T), henry (H), siemens (S), electronvolt (eV)</td>
</tr>
<tr>
<td>Binary</td>
<td>bits (b), bytes (B)</td>
</tr>
</tbody>
</table>
<p>To see more possible units, to go <a href="https://mathjs.org/docs/datatypes/units.html#reference" rel="noopener" target="_blank">mathjs units documentation</a>.</p>
</div>
</body>
</html>