diff --git a/bggg.jpg b/bggg.jpg new file mode 100644 index 0000000..804b169 Binary files /dev/null and b/bggg.jpg differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..646469b --- /dev/null +++ b/index.html @@ -0,0 +1,65 @@ + + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/index2.html b/index2.html new file mode 100644 index 0000000..6d4857a --- /dev/null +++ b/index2.html @@ -0,0 +1,65 @@ + + + + + + + + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..88facaf --- /dev/null +++ b/script.js @@ -0,0 +1,70 @@ +function addChar(input, character) { + if(input.value == null || input.value == "0") + input.value = character + else + input.value += character +} + +function cos(form) { + form.display.value = Math.cos(form.display.value*Math.PI/180); +} + +function sin(form) { + form.display.value = Math.sin(form.display.value*Math.PI/180); +} + +function tan(form) { + form.display.value = Math.tan(form.display.value*Math.PI/180); +} + +function sqrt(form) { + form.display.value = Math.sqrt(form.display.value); +} + +function ln(form) { + form.display.value = Math.log(form.display.value); +} + +function exp(form) { + form.display.value = Math.exp(form.display.value); +} + +function deleteChar(input) { + input.value = input.value.substring(0, input.value.length - 1) +} +var val = 0.0; +function percent(input) { + val = input.value; + input.value = input.value + "%"; +} + +function changeSign(input) { + if(input.value.substring(0, 1) == "-") + input.value = input.value.substring(1, input.value.length) + else + input.value = "-" + input.value +} + +function compute(form) { + + form.display.value = eval(form.display.value); + } + + +function square(form) { + form.display.value = eval(form.display.value) * eval(form.display.value) +} + +function checkNum(str) { + for (var i = 0; i < str.length; i++) { + var ch = str.charAt(i); + if (ch < "0" || ch > "9") { + if (ch != "/" && ch != "*" && ch != "+" && ch != "-" && ch != "." + && ch != "(" && ch!= ")" && ch != "%") { + alert("invalid entry!") + return false + } + } + } + return true +} \ No newline at end of file diff --git a/script1.js b/script1.js new file mode 100644 index 0000000..5bb916d --- /dev/null +++ b/script1.js @@ -0,0 +1,70 @@ +function addChar(input, character) { + if(input.value == null || input.value == "0") + input.value = character + else + input.value += character +} + +function cos(form) { + form.display.value = Math.cos(form.display.value); +} + +function sin(form) { + form.display.value = Math.sin(form.display.value); +} + +function tan(form) { + form.display.value = Math.tan(form.display.value); +} + +function sqrt(form) { + form.display.value = Math.sqrt(form.display.value); +} + +function ln(form) { + form.display.value = Math.log(form.display.value); +} + +function exp(form) { + form.display.value = Math.exp(form.display.value); +} + +function deleteChar(input) { + input.value = input.value.substring(0, input.value.length - 1) +} +var val = 0.0; +function percent(input) { + val = input.value; + input.value = input.value + "%"; +} + +function changeSign(input) { + if(input.value.substring(0, 1) == "-") + input.value = input.value.substring(1, input.value.length) + else + input.value = "-" + input.value +} + +function compute(form) { + + form.display.value = eval(form.display.value); + } + + +function square(form) { + form.display.value = eval(form.display.value) * eval(form.display.value) +} + +function checkNum(str) { + for (var i = 0; i < str.length; i++) { + var ch = str.charAt(i); + if (ch < "0" || ch > "9") { + if (ch != "/" && ch != "*" && ch != "+" && ch != "-" && ch != "." + && ch != "(" && ch!= ")" && ch != "%") { + alert("invalid entry!") + return false + } + } + } + return true +} \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..6b04f13 --- /dev/null +++ b/style.css @@ -0,0 +1,92 @@ +body{ + font-family: "Audiowide", sans-serif; + background-color: black; +} + + +.requiredCol { + width: 2px; + border: 2px solid rgb(15, 3, 3); + margin: -2px; +} +#container{ + width: 1256px; + height:555px; + background-image: linear-gradient(rgba(0,0,0,0.3),rgba(0,0,0,0.3)), url('bggg.jpg'); + + background-repeat: no-repeat; + background-position: center; + background-size: cover; +} +#calculator{ + width: 460px; + height: 520px; + background: rgba(90, 92, 90, 0.3); + margin: 0 auto; + top: 20px; + position: relative; + border-radius: 5px; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.7), 0 6px 20px 0 rgba(0, 0, 0, 0.5); +} +#result{ + height: 120px; +} +#history{ + text-align: right; + height: 20px; + margin: 0 20px; + padding-top: 20px; + font-size: 15px; + color: #919191; +} +#output{ + text-align: right; + height: 60px; + margin: 10px 20px; + font-size: 30px; +} +#keyboard{ + height: 400px; +} +.operator, .number, .empty{ + width: 50px; + height: 50px; + margin: 15px; + float: left; + border-radius: 50%; + border-width: 0; + font-weight: bold; + font-size: 15px; +} +.number, .empty{ + background-color: #eaedef; +} +.number, .operator{ + cursor: pointer; +} +.operator:active, .number:active{ + font-size: 13px; +} +.operator:focus, .number:focus, .empty:focus{ + outline: 0; +} +button:nth-child(4){ + font-size: 20px; + background-color: #686969; +} +button:nth-child(8){ + font-size: 20px; + background-color:#686969; +} +button:nth-child(12){ + font-size: 20px; + background-color: #686969; +} +button:nth-child(16){ + font-size: 20px; + background-color:#686969; +} +button:nth-child(20){ + font-size: 20px; + background-color: #686969; +} \ No newline at end of file