Fun Colorful Calculator
About this app
A vibrant, fun, and interactive calculator app that enhances your calculating experience with colors and animations.
Fun Colorful Calculator Colorful Calculator 7 8 9 ÷ 4 5 6 × 1 2 3 − C 0 = +
Related apps
Put this on your site
Source
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Fun Colorful Calculator</title>
<meta name="description" content="A vibrant, fun, and interactive calculator app that enhances your calculating experience with colors and animations.">
<meta name="keywords" content="calculator, fun, colorful, interactive, web app">
<!-- Libraries -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.6.0/css/fontawesome.min.css" crossorigin="anonymous">
<script type="text/javascript">
try {
// App Javascript Goes Here. Place your entire script content inside the try block for error handling.
function appendToDisplay(value) {
$('#display').val($('#display').val() + value);
}
function clearDisplay() {
$('#display').val('');
}
function calculate() {
try {
const result = eval($('#display').val());
$('#display').val(result);
} catch (e) {
$('#display').val('Error');
}
}
// This will run when the DOM is ready.
$(document).ready(function () {
$('.button').on('click', function() {
if ($(this).data('action') === 'clear') {
clearDisplay();
} else if ($(this).data('action') === 'equals') {
calculate();
} else {
appendToDisplay($(this).text());
}
});
});
} catch (error) {
throw error;
}
</script>
<style>
body {
background: linear-gradient(135deg, #f3ec78, #af4261);
font-family: 'Arial', sans-serif;
color: white;
}
#main-container {
margin-top: 20px;
text-align: center;
}
#display {
font-size: 2rem;
width: 100%;
padding: 20px;
border-radius: 10px;
border: none;
background: #fff;
color: #000;
box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.button {
font-size: 2rem;
margin: 10px;
width: 70px;
height: 70px;
border: none;
border-radius: 10px;
color: white;
}
.button:nth-child(odd) {
background: #ff6b81;
}
.button:nth-child(even) {
background: #4cd137;
}
.button:hover {
transform: scale(1.1);
transition: transform 0.2s;
cursor: pointer;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<h1>Colorful Calculator</h1>
<input type="text" id="display" class="form-control" disabled>
<div class="row">
<button class="button" data-action="7">7</button>
<button class="button" data-action="8">8</button>
<button class="button" data-action="9">9</button>
<button class="button" data-action="/">÷</button>
</div>
<div class="row">
<button class="button" data-action="4">4</button>
<button class="button" data-action="5">5</button>
<button class="button" data-action="6">6</button>
<button class="button" data-action="*">×</button>
</div>
<div class="row">
<button class="button" data-action="1">1</button>
<button class="button" data-action="2">2</button>
<button class="button" data-action="3">3</button>
<button class="button" data-action="-">−</button>
</div>
<div class="row">
<button class="button" data-action="clear">C</button>
<button class="button" data-action="0">0</button>
<button class="button" data-action="equals">=</button>
<button class="button" data-action="+">+</button>
</div>
</div>
</body>
</html>
NEW APPS
These are apps made by the community!