File size: 2,272 Bytes
458771a fb47ed1 1426674 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>β¨ Basic Addition Calculator β¨</title>
<style>
body {
font-family: 'Segoe UI', sans-serif;
background: linear-gradient(to right, #fbc2eb, #a6c1ee);
text-align: center;
padding: 50px 20px;
color: #333;
}
h1 {
font-size: 2.5em;
color: #4a148c;
animation: sparkle 2s infinite;
}
input {
width: 80px;
padding: 10px;
margin: 10px;
font-size: 1.2em;
border: 2px solid #ccc;
border-radius: 10px;
text-align: center;
}
button {
padding: 12px 24px;
font-size: 1.1em;
background-color: #6a1b9a;
color: white;
border: none;
border-radius: 20px;
cursor: pointer;
transition: background 0.3s ease;
}
button:hover {
background-color: #8e24aa;
}
.result {
font-size: 1.8em;
margin-top: 30px;
color: #2e7d32;
}
.footer {
margin-top: 50px;
font-size: 1.2em;
color: #0d47a1;
}
@keyframes sparkle {
0%, 100% { color: #4a148c; }
50% { color: #ff4081; }
}
</style>
</head>
<body>
<h1>β¨ Basic Addition Calculator β¨</h1>
<input type="number" id="num1" placeholder="12" />
<span style="font-size: 2em;">β</span>
<input type="number" id="num2" placeholder="12" />
<br />
<button onclick="calculateSum()">Calculate β‘οΈ</button>
<div class="result" id="resultArea"></div>
<div class="footer">π Hope you have a nice day! π</div>
<script>
function calculateSum() {
const n1 = parseFloat(document.getElementById('num1').value);
const n2 = parseFloat(document.getElementById('num2').value);
if (isNaN(n1) || isNaN(n2)) {
document.getElementById('resultArea').innerHTML = "β Please enter both numbers!";
return;
}
const sum = n1 + n2;
document.getElementById('resultArea').innerHTML =
`π The sum of ${n1} and ${n2} is: <strong>${sum}</strong> π`;
}
</script>
</body>
</html>
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference |