mirror of
https://github.com/milk-net/milk-net.github.io.git
synced 2025-04-19 17:43:42 -05:00
Delete calculator/index.html
This commit is contained in:
parent
1e94747253
commit
f0e00eed7f
1 changed files with 0 additions and 92 deletions
|
@ -1,92 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>MilkNet | Calculator</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
background-color: #000;
|
||||
}
|
||||
.calculator {
|
||||
background: #000;
|
||||
color: #fff;
|
||||
padding: 20px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 0px 10px rgba(255, 255, 255, 0.2);
|
||||
text-align: center;
|
||||
}
|
||||
input {
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
text-align: right;
|
||||
font-size: 1.5em;
|
||||
margin-bottom: 10px;
|
||||
background: #222;
|
||||
color: #fff;
|
||||
border: none;
|
||||
padding: 10px;
|
||||
}
|
||||
.buttons {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 10px;
|
||||
}
|
||||
button {
|
||||
padding: 15px;
|
||||
font-size: 1.2em;
|
||||
border: none;
|
||||
background: #333;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
border-radius: 5px;
|
||||
}
|
||||
button:hover {
|
||||
background: #555;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="calculator">
|
||||
<input type="text" id="display" disabled>
|
||||
<div class="buttons">
|
||||
<button onclick="clearDisplay()">C</button>
|
||||
<button onclick="appendToDisplay('/')">/</button>
|
||||
<button onclick="appendToDisplay('*')">*</button>
|
||||
<button onclick="appendToDisplay('-')">-</button>
|
||||
<button onclick="appendToDisplay('7')">7</button>
|
||||
<button onclick="appendToDisplay('8')">8</button>
|
||||
<button onclick="appendToDisplay('9')">9</button>
|
||||
<button onclick="appendToDisplay('+')">+</button>
|
||||
<button onclick="appendToDisplay('4')">4</button>
|
||||
<button onclick="appendToDisplay('5')">5</button>
|
||||
<button onclick="appendToDisplay('6')">6</button>
|
||||
<button onclick="calculateResult()">=</button>
|
||||
<button onclick="appendToDisplay('1')">1</button>
|
||||
<button onclick="appendToDisplay('2')">2</button>
|
||||
<button onclick="appendToDisplay('3')">3</button>
|
||||
<button onclick="appendToDisplay('0')">0</button>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function appendToDisplay(value) {
|
||||
document.getElementById('display').value += value;
|
||||
}
|
||||
function clearDisplay() {
|
||||
document.getElementById('display').value = '';
|
||||
}
|
||||
function calculateResult() {
|
||||
try {
|
||||
document.getElementById('display').value = eval(document.getElementById('display').value);
|
||||
} catch (e) {
|
||||
alert('Invalid Expression');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Reference in a new issue