Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Exercicios/1/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
<title>Document</title>
</head>
<body>
<form action="envio_dados">
<input type="text" name="nome" id="nomeDaPessoa" placeholder="Digite seu nome:">
<input type="submit" name="enviar" id="botaoDeEnviar" value="Enviar">
</form>

<div id="resposta"></div>

<script src="js/script.js"></script>
</body>
</html>
15 changes: 15 additions & 0 deletions Exercicios/1/js/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
document.querySelector('#botaoDeEnviar').addEventListener('click', function armazenarDados(event){
event.preventDefault();

let nome = document.getElementById('nomeDaPessoa');

let exibeResposta = document.getElementById('resposta');

if (nome.value === '') {
exibeResposta.innerText= 'Por favor, digite o seu nome.';
} else {
exibeResposta.innerHTML = (`${nome.value}, dados salvos com sucesso.`);


}
})
7 changes: 3 additions & 4 deletions Exercicios/2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ <h1>Venda de apartamentos</h1>
<div>Apartamento de dois dormitórios, clique e veja o preço:</div>
<button id="btnAptoDoisDorm">Clique aqui</button>
<div id="precoAptoDoisDorm"></div>
<br>
<hr>
<br>

<div>Apartamento de três dormitórios, clique e veja o preço:</div>
<button id="btnAptoTresDorm">Cliqui aqui</button>
<button onclick="mostraPrecoAptoTresDorm()">Cliqui aqui</button>
<div id="precoAptoTresDorm"></div>

<script src="js/script.js"></script>
</body>
</html>
12 changes: 9 additions & 3 deletions Exercicios/2/js/script.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
function mostraPrecoAptoDoisDorm() {
//especificar o elemento do DOM que será manipulado. DICA: botão


//evento de exibição do valor do imóvel
let getBotaoApDoisDorm = document.querySelector('#btnAptoDoisDorm');

getBotaoApDoisDorm.addEventListener('click', function mostraValor (){
document.getElementById('precoAptoDoisDorm').innerText ='Preço do imóvel: R$ 500.000,00';
})

};

function mostraPrecoAptoTresDorm() {

document.getElementById('precoAptoTresDorm').innerHTML = 'Preço do imóvel: R$ 600.000,00';
};

mostraPrecoAptoDoisDorm();
mostraPrecoAptoTresDorm();
//mostraPrecoAptoTresDorm();//
20 changes: 20 additions & 0 deletions Exercicios/Teste-Event-Listener/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!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>Document</title>
</head>
<body>
<h1 class="meu-titulo">Olá aTodos!</h1>

<p id="meuNome">Meu nome é Dandara.</p>

<span>Clique para mudar o background dessa página.</span>

<button id=acoesBotao>Clique Aqui</button>

<script src="./script.js"></script>
</body>
</html>
9 changes: 9 additions & 0 deletions Exercicios/Teste-Event-Listener/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
document.getElementById('acoesBotao').addEventListener('click', function acionarBotao(event){
event.preventDefault();

const mudaCorTitulo = document.querySelector('.meu-titulo').style.color = "blue";

const mudaParagrafo = document.querySelector('#meuNome').innerHTML += "E eu tenho 28 anos.";

const mudaSpan = document.querySelector('span').style.textDecoration = "underline";
});
14 changes: 14 additions & 0 deletions Exercicios/Teste-Exemplo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!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>Aula JavaScript</title>
</head>
<body>
<p id="mudanca-texto">Clique no botão para mudar o texto desse parágrafo!</p>
<button onclick="alterarTexto()">Clicar</button>
<script src="../Teste-Exemplo/script.js"></script>
</body>
</html>
5 changes: 5 additions & 0 deletions Exercicios/Teste-Exemplo/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function alterarTexto(){
const textoAAlterar = document.getElementById("mudanca-texto").innerHTML = "Hello World";
return textoAAlterar;
}

20 changes: 20 additions & 0 deletions Exercicios/Teste-Query-Serve/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!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>Document</title>
</head>
<body>
<h1 class="meu-titulo">Olá aTodos!</h1>

<p id="meuNome">Meu nome é Dandara.</p>

<span>Clique para mudar o background dessa página.</span>

<button onclick="mudarCor()">Clique Aqui</button>

<script src="../Teste-Query-Serve/script.js"></script>
</body>
</html>
7 changes: 7 additions & 0 deletions Exercicios/Teste-Query-Serve/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function mudarCor() {
const mudaCorTitulo = document.querySelector('.meu-titulo').style.color = "blue";

const mudaParagrafo = document.querySelector('#meuNome').innerHTML += "E eu tenho 28 anos.";

const mudaSpan = document.querySelector('span').style.textDecoration = "underline";
}
38 changes: 38 additions & 0 deletions Exercício de Casa/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!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>Biblioteca</title>
</head>
<body>
<form action="" onsubmit="exibirDados(event)">
<h1>Livros</h1>
<label for="titulo">Título:</label>
<input type="text" id="titulo" placeholder="Insira o título aqui">

