Mobile Calculator App
About this app
A simple and slick mobile calculator app with black and red color scheme, perfect for basic calculations.
Mobile Calculator App Simple Calculator = C
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>Mobile Calculator App</title>
<meta name="description" content="A simple and slick mobile calculator app with black and red color scheme, perfect for basic calculations.">
<meta name="keywords" content="calculator, mobile app, simple design, arithmetic, math">
<!-- Libraries -->
<!-- jQuery (3.6.0) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js" crossorigin="anonymous"></script>
<!-- Bootstrap CSS (5.3.3) -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" crossorigin="anonymous">
<!-- Bootstrap JS (5.3.3) -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js" crossorigin="anonymous">
</script>
<!-- Font Awesome (6.6.0) -->
<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 {
document.addEventListener("DOMContentLoaded", function() {
$('#calculate').on('click', function() {
let input = $('#input').val();
try {
let result = eval(input);
$('#result').text(result).css('color', 'red');
$('#error').text('').css('display', 'none');
} catch (e) {
$('#result').text('');
$('#error').text('Error').css('color', 'red').css('display', 'block');
}
});
$('#clear').on('click', function() {
$('#input').val('');
$('#result').text('');
$('#error').text('').css('display', 'none');
});
});
} catch (error) {
throw error;
}
</script>
<style>
body {
background-color: white;
color: black;
font-family: Arial, sans-serif;
}
#main-container {
margin-top: 50px;
text-align: center;
}
#input {
width: 80%;
padding: 10px;
margin-bottom: 10px;
font-size: 20px;
border: 2px solid black;
border-radius: 5px;
}
.btn {
width: 70px;
height: 70px;
font-size: 24px;
margin: 5px;
background-color: black;
color: white;
border-radius: 15px;
}
.btn:hover {
background-color: grey;
}
#result {
font-size: 30px;
margin-top: 20px;
}
#error {
font-size: 20px;
color: red;
display: none;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<h1>Simple Calculator</h1>
<input type="text" id="input" placeholder="Type your calculation..." />
<div>
<button class="btn" id="calculate">=</button>
<button class="btn" id="clear">C</button>
</div>
<div id="result"></div>
<div id="error"></div>
</div>
</body>
</html>
NEW APPS
These are apps made by the community!