Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
199 lines (191 loc) · 6.62 KB
/
Copy pathindex.html
File metadata and controls
199 lines (191 loc) · 6.62 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="A simple Calculator">
<meta name="color-scheme" content="light dark" />
<title>Calculator 2.0</title>
<link href="style.css" rel="stylesheet" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:FILL@0..1&icon_names=arrow_downward,arrow_right,backspace,delete,history,settings&display=block" />
<script type="module" src="./index.js"></script>
</head>
<body>
<div id="calculator-container" class="page active">
<div class="header">
<button
onclick="showElement('settings')"
class="material-symbols-outlined setting"
id="settingsBtn"
>
settings
</button>
<button
onclick="showElement('historyContainer')"
class="material-symbols-outlined setting"
id="historyBtn"
>
history
</button>
<button class="material-symbols-outlined switch" onclick="showElement('conversion')">
arrow_right
</button>
</div>
<div class="liv" id="settings">
<h2>Settings</h2>
<md-list class="list">
<!-- Font Setting -->
<div class="cont" id="font">
<md-list-item>
<div class="he" slot="headline">Default Font</div>
<div class="su" slot="supporting-text">
Enable the default font style for better readability.
</div>
</md-list-item>
<md-switch id="fontDef"></md-switch>
</div>
<!-- Degree to Radian Setting -->
<div class="cont" id="degToRad">
<md-list-item>
<div class="he" slot="headline">Use Degrees</div>
<div class="su" slot="supporting-text">
Switch to degree mode for trigonometric calculations (default is
radians).
</div>
</md-list-item>
<md-switch id="rad"></md-switch>
</div>
<!-- Fraction Setting -->
<div class="cont" id="frac">
<md-list-item>
<div class="he" slot="headline">Use Fractions</div>
<div class="su" slot="supporting-text">
Display results as fractions instead of decimals where
applicable.
</div>
</md-list-item>
<md-switch id="fraction"></md-switch>
</div>
<!-- Round-Off Setting -->
<div class="cont" id="round">
<md-list-item>
<div class="he" slot="headline">Round-Off Values</div>
<div class="su" slot="supporting-text">
Round decimal results to the nearest two decimal places for
simplicity.
</div>
</md-list-item>
<md-switch id="roundOff"></md-switch>
</div>
</md-list>
</div>
<div class="wrap">
<div id="display"></div>
<div id="resultDisplay"></div>
<div id="calculator-toolbar">
<button class="operator2">√</button>
<button class="operator2">^</button>
<button class="operator2">!</button>
<button class="operator2">π</button>
<button onclick="showElement('other')" class="arrow-btn">
<span class="material-symbols-outlined arrow">arrow_downward</span>
</button>
</div>
</div>
<div id="calculator">
<div class="liv" id="other">
<div class="row1">
<button class="op">log</button>
<button class="op">cos</button>
<button class="op">tan</button>
<button class="op">sin</button>
</div>
<div class="row2">
<button class="op">e</button>
<button class="op">sec</button>
<button class="op">cot</button>
<button class="op">csc</button>
</div>
<div class="row2">
<button class="op">log10</button>
<button class="op">asin</button>
<button class="op">acos</button>
<button class="op">atan</button>
</div>
</div>
<div class="re">
<button class="clear" colspan="1">C</button>
<button colspan="1">(</button>
<button colspan="1">)</button>
<button class="operator">/</button>
</div>
<div class="re">
<button>7</button>
<button>8</button>
<button>9</button>
<button class="operator">×</button>
</div>
<div class="re">
<button>4</button>
<button>5</button>
<button>6</button>
<button class="operator">-</button>
</div>
<div class="re">
<button>1</button>
<button>2</button>
<button>3</button>
<button class="operator">+</button>
</div>
<div class="re">
<button>0</button>
<button>.</button>
<button
style="
font-variation-settings:
FILL: 1,
"
class="material-symbols-outlined"
id="delete"
>
backspace
</button>
<button id="equal" class="equal">=</button>
</div>
</div>
</div>
<div class="page" id="conversion">
<input
autocomplete="off"
type="text"
id="input"
placeholder="Type here..."
/>
<div id="sect">
<select id="convert-value">
<option value="length">Length</option>
<option value="differentiate">Differentiation</option>
<option value="mass">Mass</option>
<option value="temperature">Temperature</option>
<option value="time">Time</option>
<option value="speed">Speed</option>
<option value="volume">Volume</option>
</select>
<md-filled-button id="convertButton">Convert</md-filled-button>
</div>
<p id="result"></p>
</div>
<div id="historyContainer">
<h2>History</h2>
<ul id="history-list"></ul>
<md-filled-button class="clear" onclick="clearHistory()"
>Clear History</md-filled-button
>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.2/anime.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/eruda"></script>
<script>eruda.init();</script>
<script src="https://unpkg.com/mathjs@14.0.1/lib/browser/math.js"></script>
<script src="script.js"></script>
</body>
</html>