<label for="autor">Autor:</label>
<input type="text" id="autor" placeholder="Insira o nome do autor aqui">

<label for="isbn">ISBN:</label>
<input type="text" id="isbn" placeholder="Insira o isbn aqui">

<label for="data-publicacao">Data de Publicação:</label>
<input type="date" id="dataPublicacao" placeholder="Insira a data aqui">

<div>
<input type="submit" name="enviar" id="botaoDeEnviar" value="Enviar">
</div>

<div id="resposta" class="resposta__box resposta__list">

</div>

</form>

<table></table>

<script src="script/script.js"></script>
</body>
</html>
139 changes: 139 additions & 0 deletions Exercício de Casa/script/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
let books = [{
isbn: "9781593275846",
title: "Eloquent JavaScript, Second Edition",
author: "Marijn Haverbeke",
published: "2014-12-14T00:00:00.000Z",
},
{
isbn: "9781449331818",
title: "Learning JavaScript Design Patterns",
author: "Addy Osmani",
published: "2012-07-01T00:00:00.000Z",
},
{
isbn: "9781449365035",
title: "Speaking JavaScript",
author: "Axel Rauschmayer",
published: "2014-02-01T00:00:00.000Z",
},
{
isbn: "9781491950296",
title: "Programming JavaScript Applications",
author: "Eric Elliott",
published: "2014-07-01T00:00:00.000Z",
},
{
isbn: "9781593277574",
title: "Understanding ECMAScript 6",
author: "Nicholas C. Zakas",
published: "2016-09-03T00:00:00.000Z",
},
{
isbn: "9781491904244",
title: "You Don't Know JS",
author: "Kyle Simpson",
published: "2015-12-27T00:00:00.000Z",
},
{
isbn: "9781449325862",
title: "Git Pocket Guide",
author: "Richard E. Silverman",
published: "2013-08-02T00:00:00.000Z",
},
{
isbn: "9781449337711",
title: "Designing Evolvable Web APIs with ASP.NET",
author: "Glenn Block, et al.",
published: "2014-04-07T00:00:00.000Z",
}
]



function addLivros() {

books.map((book) => {
const parseSubtitle = !book.subtitle ? "-" : book.subtitle;
const parsePages = !book.pages ? "-" : book.pages;
const parseData = new Date(book.published);
const data = parseData.setDate(parseData.getDate() + 1);
const dataFormatada = parseData.toLocaleDateString('pt-br');

document.getElementById('texto').innerHTML +=
`
<tr >
<td> ${book.title} </td>
<td> ${parseSubtitle}</td>
<td> ${book.author}</td>
<td> ${parsePages}</td>
<td> ${dataFormatada}</td>
<td> ${book.isbn}</td>
<td><button class="delete">Remover</button></td>
</tr>
`
})
}

addLivros();


function exibirDados(event) {
event.preventDefault();

let pegaTitulo = document.getElementById('titulo').value;
let pegaAutor = document.getElementById('autor').value;
let pegaIsbn = document.getElementById('isbn').value;
let pegaDataPublicacao = document.getElementById('dataPublicacao').value;

let dataInsercao = new Date().toLocaleDateString('pt-br');
let horarioInsercao = new Date().toLocaleTimeString('pt-br');

document.getElementById('resposta').innerHTML +=`
<ul>
<li>
<strong>Título: </strong> ${pegaTitulo}, <strong>Autor: </strong> ${pegaAutor},
<strong>ISBN: </strong> ${pegaIsbn}, <strong>Data de Pulicação: </strong> ${pegaDataPublicacao},
<strong>Data de Ingresso no Sistema: </strong> ${dataInsercao}, ${horarioInsercao}
<a href="#" class="delete">Remover</a>
</li>
</ul>
`


limparDados();

if(pegaTitulo === "" || pegaAutor === "" || pegaIsbn === "" || pegaDataPublicacao === "") {
alert("Campo Obrigatorio não preenchido")
} else {
books.push ({
autor: pegaAutor,
title: pegaTitulo,
isbn: pegaIsbn,
published: pegaDataPublicacao,

});
limparDados();
addLivros();
}


}

function limparDados() {
document.getElementById('titulo').value = "";
document.getElementById('autor').value = "";
document.getElementById('isbn').value = "";
document.getElementById('dataPublicacao').value = "";
}

document.getElementById('resposta').addEventListener('click', function(event){
if (event.target.className ==="delete"){
event.target.parentElement.remove();
}

})