978,62-(0,133145*rendimentos tributáveis mensais)
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Calculadora</title>
<style>
body {
font-family: Arial, sans-serif;
padding: 20px;
background-color: #f4f4f4;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.container {
max-width: 400px;
width: 100%;
margin: auto;
border: 1px solid #ccc;
padding: 20px;
border-radius: 8px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
text-align: center;
}
h2 {
margin-top: 0;
color: #333;
}
p {
color: #666;
}
label {
display: block;
margin-bottom: 8px;
font-weight: bold;
text-align: left;
}
input[type="number"] {
width: 100%;
padding: 10px;
margin-bottom: 20px;
box-sizing: border-box;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
width: 100%;
padding: 12px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #0056b3;
}
.resultado-container {
margin-top: 20px;
}
#resultadoMensal {
font-weight: bold;
font-size: 1.2em;
color: #333;
}
#resultadoAnual {
margin-top: 10px;
font-weight: bold;
font-size: 1.1em;
color: #008000; /* Cor verde para destacar */
}
</style>
</head>
<body>
<div class="container">
<h2>Calculadora do Arigó</h2>
<p>Digite seus rendimentos tributáveis mensais para calcular o resultado.</p>
<label for="rendimento">Rendimentos Tributáveis Mensais (R$):</label>
<input type="number" id="rendimento" placeholder="Ex: 5000" step="0.01">
<button onclick="calcular()">Calcular</button>
<div class="resultado-container">
<p id="resultadoMensal"></p>
<p id="resultadoAnual"></p>
</div>
</div>
<script>
function calcular() {
// Obtém o valor do campo de entrada e converte para um número
const rendimentos = parseFloat(document.getElementById('rendimento').value);
// Verifica se o valor é um número válido
if (isNaN(rendimentos)) {
document.getElementById('resultadoMensal').innerText = 'Por favor, insira um valor numérico válido.';
document.getElementById('resultadoAnual').innerText = ''; // Limpa o resultado anual
return;
}
// Aplica a fórmula para o resultado mensal
const resultadoCalculoMensal = 978.62 - (0.133145 * rendimentos);
// Calcula o resultado anual (multiplicado por 12 meses + 13º salário)
const resultadoCalculoAnual = (978.62 - (0.133145 * rendimentos)) * 13;
// Exibe o resultado mensal formatado
document.getElementById('resultadoMensal').innerText = `O resultado mensal é: R$ ${resultadoCalculoMensal.toFixed(2).replace('.', ',')}`;
// Exibe o resultado anual formatado
document.getElementById('resultadoAnual').innerText = `O resultado anual (incluindo 13º) é: R$ ${resultadoCalculoAnual.toFixed(2).replace('.', ',')}`;
}
</script>
</body>
</html>