Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Now, once you've forked this repo and got a local version up on your computer, f
- [Satoshi's Converter](/submissions/Almopt.html) - By: [Almopt](https://github.com/Almopt)
- [Tic tac toe](./submissions/sherawat-Lokesh.html) -By: [sherawat-Lokesh](https://github.com/sherawat-Lokesh)
- [House Garbage Management website](/submissions/Fly0w.html) - By: [Fly0w](https://github.com/Fly0w)

- [Simple Calculator](/submissions/OlusegunJoseph.html) - By: [OlusegunJoseph](https://github.com/OlusegunJoseph)

## One Last Thing!

Expand Down
160 changes: 160 additions & 0 deletions submissions/OlusegunJoseph.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Simple calculator project using html&javascript</title>
<style>
* {
margin: 0;
padding: 0;
font-family: "Poppins", sans-serif;
box-sizing: border-box;
}

.container {
width: 100%;
height: 100vh;
background: #e3f9ff;
display: flex;
align-items: center;
justify-content: center;
}

.calculator {
background: #3a4452;
padding: 20px;
border-radius: 10px;
}

.calculator form input {
border: 0;
outline: 0;
width: 60px;
height: 60px;
border-radius: 10px;
box-shadow: -8px -8px 15px rgba(255, 255, 255, 0.1),
5px 5px 15px rgba(0, 0, 0, 0.2);
background: transparent;
font-size: 20px;
cursor: pointer;
margin: 10px;
color: white;
}

form .display {
display: flex;
justify-content: flex-end;
margin: 20px 0;
}

form .display input {
text-align: right;
flex: 1;
font-size: 45px;
box-shadow: none;
}

form input.doublezero {
width: 145px;
}

form input.operator {
background: rgb(239, 62, 245);
color: white;
}

form input.operator2 {
background: green;
color: white;
}
</style>
</head>
<body>
<div class="container">
<div class="calculator">
<form>
<div class="display">
<input type="text" name="display" />
</div>
<div>
<input
class="operator"
type="button"
value="AC"
onclick="display.value = '' "
/>
<input
class="operator"
type="button"
value="DE"
onclick="display.value = display.value.toString().slice(0,-1)"
/>
<input
class="operator"
type="button"
value="."
onclick="display.value += '.' "
/>
<input
class="operator2"
type="button"
value="/"
onclick="display.value += '/' "
/>
</div>
<div>
<input type="button" value="7" onclick="display.value += '7' " />
<input type="button" value="8" onclick="display.value += '8' " />
<input type="button" value="9" onclick="display.value += '9' " />
<input
class="operator2"
type="button"
value="*"
onclick="display.value += '*' "
/>
</div>

<div>
<input type="button" value="4" onclick="display.value += '4' " />
<input type="button" value="5" onclick="display.value += '5' " />
<input type="button" value="6" onclick="display.value += '6' " />
<input
class="operator2"
type="button"
value="-"
onclick="display.value += '-' "
/>
</div>

<div>
<input type="button" value="1" onclick="display.value += '1' " />
<input type="button" value="2" onclick="display.value += '2' " />
<input type="button" value="3" onclick="display.value += '3' " />
<input
class="operator2"
type="button"
value="+"
onclick="display.value += '+' "
/>
</div>
<div>
<input
class="doublezero"
type="button"
value="00"
onclick="display.value += '00' "
/>
<input type="button" value="0" onclick="display.value += '0' " />
<input
type="button"
value="="
onclick="display.value = eval(display.value)"
class="equal operator2"
/>
</div>
<script></script>
</form>
</div>
</div>
</body>
</html>