-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 106a4db
Showing
5 changed files
with
142 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
}) | ||
} | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |