From ea87515efab84fa6e8da7a6047a9f12c9c795ed9 Mon Sep 17 00:00:00 2001 From: Arjun I Date: Mon, 24 Jun 2024 20:49:05 +0530 Subject: [PATCH] Initial Commit --- main.html | 49 +++++++++++++++++++++++++++++++++++++++++ style.css | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ test.js | 19 ++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 main.html create mode 100644 style.css create mode 100644 test.js diff --git a/main.html b/main.html new file mode 100644 index 0000000..6dea0d8 --- /dev/null +++ b/main.html @@ -0,0 +1,49 @@ + + + + + + Calculator + + + + + + +
+

Simple Calculator

+ +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..aa7e16a --- /dev/null +++ b/style.css @@ -0,0 +1,66 @@ +*{ + box-sizing: border-box; +} + +body{ + background-color: #CAE7DF; +} + +h1{ + font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; + padding-bottom: 50px; +} + +.Numbers{ + padding-top : 220px ; + padding-left : 600px; +} + +.num{ + padding : 20px 20px; + font-size: 14px; + margin : 8px; + border : 0px solid #fff; + border-radius: 20px; +} + +.num:hover{ + font-size: large; +} + +.spe:hover{ + font-size: large; +} + +.operators:hover{ + font-size:large; +} + +#result{ + text-align: center; +} + +.spe{ + padding : 18px; + margin : 6px; + font-size: 14px; + border : 1px solid #fff; + border-radius: 20px; +} + +.operators{ + padding : 19px; + margin : 6px; + font-size : 14px; + border : 1px solid #fff; + border-radius : 20px; +} + +#result{ + height : 40px; + width : 255px; + margin-left: 2px; + font-size: 14px; + border : 1px solid #fff; + border-radius: 20px; +} diff --git a/test.js b/test.js new file mode 100644 index 0000000..6c07b1a --- /dev/null +++ b/test.js @@ -0,0 +1,19 @@ + +function dis(val) { + document.getElementById("result").value += val ; +} + +function clr(){ + document.getElementById("result").value = " "; +} + +function solve(){ + let x = document.getElementById("result").value; + let y = math.evaluate(x); + if(y == Infinity || y == NaN){ + alert("Math Error"); + }else{ + document.getElementById("result").value = y; + } + +} \ No newline at end of file