-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
265 lines (265 loc) · 10.5 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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
<!DOCTYPE html>
<html>
<head>
<title> Web Calculator 2.0 </title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href='calculator-icon.png'>
<link rel="apple-touch-icon" href='calculator-icon.png'>
<link rel="stylesheet" href='style/animate.css'>
<link rel="stylesheet" href='style/bulmaswatch-slate.min.css'>
<link rel="stylesheet" href='style/calculator.css'>
<script src='script/all.min.js'></script>
</head>
<body>
<section class='section'>
<h1 class="title is-3 has-text-centered is-unselectable">Web Calculator</h1>
<div class="container">
<div class="tabs is-centered is-hidden-mobile">
<ul>
<li id='calculator-type-tabs-standard' class="is-active">
<a>
<span class="icon is-small"><i class="fas fa-plus"></i></span>
<span>Standard</span>
</a>
</li>
<li id='calculator-type-tabs-algebra'>
<a>
<span class="icon is-small"><i class="fas fa-percentage"></i></span>
<span>Algebra</span>
</a>
</li>
<li id='calculator-type-tabs-calculus'>
<a>
<span class="icon is-small"><i class="fas fa-square-root-alt"></i></span>
<span>Calculus</span>
</a>
</li>
</ul>
</div>
</div>
<div class="field is-grouped is-grouped-centered">
<div class="control has-icons-left is-hidden-tablet">
<div class="icon is-small is-left">
<i id='calculator-type-select-icons' class="fas fa-plus"></i>
</div>
<div class="select">
<select id='calculator-type-select'>
<option value='standard'>Standard</option>
<option value='algebra'>Algebra</option>
<option value='calculus'>Calculus</option>
</select>
</div>
</div>
</div>
<div class='container calculator-container'>
<div class="field has-addons">
<div class="control">
<button id='calculator-buttons-restorehistory' class="button is-warning" title='Load history'>
<span class="icon is-small">
<i class="fas fa-history"></i>
</span>
</button>
</div>
<div class="control is-expanded">
<input class="input is-fullwidth calculator-input" type="text" placeholder="Input an expression...">
</div>
<div class="control">
<button id='calculator-buttons-calculate' class="button" title='Calculate expression'>
<span class="icon is-small">
<i class="fas fa-equals"></i>
</span>
</button>
</div>
<div class="control">
<button id='calculator-buttons-clearoutput' class="button is-danger" title='Clear output'>
<span class="icon is-small">
<i class="fas fa-backspace"></i>
</span>
</button>
</div>
</div>
<div class="field">
<div class="control is-expanded">
<textarea class="textarea is-fullwidth calculator-result" placeholder="Output" readonly></textarea>
</div>
</div>
<div class='buttons has-addons is-centered'>
<button id='calculator-buttons-about' class="button" title='About'>
<span class="icon is-small is-unselectable">
<i class="fas fa-info"></i>
</span>
</button>
<button id='calculator-buttons-tutorial' class="button is-info" title='Open tutorial'>
<span class="icon is-small is-unselectable">
<i class="fas fa-question"></i>
</span>
</button>
<a href="https://github.com/openMengZe/Web-Calculator">
<button id='calculator-buttons-github' class="button" title='GitHub'>
<span class="icon is-small is-unselectable">
<i class="fab fa-github"></i>
</span>
</button>
</a>
</div>
</div>
</section>
<div id='calculator-modal-warnrestorehistory' class="modal">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Restore History</p>
</header>
<section class="modal-card-body">
<strong>
This will erase the current output and display your calculation history.
<br>
<br>
Proceed?
</strong>
</section>
<footer class="modal-card-foot">
<button id='calculator-modal-warnrestorehistory-button-yes' class="button is-danger">Yes</button>
<button id='calculator-modal-warnrestorehistory-button-cancel' class='button'>Cancel</button>
</footer>
</div>
</div>
<div id='calculator-modal-about' class="modal">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">About Web Calculator</p>
</header>
<section class="modal-card-body">
<p>
version 2.0.1-alpha (based on commit <code>#b9b5760</code> on branch <code>master</code> on repo <code>openMengZe/Web-Calculator</code>)
<br>
<br>
This is a Web Calculator with some cool features!
<br>
<br>
© openMengZe [MengZe] and jkelol111 [Nam] 2020-present
</p>
</section>
<footer class="modal-card-foot">
<button class="button is-success" data-bulma-modal='close'>Thanks!</button>
</footer>
</div>
</div>
<div id='calculator-modal-tutorial' class="modal">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Tutorial</p>
</header>
<section class="modal-card-body">
<article class='is-unselectable'>
<h1 class='title is-4'>Features</h1>
<h2 class='subtitle'>What can you use?</h2>
<div class='container content'>
<ul>
<li>Mode selector: Standard (default), Algebra & Calculus.</li>
<li>Input box: input the mathematical expression you want the calculator to evaluate.</li>
<li>Output box: display your input expression & result.</li>
</ul>
</div>
<h1 class='title is-4'>Calculator modes</h1>
<h2 class='subtitle'>The calculator modes in detail.</h2>
<div class='container content'>
<h5>Standard: basic mathematical evaluations.</h5>
<ul>
<li>Arithmetic calculations (+,-,*,^,/,%, sqrt)</li>
<li>
Advanced calculations:
<ul>
<li><code>log(a,b)</code>: returns <code>n</code> where <code>b^n = a</code>.</li>
<li>trigonometry <code>[sin(),cos(),tan(),sec(),csc(), cot()]</code></li>
</ul>
</li>
<li>Unit converter (e.g <code>10km/hour to m/s</code>)</li>
</ul>
<h5>Algebra: mathematical calculations involving functions.</h5>
<ol>
<li>Define function (e.g <code>f(x) = 10x</code>) [case sensitive!]</li>
<li>Input <code>x</code> and get result</li>
<li>Move on to the next function, define <code>g(x)</code> or <code>h(x)</code> if <code>f(x)</code> is used.</li>
</ol>
<h5>Calculus: mathematical calculations involving differentiation.</h5>
<p>
Input --> <code>5x^2 + 10x - 5</code>
<br>
Output <-- <code>10x + 10</code>
</p>
</div>
</section>
</article>
<footer class="modal-card-foot">
<button class="button is-success" data-bulma-modal='close'>Thanks!</button>
</footer>
</div>
</div>
<div id='calculator-modal-warndeleteoutput' class="modal">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Delete output?</p>
</header>
<section class="modal-card-body">
<strong>
This will erase the current output.
<br>
<br>
Proceed?
</strong>
</section>
<footer class="modal-card-foot">
<button id='calculator-modal-warndeleteoutput-button-delete' class="button is-danger">Delete</button>
<button class='button' data-bulma-modal='close'>Cancel</button>
</footer>
</div>
</div>
<div id='calculator-modal-warnwrongmode' class="modal">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Wrong Mode</p>
</header>
<section class="modal-card-body">
<strong>
For function evaluation, please select 'Algebra' mode.
<br>
</strong>
</section>
<footer class="modal-card-foot"></footer>
<button class="button is-success" data-bulma-modal='close'>Alright</button>
</footer>
</div>
</div>
<div id='calculator-modal-warnwrongformat' class="modal">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Wrong Format</p>
</header>
<section class="modal-card-body">
<strong>
Your input format is incorrect. Please read the tutorial.
<br>
</strong>
</section>
<footer class="modal-card-foot"></footer>
<button class="button is-success" data-bulma-modal='close'>Alright</button>
</footer>
</div>
</div>
</body>
<!-- Disable compromise.js for now because no functionality -->
<!-- <script src="script/compromised.min.js"></script>
<script src="script/compromised-numbers.min.js"></script> -->
<script src='script/jquery-3.5.0.js'></script>
<script src='script/animate.js'></script>
<script src='script/bulma-modal.js'></script>
<script src="script/math.min.js"></script>
<script src="script/calculator.js"></script>
</html>