Conta de ML de Água
About this app
Um app para fazer a conta dos ml de água que ingiro ao longo de 24h
Conta de ML de Água Conta de ML de Água Adicionar Total de ML: 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>Conta de ML de Água</title>
<meta name="description" content="Um app para fazer a conta dos ml de água que ingiro ao longo de 24h">
<meta name="keywords" content="app, conta, ml, água, 24h">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap" rel="stylesheet">
<script type="text/javascript">
try {
// App Javascript Goes Here. Place your entire script content inside the try block for error handling.
// This will run when the DOM is ready.
document.addEventListener("DOMContentLoaded", function() {
// Variables
var totalMl = 0;
// Function to update the total ml
function updateTotalMl() {
var inputMl = parseInt($("#ml-input").val());
if (!isNaN(inputMl)) {
totalMl += inputMl;
$("#total-ml").text(totalMl);
}
$("#ml-input").val("");
}
// Event listener for the submit button
$("#submit-btn").click(function() {
updateTotalMl();
});
// Event listener for the enter key on the input field
$("#ml-input").keypress(function(event) {
if (event.which === 13) {
updateTotalMl();
}
});
});
} catch (error) {
// This will throw the error to the parent window.
throw error;
}
</script>
<style>
/* App CSS Goes Here */
body {
font-family: 'Poppins', sans-serif;
background-color: #f8f9fa;
}
.container {
max-width: 400px;
margin: 0 auto;
padding: 20px;
text-align: center;
}
h1 {
font-size: 24px;
font-weight: 600;
margin-bottom: 20px;
color: #333;
}
.input-group {
margin-bottom: 15px;
}
.input-group-text {
background-color: #fff;
}
.input-group input {
border-radius: 0;
}
#submit-btn {
background-color: #007bff;
border-color: #007bff;
color: #fff;
transition: background-color 0.3s ease;
}
#submit-btn:hover {
background-color: #0056b3;
}
#total-ml {
font-size: 36px;
font-weight: 600;
color: #007bff;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<h1>Conta de ML de Água</h1>
<div class="input-group">
<span class="input-group-text"><i class="fa fa-tint" aria-hidden="true"></i></span>
<input id="ml-input" type="number" class="form-control" placeholder="Digite a quantidade de ml">
</div>
<button id="submit-btn" class="btn btn-primary">Adicionar</button>
<h2>Total de ML: <span id="total-ml">0</span></h2>
</div>
</body>
</html>
NEW APPS
These are apps made by the community!