HTML (PEDIR PARA O CHATGPT APENAS FAZER O HTML
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Verificador de Ano Bissexto</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f9;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.container {
background-color: #ffffff;
padding: 2rem;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
text-align: center;
max-width: 400px;
width: 100%;
}
h1 {
color: #333;
margin-bottom: 1.5rem;
font-size: 2rem;
}
label {
font-size: 1rem;
color: #555;
}
input[type="number"] {
width: 100%;
padding: 0.75rem;
margin: 1rem 0;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 1rem;
}
button {
background-color: #007bff;
color: white;
border: none;
padding: 0.75rem 1.5rem;
border-radius: 5px;
font-size: 1rem;
cursor: pointer;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #0056b3;
}
#resultado {
margin-top: 1.5rem;
font-size: 1.2rem;
color: #333;
}
</style>
</head>
<body>
<div class="container">
<h1>Verificador de Ano Bissexto</h1>
<form id="anoForm">
<label for="ano">Digite um ano:</label>
<input type="number" id="ano" name="ano" required placeholder="Ex: 2024">
</form>
<button onclick="verificar()">Verificar</button>
<p id="resultado"></p>
</div>
<script src="app.js"> </script>
</body>
</html>
JAVASCRIPT
function verificar () {
let ano = parseInt(document.getElementById('ano').value);
let txtResult = document.getElementById('resultado');
let calculo = ano / 4;
if (Number.isInteger(calculo) == true) {
txtResult.innerHTML = `O ano ${ano} é bissexto`;
} else {
txtResult.innerHTML = `O ano ${ano} não é bissexto`;
}
}