Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nailtonpaixao/2f299627cbc7e27cf3b6b34b8de44771 to your computer and use it in GitHub Desktop.
Save nailtonpaixao/2f299627cbc7e27cf3b6b34b8de44771 to your computer and use it in GitHub Desktop.
Calculadora de Combustível
<html>
<head>
<title>
Imersão Dev - Aula 01
</title>
</head>
<body>
<div class="container">
<h1 class="page-title">
ETANOL X GASOLINA
</h1>
<p class="page-subtitle">
Descubra qual combustível compensa mais
</p>
<img src="https://www.alura.com.br/assets/img/imersoes/dev-2021/logo-imersao-conversor-de-moedas.svg" class="page-logo" alt="">
</div>
<a href="https://alura.com.br/" target="_blank">
<img src="https://www.alura.com.br/assets/img/home/alura-logo.svg" alt="" class="alura-logo">
</a>
</body>
</html>
var alcool = prompt ("Qual o valor do álcool ?")
alcool = parseFloat (alcool)
var gasolina = prompt ("Qual o valor da gasolina ?")
gasolina = parseFloat (gasolina)
var result = alcool/gasolina
if (result < 0.7) {
alert("Abasteça com álcool")
} else if (result > 0,7) {
alert("Abasteça com Gasolina")
}
//*REVISÃO*
//Variáveis = var - int - float - string
// alert - parseInt parseFloat
//Operações = somar, dividir, multiplicar, subtrair
//comentario final
body {
font-family: 'Roboto Mono',monospace;
min-height: 400px;
background-image: url('https://images.pexels.com/photos/3602009/pexels-photo-3602009.jpeg?cs=srgb&dl=pexels-sergio-souza-3602009.jpg&fm=jpg');
background-color: #000000;
background-size: 250vh;
background-position: center bottom;
background-repeat: no-repeat;
}
.container {
text-align: center;
padding: 20px;
height: 100vh;
}
.page-title {
color: #ffffff;
margin: 0 0 5px;
}
.page-subtitle {
color: #ffffff;
margin-top: 5px;
}
.page-logo {
width: 200px;
}
.alura-logo {
width: 40px;
position: absolute;
top: 10px;
right:10px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment