Resumo da Live TikTok 04092024
Olá Pessoal!
Na Live do dia 04/09/2024 trabalhamos com mini projeto envolvendo o método indexOf.
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<h1>Busca a Fruta</h1>
<button class="btn"
onclick="buscarFruta()">Buscar Fruta
</button>
</div>
<script>
function buscarFruta(){
const frutas = [];
for(var cont = 0; cont < 3; cont++ ){
frutas[cont] =
prompt("Digite a " + (cont + 1)
+'ª fruta');
}
var fruta =
prompt('Busque uma fruta');
var index = frutas.indexOf(fruta);
if(index != -1){
alert('Encontrei a fruta: ' +
fruta + ' na posicao '
+ index );
}else{
alert('Não encontrei a fruta!')
}
}
</script>
</body>
</html>
CSS
body{
background-color: #0d0d0d;
color: #E0E0E0;
font-size: 'Courier New' Courier, monospace;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
text-transform: uppercase;
letter-spacing: 2px;
}
h1{
color: #ff0000;
text-shadow: 2px 2px #000;
}
.container{
background-color: #1c1c1c;
padding: 30px;
border: 2px solid #ff0000;
border-radius: 10px;
text-align: center;
box-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
}
.btn{
background-color: #ff0000;
color: #ffffff;
padding: 12px 24px;
border: 2px solid #ffffff;
border-radius: 5px;
cursor: pointer;
font-size: 18px;
font-weight: bold;
text-transform: uppercase;
letter-spacing: 1px;
margin-top: 20px;
transition: background-color 0.3s ease,
transform 0.3s ease;
}
.btn:hover{
background-color: #e00000;
transform: scale(1.1);
}
.btn:active{
background-color: #c00000;
transform: scale(0.9);
}
https://go.hotmart.com/V89811082M?dp=1
https://go.hotmart.com/X90111663X?dp=1
HORÁRIO DAS LIVES
Domingo – Segunda e Quarta às 19:00hs
Quinta – Sexta e Sábado às 10:00hs