From c552242b8fa9ce8d48343bbc76ea77c9529ec272 Mon Sep 17 00:00:00 2001 From: chitrankiit20 Date: Tue, 31 Aug 2021 16:46:43 +0530 Subject: [PATCH 1/2] projectdone --- index.css | 38 +++++++++++++++++++++++++++++++++++++ index.html | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ index.js | 36 +++++++++++++++++++++++++++++++++++ 3 files changed, 129 insertions(+) create mode 100644 index.css create mode 100644 index.html create mode 100644 index.js diff --git a/index.css b/index.css new file mode 100644 index 0000000..bebafd1 --- /dev/null +++ b/index.css @@ -0,0 +1,38 @@ +.calculator{ + margin-left:30%; + background-color: #e3e5ec; + box-shadow: 0 2px 8px rgba(0,0,0,.16); + width: 33%; + height: 80%; + text-align: center; +} + +.header{ + margin-left:40%; +} +.text{ + margin-left:30%; +} +.btn{ + padding: 40px 50px; + background-color: #e3e5ec; + border:#e3e5ec; + font-size: 18px; +} +.btn:hover{ + background-color:rgb(188, 238, 235); +} + +.table{ + margin-top: 5%; +} +.fas{ + color:rgb(5, 126, 118); +} +.fab{ + color:rgb(5, 126, 118); +} +.row1{ + border: 1px solid black; +} + diff --git a/index.html b/index.html new file mode 100644 index 0000000..5489902 --- /dev/null +++ b/index.html @@ -0,0 +1,55 @@ + + + + + + + Document + + + + +
+

Calculator

+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + diff --git a/index.js b/index.js new file mode 100644 index 0000000..02afa1e --- /dev/null +++ b/index.js @@ -0,0 +1,36 @@ +function operations(){ + let p = document.getElementById("display").value; + let q = eval(p); + document.getElementById("display").value = q; + if(document.getElementById("display").value.length>30) + alert("Calulation limit exceeded"); + else + document.getElementById("display").value = q; +} +// document.getElementById("display").value = q; +// document.getElementById("none").value = q; + +function del(){ + document.getElementById("display").value= document.getElementById("display").value.slice(0, - 1); +} + +function clearall(){ + document.getElementById("display").value = ""; +} + +function onScreen(value){ + if(document.getElementById("display").value.length>25) + alert("Digits Exceeded!"); + else + document.getElementById("display").value += value; +} + +function percentage(){ + let p = document.getElementById("display").value; + // let l = document.getElementById("display").value; + let q = p/100; + document.getElementById("display").value = q; +} + + + From 56661dc7d7800207c8a44099dc554533ab80bca3 Mon Sep 17 00:00:00 2001 From: chitrankiit20 Date: Tue, 31 Aug 2021 21:15:41 +0530 Subject: [PATCH 2/2] projectdone --- index.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 5489902..6fd1f55 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@
-

Calculator

+

Calculator

@@ -18,34 +18,34 @@

Calculator

- - - - + + + + - + - + - + - +