diff --git a/index.html b/index.html
new file mode 100644
index 0000000..c3a493a
--- /dev/null
+++ b/index.html
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+ Calculator
+
+
+
+
+
+
+
=>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/main.js b/main.js
new file mode 100644
index 0000000..fb43707
--- /dev/null
+++ b/main.js
@@ -0,0 +1,134 @@
+col1=document.getElementById("col1");
+opr=document.getElementById("operation");
+col2=document.getElementById("col2");
+historyele=document.getElementById("lastval");
+let a=0,b=0,ans=0,deci=0,check="",cnt=0;
+function clearnow(){
+ col1.innerHTML="";
+ col2.innerHTML="";
+ opr.innerHTML="";
+ a=0;b=0;ans=0;deci=0;
+}
+function update(str){
+ if(document.getElementById("firstdis")) clearnow();
+ if(str=='.'){
+ if(deci!=1) col2.innerHTML=col2.innerHTML+str;
+ deci=1;return;
+ }
+ if(deci==1 && str[0]=='0'){
+ col2.innerHTML=col2.innerHTML+str;
+ return;
+ }
+ let prev=b;
+ b=parseFloat(col2.innerHTML+str)
+ if(b.toString()!=col2.innerHTML+str){
+ alert("Maximum Limit Attained!");
+ b=prev;
+ return;
+ }
+ col2.innerHTML=col2.innerHTML+str;
+}
+function backspace(){
+ if(document.getElementById("firstdis")) clearnow();
+ if(col2.innerHTML=="") return;
+ col2.innerHTML=col2.innerHTML.slice(0, -1);
+ b=parseFloat(col2.innerHTML);
+}
+
+function updatehistory(k){
+ var arr=(JSON.parse(localStorage.getItem("History"))||[]);
+ // if(arr==null) arr=[];
+
+ // console.log(typeof(arr))
+ if(k==1){
+ var value=a.toString()+check+b.toString()+"="+ans.toString();
+ arr.push(value);
+ }
+ if(arr.length==0) return;
+ if(arr.length>10) arr.shift();
+ historyele.innerHTML="";
+ var i=arr.length-1;
+ for(let j=0;j
";
+ historyele.innerHTML+=arr[i][j];
+ }
+ historyele.innerHTML+=" ";
+ localStorage.setItem("History",JSON.stringify(arr));
+}
+function operate(str){
+ if(document.getElementById("firstdis")) clearnow();
+ if(b!=0) a=b;b=0;
+ deci=0;cnt=0;
+ col1.innerHTML=a.toString();
+ col2.innerHTML="";
+ opr.innerHTML=str;check=str;
+ if(str=='*') opr.innerHTML="X";
+ if(str=='/') opr.innerHTML="÷";
+}
+function solve(){
+ if(document.getElementById("firstdis")) clearnow();
+ if(check==""){
+ alert("Incomplete Operation");
+ return;
+ }
+ if(check=='+'){
+ ans=a+b;
+ col1.innerHTML=ans.toString();
+ col2.innerHTML="";
+ opr.innerHTML="";
+ }
+ if(check=='-'){
+ ans=a-b;
+ col1.innerHTML=ans.toString();
+ col2.innerHTML="";
+ opr.innerHTML="";
+ }
+ if(check=='*'){
+ ans=a*b;
+ col1.innerHTML=ans.toString();
+ col2.innerHTML="";
+ opr.innerHTML="";
+ }
+ if(check=='/'){
+ ans=a/b;
+ col1.innerHTML=ans.toString();
+ col2.innerHTML="";
+ opr.innerHTML="";
+ }
+ if(check=='%'){
+ ans=a*b/100;
+ col1.innerHTML=ans.toString();
+ col2.innerHTML="";
+ opr.innerHTML="";
+ }
+ updatehistory(1);
+ a=ans;b=0;ans=0;check="";deci=0;cnt=0;
+}
+updatehistory(0);
+
+function showhis(){
+ var arr=(JSON.parse(localStorage.getItem("History"))||[]);
+ if(cnt==arr.length){
+ return;
+ }
+ clearnow();
+ let i=arr.length-1-cnt;
+ let sw=0;
+ for(let j=0;j";
+ historyele.innerHTML+=arr[i][j];
+ }
+ historyele.innerHTML+="";
+}
\ No newline at end of file
diff --git a/style.css b/style.css
new file mode 100644
index 0000000..30d4470
--- /dev/null
+++ b/style.css
@@ -0,0 +1,86 @@
+#mainbody{
+ border:3px solid black;
+ padding: 3px;
+ width: 350px;
+ margin: 0;
+ border-radius: 5px;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ -ms-transform: translate(-50%, -50%);
+ transform: translate(-50%, -50%);
+}
+#display{
+ border: 2px solid black;
+ height: 90px;
+ margin: 2px;
+ background-color: rgb(172, 235, 231);
+ border-radius: 5px;
+ display: grid;
+ grid-template-columns: 15.625% 84.375%;
+ overflow: hidden;
+}
+#col1{
+ grid-column: 1/span 2;
+}
+#display div{
+ font-size: 27px;
+ margin: 3px;
+ text-align: right;
+}
+#firstdis{
+ text-align:center !important;
+ font-weight: 900;
+ }
+#history{
+ margin: 2px;
+ border: 2px solid black;
+ border-radius: 3px;
+ display: grid;
+ grid-template-columns: max-content auto;
+}
+#hisbtn{
+ background-color:black;
+ border:none;
+ font-size: 25px;
+}
+#lastval{
+ height: 50px;
+ font-size: 25px;
+ padding: 3px;
+ text-align: right;
+ overflow:hidden;
+}
+#numpad{
+ display: grid;
+ grid-template-columns: 25% 25% 25% 25%;
+}
+#numpad button{
+ font-size: 24px;
+ font-size: 900;
+ height: 60px;
+ border: none;
+}
+#numpad button:active{
+ transform: scale(0.98);
+ box-shadow: 3px 2px 22px 1px rgba(0, 0, 0, 0.377);
+}
+#cross{
+ display: flex;
+ color: lightseagreen;
+ font-size: 24px;
+ align-items: center;
+ text-align: center;
+ justify-content: center;
+}
+#cross div{
+ border:2px solid lightseagreen;
+ font-size: 15px;
+ font-weight: 800;
+ width: 20px;
+}
+@media screen and (max-width: 375px) {
+ #mainbody{
+ width: 90%;
+ }
+}
\ No newline at end of file