Skip to content

Commit a01b325

Browse files
committed
first commit
0 parents  commit a01b325

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2711
-0
lines changed

DOM/introducao01.html

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!DOCTYPE html>
2+
<html lang="pt-br">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>DOM</title>
8+
9+
10+
</head>
11+
12+
<body>
13+
<h1 id="titulo">Um título qualquer mesmo</h1>
14+
15+
<p id="paragrafo">Este é apenas um parágrafo contendo um <i> texto em itálico</i> qualquer</p>
16+
17+
<hr>
18+
19+
<input type="text" id="user" value="valor preenchido">
20+
21+
<hr>
22+
<h2>Lista de tarefas</h2>
23+
<ol id="listaTarefas">
24+
<li>Aprender CSS</li>
25+
<li>Aprender Javascript</li>
26+
<li>Aprender DOM profundamente</li>
27+
<li>Criar algo</li>
28+
</ol>
29+
30+
<script>
31+
document.getElementById("titulo").textContent = "titulo alterado 2"
32+
33+
const lista = document.getElementById("listaTarefas")
34+
let novaTarefa = "Aplicar à vagas de emprego"
35+
36+
lista.innerHTML += "<li>teste 2</li>"
37+
38+
</script>
39+
40+
</body>
41+
42+
</html>

DOM/introducao01.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
document.getElementById("titulo").textContent = "titulo alterado 2"

Readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Serliv
2+
3+
Os arquivos desse repositório foram criados durante a gravação da parte de Lógica de Programação com Javascript do [Curso Web Frontend FUndamentos: HTML, CSS e JS + 10 Projetos da Serliv](https://serfrontend.com/cursos/web-fundamentos-html-css/aplicando-desconto.html?d=31&m=09)

arrays/array-duplicado.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE html>
2+
<html lang="pt-br">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Arrays</title>
8+
</head>
9+
10+
<body>
11+
<h1>Arrays</h1>
12+
13+
<script>
14+
15+
16+
let numeros = [4, 8, 1, 0, 4, 23, 98, 9, 100, 7]
17+
let numeros2 = []
18+
19+
for (let i = 0; i < numeros.length; i++) {
20+
let numero = numeros[i] * 2
21+
22+
// numeros2[numeros2.length] = numero
23+
numeros2.push(numero) // método push() "empurra" um novo valor no final do array
24+
}
25+
26+
console.log(numeros2)
27+
28+
29+
</script>
30+
</body>
31+
32+
</html>

arrays/contrario.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<html lang="pt-br">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Arrays</title>
8+
</head>
9+
10+
<body>
11+
<h1>Arrays</h1>
12+
13+
<script>
14+
15+
const nomes = ["Amanda", "Beatriz", "Daniel"]
16+
17+
for (let i = nomes.length - 1; i >= 0; i--) {
18+
document.write(nomes[i] + "<br>")
19+
}
20+
21+
</script>
22+
</body>
23+
24+
</html>

arrays/dia-semana.html

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<!DOCTYPE html>
2+
<html lang="pt-br">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Arrays</title>
8+
</head>
9+
10+
<body>
11+
<h1>Arrays</h1>
12+
13+
<script>
14+
15+
const diasSemana = ["domingo", "segunda", "terça", "quarta", "quinta", "sexta", "sábado"]
16+
// 0 1 2 3 4
17+
18+
const hoje = new Date()
19+
const diaSemanaHoje = hoje.getDay()
20+
// alert(diaSemanaHoje)
21+
alert("Olá, hoje é " + diasSemana[diaSemanaHoje])
22+
23+
/* new Date().getDay()
24+
0 - domingo
25+
1 - segunda
26+
2 - terça
27+
3 - quarta
28+
4 - quinta
29+
5 - sexta
30+
6 - sabado
31+
*/
32+
33+
34+
</script>
35+
</body>
36+
37+
</html>

arrays/encontrou.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE html>
2+
<html lang="pt-br">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Arrays</title>
8+
</head>
9+
10+
<body>
11+
<h1>Arrays</h1>
12+
13+
<script>
14+
15+
const numeros = [2, "<sds>", 5, 6, 2, 1, 0, 9]
16+
let encontrou = false
17+
18+
for (let i = 0; i < numeros.length; i++) {
19+
let n = numeros[i]
20+
if (n === null || n === undefined || isNaN(n)) {
21+
encontrou = true
22+
break
23+
}
24+
}
25+
26+
alert("Encontrou null, undefined ou NaN? " + encontrou)
27+
28+
29+
</script>
30+
</body>
31+
32+
</html>

arrays/introducao.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE html>
2+
<html lang="pt-br">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Arrays</title>
8+
</head>
9+
10+
<body>
11+
<h1>Arrays</h1>
12+
13+
<script>
14+
15+
16+
let nomes = ["João", "Maria", "Daniel", "Beatriz", "Ricardo", "Luciane"] // sintaxe literal
17+
//let nomes = new Array("João", "Maria", "Daniel", "Beatriz") // sintaxe função construtora
18+
19+
let nomeDigitado = prompt("Digite seu nome")
20+
21+
nomes[nomes.length] = nomeDigitado
22+
23+
for (let i = 0; i < nomes.length; i++) {
24+
document.write("nome: " + nomes[i] + "<br>")
25+
}
26+
27+
28+
document.write("A lista de nomes possui " + nomes.length + " elementos")
29+
30+
31+
</script>
32+
</body>
33+
34+
</html>

arrays/meio.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html lang="pt-br">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Arrays</title>
8+
</head>
9+
10+
<body>
11+
<h1>Arrays</h1>
12+
13+
<script>
14+
15+
const numeros = [2, undefined, 31, 0, "9", 12, "qualquer texto", 98, false, [], null]
16+
17+
let meio = parseInt(numeros.length / 2)
18+
19+
alert("o elemento que está no meio é o " + numeros[meio])
20+
21+
22+
</script>
23+
</body>
24+
25+
</html>

arrays/soma-impares.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<html lang="pt-br">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Arrays</title>
8+
</head>
9+
10+
<body>
11+
<h1>Arrays</h1>
12+
13+
<script>
14+
15+
const numeros = [2, 3, 5, 6, 2, 1, 0, 9]
16+
17+
let soma = 0
18+
19+
for (let i = 0; i < numeros.length; i++) {
20+
let n = numeros[i]
21+
if (n % 2 !== 0) {
22+
// if (!(n % 2 === 0)) {
23+
soma += n
24+
}
25+
}
26+
27+
alert("a soma dos impares é " + soma)
28+
29+
30+
</script>
31+
</body>
32+
33+
</html>

0 commit comments

Comments
 (0)