Calsy Minor
Calsy Minor
Calsy Minor
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Online Calculator</title>
</head>
<body>
<div class="container">
<div class="calculator-container">
<div class="calculator">
<div class="buttons">
<button onclick="clearDisplay()">C</button>
<button onclick="deleteLast()">DEL</button>
<button onclick="appendCharacter('%')">%</button>
<button onclick="appendCharacter('7')">7</button>
<button onclick="appendCharacter('8')">8</button>
<button onclick="appendCharacter('9')">9</button>
<button onclick="appendCharacter('4')">4</button>
<button onclick="appendCharacter('5')">5</button>
<button onclick="appendCharacter('6')">6</button>
<button onclick="appendCharacter('1')">1</button>
<button onclick="appendCharacter('2')">2</button>
<button onclick="appendCharacter('3')">3</button>
<button onclick="appendCharacter('0')">0</button>
<button onclick="appendCharacter('.')">.</button>
</div>
</div>
</div>
</div>
<script>
function clearDisplay() {
display.textContent = '0';
function deleteLast() {
if (display.textContent.length > 1) {
} else {
display.textContent = '0';
function appendCharacter(char) {
display.textContent = char;
} else {
display.textContent += char;
}
function calculateResult() {
try {
addHistory(expression);
display.textContent = result;
} catch {
display.textContent = 'Error';
</script>
</body>
</html>
--------------------------------------------------------------------------------------------------------------------------
body {
margin: 0;
padding: 0;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background-size: cover;
position: relative;
body::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
.container {
position: relative;
z-index: 2;
display: flex;
flex-direction: column;
align-items: center;
color: white;
.calculator-container {
text-align: center;
margin-bottom: 20px;
}
.calculator {
padding: 20px;
border-radius: 10px;
.display {
text-align: right;
color: black;
font-size: 2em;
padding: 10px;
border-radius: 5px;
margin-bottom: 10px;
.buttons {
display: grid;
gap: 10px;
button {
padding: 20px;
font-size: 1.2em;
border: none;
border-radius: 5px;
cursor: pointer;
background: rgba(255, 255, 255, 0.9);
color: black;
button.operation {
button.equal {
grid-column: span 2;
.history-container {
position: absolute;
bottom: 20px;
left: 20px;
width: 200px;
.history {
padding: 10px;
border-radius: 10px;
max-height: 200px;
overflow-y: auto;
.history h2 {
margin-top: 0;
}
.history-item {
margin-bottom: 5px;
padding: 5px;
border-radius: 5px;
.header {
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva,
Verdana, sans-serif;
font-size: 2.5em;
margin: 20px 0;