-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
129 lines (87 loc) · 5.05 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="Bonface Mudiri">
<title>Calculator</title>
<link rel="icon" href="" type="image/x-icon">
<!-- ========= Bootstrap CSS ========= -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- ========= Font Awesome ========= -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- ========= Custom CSS ========= -->
<link rel="stylesheet" type="text/css" href="./css/calc-style.css">
</head>
<body>
<div class="container">
<div class="calc">
<div class="header">
<div class="col-md-12">
<p>DIGITAL CALCULATOR</p>
</div>
</div>
<input id="DisplayScreen" value="" class="display col-md-12 col-md-offset-0 col-ms-12 col-ms-offset-0 col-xs-12 col-xs-offset-0" name="DisplayTop" size="20" readonly="" />
<input id="Display" value="" class="display2 col-md-12 col-md-offset-0 col-ms-12 col-ms-offset-0 col-xs-12 col-xs-offset-0" name="DisplayBottom" readonly="" />
<!--<p id="Value"></p>-->
<div class="calc-container">
<div class="row col-md-12 col-md-offset-0 col-ms-12 col-ms-offset-0 col-xs-12 col-xs-offset-0">
<input type="button" id="Sqrt" class="btn-calc" value="√" onclick='sqrt()'/>
<input type="button" id="MemoryRemove" class="btn-calc mem mem-minus" value="M-" onclick="memoryRemove()"/>
<input type="button" id="MemoryRecall" class="btn-calc mem mem-recall" value="MR" onclick="memoryRecall()" />
<input type="button" id="MemoryAdd" class="btn-calc mem mem-add" value="M+" onclick="memoryAdd()" />
<input type="button" id="OFF" class="btn-calc btn-red off" value="CE" onclick="backspace()" />
</div>
<div class="row col-md-12 col-md-offset-0 col-ms-12 col-ms-offset-0 col-xs-12 col-xs-offset-0">
<input type="button" id="7" class="btn-calc" value="7" onclick="addVal('7')" />
<input type="button" id="8" class="btn-calc" value="8" onclick="addVal('8')"/>
<input type="button" id="9" class="btn-calc" value="9" onclick='addVal("9")' />
<input type="button" id="C" class="btn-calc btn-red" value="C" onclick="clearScreen()" />
<input type="button" id="AC" class="btn-calc btn-red" value="AC" onclick="allClear()" />
</div>
<div class="row col-md-12 col-md-offset-0 col-ms-12 col-ms-offset-0 col-xs-12 col-xs-offset-0">
<input type="button" id="4" class="btn-calc" value="4" onclick='addVal("4")' />
<input type="button" id="5" class="btn-calc" value="5" onclick='addVal("5")' />
<input type="button" id="6" class="btn-calc" value="6" onclick='addVal("6")' />
<input type="button" id="Multiply" class="btn-calc" value="×" onclick='addVal("*")' />
<input type="button" id="Divide" class="btn-calc" value="÷" onclick='addVal("/")' />
</div>
<div class="row col-md-12 col-md-offset-0 col-ms-12 col-ms-offset-0 col-xs-12 col-xs-offset-0">
<input type="button" id="1" class="btn-calc" value="1" onclick='addVal("1")' />
<input type="button" id="2" class="btn-calc" value="2" onclick='addVal("2")' />
<input type="button" id="3" class="btn-calc" value="3" onclick='addVal("3")' />
<input type="button" id="Plus" class="btn-calc" value="+" onclick='addVal("+")' />
<input type="button" id="Minus" class="btn-calc" value="−" onclick='addVal("-")' />
</div>
<div class="row col-md-12 col-md-offset-0 col-ms-12 col-ms-offset-0 col-xs-12 col-xs-offset-0">
<input type="button" id="0" class="btn-calc" value="0" onclick='addVal("0")' />
<input type="button" id="Dot" class="btn-calc" value="·" onclick='addVal(".")' />
<input type="button" id="Exp" class="btn-calc exp" value="EXP" onclick='exp()' />
<input type="button" id="Equals" class="btn-calc" value="=" onclick='result()' />
<input type="button" class="btn-calc" value="±" onclick="signBefore()" />
</div>
</div>
</div> <!-- end of calc object -->
</div> <!-- container -->
<!-- FOOTER -->
<div class="bottom">
<div class="col-md-12 col-md-offset-0 col-ms-12 col-ms-offset-0 col-xs-12 col-xs-offset-0content">a freeCodeCamp <i class="fa fa-free-code-camp"></i> Javascript Project
<br/> Made by <a href="https://www.linkedin.com/in/bonface/">Bonface Mudiri</a> © 2017</div>
</div>
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- fallback jQuery -->
<script>
if(!window.jQuery){
document.write('<script src="./js/jquery-min.js"><\/script>');
}
</script>
<!-- Bootstrap -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-- Custom JS -->
<script src="./js/calculator.js"></script>
</body>
</html>