-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upload dos meus exercicios complementares
- Loading branch information
1 parent
6573a8e
commit e3dae2b
Showing
11 changed files
with
341 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
meus_exercicios_complementares/javascript-curso-em-video/aula04/ex001.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE html> | ||
<html lang="pt-br"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Meu Primeiro Programa</title> | ||
<style> | ||
body{ | ||
background-color: rgb(105, 105, 173); | ||
color: white; | ||
font: normal 20pt Arial; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>Olá Mundo</h1> | ||
<p>Já me livrei da maldição</p> | ||
|
||
<script> | ||
window.alert('Minha primeira mensagem'); | ||
window.confirm('Está gostando de JavaScript?'); | ||
window.prompt('Qual é o seu nome?'); | ||
</script> | ||
</body> | ||
</html> |
25 changes: 25 additions & 0 deletions
25
meus_exercicios_complementares/javascript-curso-em-video/aula06/ex002.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<html lang="pt-br"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Variavel</title> | ||
<style> | ||
body{ | ||
background-color: rgb(105, 105, 173); | ||
color: white; | ||
font: normal 20pt Arial; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>Olá Mundo</h1> | ||
<p>Já me livrei da maldição</p> | ||
|
||
<script> | ||
var nome = window.prompt('Qual é o seu nome?'); | ||
window.alert('É um grande prazer te conhecer ' + nome); | ||
</script> | ||
</body> | ||
</html> |
45 changes: 45 additions & 0 deletions
45
meus_exercicios_complementares/javascript-curso-em-video/aula06/ex003.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!DOCTYPE html> | ||
<html lang="pt-br"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Variavel</title> | ||
<style> | ||
body{ | ||
background-color: rgb(105, 105, 173); | ||
color: white; | ||
font: normal 20pt Arial; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>Olá Mundo</h1> | ||
<p>Já me livrei da maldição</p> | ||
|
||
<script> | ||
//window.prompt() recebe uma String | ||
/* | ||
Maneiras de converter String em numeros: | ||
- Number.parseInt(n) | ||
- Number.parseFloat(n) | ||
- Number(n) ->Serve para o programa decidir qual o tipo do dado | ||
Maneiras de converter numeros em Strings: | ||
- String(n) | ||
- n.toString() | ||
Maneiras de formatar Strings: | ||
- s.length ->Quantos caracteres a String tem | ||
- s.toUpperCase() ->Muda tudo para "MAIÚSCULAS" | ||
- s.toLowerCase() ->Muda tudo para "minuscúlas" | ||
*/ | ||
|
||
var numero1 = Number(window.prompt('Digite um número')); | ||
var numero2 = Number(window.prompt('Digite mais um número')); | ||
var soma = numero1 + numero2; | ||
|
||
window.alert(`A soma dos valores é de ${soma}`); | ||
</script> | ||
</body> | ||
</html> |
33 changes: 33 additions & 0 deletions
33
meus_exercicios_complementares/javascript-curso-em-video/aula06/ex004.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Variavel</title> | ||
<style> | ||
body{ | ||
background-color: rgb(105, 105, 173); | ||
color: white; | ||
font: normal 20pt Arial; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<script> | ||
var nome = window.prompt('Qual é o seu nome?'); | ||
|
||
document.writeln(`Olá ${nome} o seu nome tem <strong>${nome.length}</strong> letras <br/>`); | ||
document.writeln(`O seu nome em maiúsculo fica: <strong>${nome.toUpperCase()}</strong><br/>`); | ||
document.writeln(`O seu nome em minúsculo fica: <strong>${nome.toLowerCase()}</strong>`); | ||
|
||
/* | ||
Maneiras de formatar numeros: | ||
- n1.toFixed ->Para que sempre tenha 2 casas decimais | ||
- n1.toLocaleString('pt-br', {style: 'currency', currency: 'BRL'}) ->Deixa o número formatado em dinheiro BRL | ||
*/ | ||
</script> | ||
|
||
</body> | ||
</html> |
6 changes: 6 additions & 0 deletions
6
meus_exercicios_complementares/javascript-curso-em-video/aula08/anotacoes.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
5 == 5 ->true | ||
5 == '5' ->true | ||
Isso acontece porque o sinal de igualdade não conta o tipo do dado | ||
|
||
=== ->Operador de igualdade restrita | ||
5 === '5' ->false |
32 changes: 32 additions & 0 deletions
32
meus_exercicios_complementares/javascript-curso-em-video/aula09/ex005.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE html> | ||
<html lang="pt-br"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>DOM</title> | ||
<style> | ||
body{ | ||
background-color: rgb(68, 125, 199); | ||
color: white; | ||
font: normal 18pt Arial; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>Iniciando estudos com DOM</h1> | ||
<p>Aqui vai o resultado</p> | ||
<p>Aprendendo a usar o <strong>DOM</strong></p> | ||
<div id="mensagem">Clique em mim</div> | ||
|
||
<script> | ||
var p1 = window.document.getElementsByTagName('p')[0]; | ||
var p2 = window.document.getElementsByTagName('p')[1]; | ||
//window.alert(p1.innerText); | ||
|
||
var msg = document.getElementById('mensagem'); | ||
msg.style.backgroundColor = "green" | ||
msg.style.padding = "5px" | ||
</script> | ||
</body> | ||
</html> |
62 changes: 62 additions & 0 deletions
62
meus_exercicios_complementares/javascript-curso-em-video/aula10/ex006.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<!DOCTYPE html> | ||
<html lang="pt-br"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Eventos DOM</title> | ||
<style> | ||
body{ | ||
background-color: cadetblue; | ||
color: white; | ||
font: normal 18pt Arial; | ||
} | ||
|
||
div#area{ | ||
background-color: rgb(42, 139, 42); | ||
color: white; | ||
width: 200px; | ||
height: 200px; | ||
|
||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<div id="area"> | ||
Interaja... | ||
</div> | ||
|
||
<script> | ||
|
||
var area = window.document.getElementById('area'); | ||
area.addEventListener("click", clicar); | ||
area.addEventListener("mouseenter", entrar); | ||
area.addEventListener("mouseout", sair); | ||
|
||
function clicar(){ | ||
area.innerHTML = "Clicou" | ||
area.style.backgroundColor = "black"; | ||
area.style.width = "300px" | ||
area.style.height = "300px" | ||
} | ||
|
||
function entrar(){ | ||
area.innerHTML = "Entrou" | ||
area.style.backgroundColor = "blue"; | ||
area.style.width = "150px" | ||
area.style.height = "200px" | ||
} | ||
|
||
function sair(){ | ||
area.innerHTML = "Saiu" | ||
area.style.backgroundColor = "red"; | ||
area.style.width = "350px" | ||
area.style.height = "100px" | ||
} | ||
</script> | ||
</body> | ||
</html> |
48 changes: 48 additions & 0 deletions
48
meus_exercicios_complementares/javascript-curso-em-video/aula10/ex007.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html lang="pt-br"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Somando números</title> | ||
<style> | ||
body { | ||
background-color: cadetblue; | ||
color: white; | ||
font: normal 18pt Arial; | ||
} | ||
input{ | ||
padding: 5px; | ||
border-radius: 5px; | ||
border: 1px solid black; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
|
||
<h1>Somando números</h1> | ||
<input type="number" id="n1" placeholder="Número 1"> + | ||
<input type="number" id="n2" placeholder="Número 2"> | ||
<button id="btn-soma">Somar</button> | ||
|
||
<script> | ||
var botaoDeSoma = document.getElementById('btn-soma'); | ||
botaoDeSoma.addEventListener('click', somar); | ||
|
||
function somar() { | ||
var inputn1 = document.getElementById('n1'); | ||
var inputn2 = document.getElementById('n2'); | ||
|
||
var numero1 = Number(inputn1.value); | ||
var numero2 = Number(inputn2.value); | ||
|
||
var soma = numero1 + numero2; | ||
window.alert(`A soma do número ${numero1} e do ${numero2} é de ${soma}`); | ||
} | ||
|
||
</script> | ||
</body> | ||
|
||
</html> |
10 changes: 10 additions & 0 deletions
10
meus_exercicios_complementares/javascript-curso-em-video/aula11/ex008.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
console.log('O console funcionou corretamente') | ||
console.log('') | ||
|
||
var velocidade = 62; | ||
|
||
if(velocidade > 60){ | ||
console.log('Você está acima da velocidade permitida'); | ||
}else{ | ||
console.log('Dirija sempre usando cinto de segurança') | ||
} |
7 changes: 7 additions & 0 deletions
7
meus_exercicios_complementares/javascript-curso-em-video/aula11/ex009.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
var pais = "Brasil"; | ||
|
||
if(pais == "Brasil"){ | ||
console.log("Você é brasileiro") | ||
}else{ | ||
console.log("Você é extrangeiro") | ||
} |
47 changes: 47 additions & 0 deletions
47
meus_exercicios_complementares/javascript-curso-em-video/aula11/ex010.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!DOCTYPE html> | ||
<html lang="pt-br"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>DETRAN</title> | ||
<style> | ||
body { | ||
background-color: cadetblue; | ||
color: white; | ||
font: normal 18pt Arial; | ||
} | ||
input{ | ||
padding: 5px; | ||
border-radius: 5px; | ||
border: 1px solid black; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>Sistema de multas</h1> | ||
<input type="number" id="vel" placeholder="Velocidade do carro: "> | ||
<button id="btn-calc">Verificar</button> | ||
|
||
<div id="resp"></div> | ||
|
||
<script> | ||
var btn = document.getElementById('btn-calc'); | ||
btn.addEventListener("click", verifica) | ||
|
||
function verifica(){ | ||
var resposta = document.getElementById('resp'); | ||
var velocidadeTXT = document.getElementById('vel'); | ||
var velocidade = Number(velocidadeTXT.value); | ||
|
||
resposta.innerHTML = `<p>Sua velocidade atual é de <strong>${velocidade} km/h</strong></p>` | ||
|
||
if(velocidade > 60){ | ||
resposta.innerHTML += `<p>Você está multado por excesso de velocidade</p>` | ||
} | ||
|
||
resposta.innerHTML += `<p>Dirija sempre com o cinto de segurança!</p>` | ||
} | ||
</script> | ||
</body> | ||
</html> |