-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalc.html
120 lines (108 loc) · 3.57 KB
/
calc.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
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="styles/style_calc.css" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!--Font Awesome icons v4-->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<!--Font Awesome icons v5-->
<script
src="https://kit.fontawesome.com/4760d87b0d.js"
crossorigin="anonymous"
></script>
<title>calculator</title>
</head>
<body>
<!--navbar for navigating to other pages-->
<div id="navbar">
<nav id="nav" style="padding: 10px">
<i class="fa fa-cube" id="icon"></i>
<p id="sep">|</p>
<i class="fa fa-home" id="icon"></i>
<p id="sep"></p>
<a class="page" id="home" href="index.html">home</a>
<p id="sep">|</p>
<i class="fas fa-paint-brush" id="icon"></i>
<p id="sep"></p>
<a class="page" id="page1" href="paint.html">paint</a>
<p id="sep">|</p>
<i class="fas fa-calculator" id="icon"></i>
<p id="sep"></p>
<a class="page" id="page2" href="calc.html">calculator</a>
</nav>
</div>
<div id="calculator">
<header>
<h1>calculator</h1>
<p>
the calculator which shows the result of using different JS operators.
</p>
</header>
<div class="input-section">
<h2>input</h2>
<div class="input-area">
<h3 class="lvl3">operand 1</h3>
<input type="text" id="operand1" value="1" />
<!--allows user to select datatype - number/string-->
<select id="operand1-type">
<option value="number">number</option>
<option value="string">string</option>
</select>
</div>
<div class="input-area">
<h3 class="lvl3">operator</h3>
<div class="operator-choices">
<!--operator selection-->
<h4>arithmetic operators</h4>
<input type="radio" name="operator" value="+" checked />+
<input type="radio" name="operator" value="-" />-
<input type="radio" name="operator" value="*" />*
<input type="radio" name="operator" value="/" />/
<input type="radio" name="operator" value="%" />%
<h4>string operators</h4>
<input type="radio" name="operator" value="concat" />+
(concatenation)
<h4>comparison operators</h4>
<input type="radio" name="operator" value="==" />==
<input type="radio" name="operator" value="===" />===
<input type="radio" name="operator" value="!=" />!=
<input type="radio" name="operator" value="!==" />!==
<input type="radio" name="operator" value=">" />>
<input type="radio" name="operator" value=">=" />>=
<input type="radio" name="operator" value="<" /><
<input type="radio" name="operator" value="<=" /><=
</div>
</div>
<div class="input-area">
<h3 class="lvl3">operand 2</h3>
<input type="text" id="operand2" value="1" />
<!--type selection - number or string-->
<select id="operand2-type">
<option value="number">number</option>
<option value="string">string</option>
</select>
</div>
<br />
<!--submit button-->
<div class="input-area">
<input type="submit" id="submit" value="calculate!" />
</div>
<br />
<br />
<br />
</div>
<div class="output-area">
<h2>output</h2>
<h3 class="lvl3" id="op">operation</h3>
<h2 id="final-operation">---</h2>
<h3 class="lvl3" id="res">result</h3>
<h2 id="result">---</h2>
</div>
</div>
</body>
<script src="scripts/calc.js"></script>
</html>