Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Prateek2111 authored Oct 29, 2023
0 parents commit 106a4db
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 0 deletions.
27 changes: 27 additions & 0 deletions back.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
let screen = document.getElementById('screen');
buttons = document.querySelectorAll('button');
let screenValue = '';
for (item of buttons) {
item.addEventListener('click', (e) => {
buttonText = e.target.innerText;
console.log('Button text is ', buttonText);
if (buttonText == 'X') {
buttonText = '*';
screenValue += buttonText;
screen.value = screenValue;
}
else if (buttonText == 'C') {
screenValue = "";
screen.value = screenValue;
}
else if (buttonText == '=') {
screen.value = eval(screenValue);
}
else {
screenValue += buttonText;
screen.value = screenValue;
}

})
}

Binary file added image (1).jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added image(2).jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Agbalumo&family=Edu+SA+Beginner:wght@600&display=swap"
rel="stylesheet">
</head>

<body>
<div class="heading">
<h2>SMARTCALC</h2>
</div>
<div class="container">
<div class="row">
<input type="text" id="screen" class="screen">
<table>
<tr>
<td><button>C</button></td>
<td><button>%</button></td>
<td><button>(</button></td>
<td><button>)</button></td>
</tr>
<tr>
<td><button>7</button></td>
<td><button>8</button></td>
<td><button>9</button></td>
<td><button>/</button></td>
</tr>
<tr>
<td><button>4</button></td>
<td><button>5</button></td>
<td><button>6</button></td>
<td><button>*</button></td>
</tr>
<tr>
<td><button>1</button></td>
<td><button>2</button></td>
<td><button>3</button></td>
<td><button>+</button></td>
</tr>
<tr>
<td><button>0</button></td>
<td><button>.</button></td>
<td><button>=</button></td>
<td><button>-</button></td>
</tr>
</table>
</div>
</div>
<h1 class="head">Made By- Prateek Khare</h1>
<P class="head">Pursuing Electrical Engineering, Madan Mohan Malaviya University of Technology, Gorakhpur</P>
<!-- <img src="wp2598963.jpg" alt=""> -->
<script src="back.js"></script>
<script src="index.js"></script>
<script>
console.log("Hello World");
// alert("Prateek Khare");
</script>
</body>

</html>
48 changes: 48 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.row{
display: inline-block;
padding: 23px;
border-radius: 10px;
background-image: url("image\(2\).jpg");
border-radius: 15px;
}
.head{
color: antiquewhite;
font-family:Georgia, 'Times New Roman', Times, serif;
}
.heading{
text-align: center;
font-family:Agbalumo;
font-size:40px;
text-decoration: underline;
letter-spacing: 5px;
text-shadow: 100px;
color: aquamarine;
}
body{
background-image: url("image\ \(1\).jpg");
}
.container{
text-align: center;
}
table{
margin: auto;
padding: 15px;
}
input{
font-size: 25px;
background-color: rgb(225, 195, 228);
height: 40px;
border: 4px solid rgb(71, 68, 104);
border-radius: 4px;
}
button{
font-size: 25px;
background-color: rgb(234, 157, 57);
font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
text-shadow: 150px;
border-radius: 100px;
padding: 20px;
text-align: center;
margin: 4px 2px;
display: inline-block;
}

0 comments on commit 106a4db

Please sign in to comment.