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
215 changes: 215 additions & 0 deletions elciele-correa/src/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
* {
box-sizing: border-box;
font-family: 'Manjari', sans-serif;
font-size: 16px;
}

body {
margin: 0;
background-color: #9182A6;
box-sizing: border-box;
}

li {
display: flex;
max-width: 90%;
justify-content: space-between;
cursor: pointer;
}

button {
cursor: pointer;
}

.flex {
min-height: 100%;
display: flex;
align-items: center;
justify-content: center;
padding: 2rem;
flex-direction: column;
}

.todo__container {
background-color: white;
text-align: center;
margin: 100px auto 0;
width: 100%;
max-width: 30rem;
padding: 0px 0px 32px 0px;
border-radius: 14px;
box-shadow: 0px 24px 80px rgba(0, 45, 37, 0.24);
}

.todo__title {
text-align: center;
margin: 40px auto 32px auto;
display: inline-block;
font-size: 24px;
color: #7E77A0;
}

.todo-form {
justify-content: center;
display: flex;
}

.empty {
position: relative;
animation: shake .1s linear;
animation-iteration-count: 3;
}

@keyframes shake {
0% {
left: -5px;
}
100% {
right: -5px;
}
}

.todo__tarefas__sample {
max-width: 90%;
background: #7e77a01a;
margin: 0 auto;
height: 60px;
border-radius: 24px;
align-items: center;
padding: 20px;
margin: 16px auto;
}

.todo__tarefas__sample-content {
background: #8f88b325;
max-width: 50%;
height: 20px;
border-radius: 14px;
}

.todo__tarefas__sample:last-child {
opacity: 0.60;
}

.todo-form__input {
width: 75%;
padding: 24px;
height: 60px;
background-color: #E6EEC6;
border-radius: 24px;
border: 0px;
outline: none;
margin-right: 3%;
}

.todo-form__input:focus {
outline: none;
border: solid 3px #B0CF30;
}

.todo-form__btn {
background-color: #7E77A0;
text-transform: uppercase;
color: white;
width: 55px;
height: 55px;
display: inline-block;
border-radius: 50%;
font-size: 24px;
cursor: pointer;
border: 0px;
}

.todo-form__btn:hover {
box-shadow: 0px 16px 24px rgba(126, 119, 160, 0.267);
width: 56px;
height: 56px;
transition: 0.3s;
}

.todo__btn-container {
display: flex;
align-items: center;
justify-content: center;
}

.todo__tudo-feito {
border: 4px solid #B0CF30;
box-sizing: border-box;
border-radius: 24px;
background-color: transparent;
padding: 16px 20px 16px 20px;
margin: 16px 20px 0px 20px;
color: rgb(73, 73, 73);
}

.checked {
text-decoration: line-through wavy #7E77A0;
}

.todo__tudo-feito:hover {
background-color: #B0CF30;
box-shadow: 0px 16px 24px rgba(175, 207, 48, 0.205);
transition: 0.3s;
}

.todo__remover-todos {
border: 4px solid #B0CF30;
box-sizing: border-box;
border-radius: 24px;
background-color: #B0CF30;
padding: 16px 20px 16px 20px;
margin: 16px 20px 0px 20px;
color: #494949;
}

.todo__remover-todos:hover {
background-color: transparent;
box-shadow: 0px 16px 24px rgba(175, 207, 48, 0.205);
transition: 0.3s;
}

@media only screen and (max-width: 460px) {
.todo-form {
flex-direction: column;
}
.todo-form__input {
width: 90%;
align-self: center;
margin: 0 auto;
}
.todo-form__btn {
background-color: #7E77A0;
text-transform: uppercase;
color: white;
width: 90%;
height: 55px;
border-radius: 24px;
align-self: center;
margin-top: 8px;
}
.todo-form__btn:hover {
box-shadow: 0px 16px 24px rgba(126, 119, 160, 0.267);
width: 90%;
transition: 0.3s;
}
.todo__btn-container {
flex-direction: column;
}
.todo__tudo-feito {
width: 90%;
}
.todo__tudo-feito:hover {
background-color: #B0CF30;
box-shadow: 0px 16px 24px rgba(175, 207, 48, 0.205);
transition: 0.3s;
}
.todo__remover-todos {
background-color: transparent;
width: 90%;
margin-top: 8px;
}
.todo__tarefas {
margin: 32px auto 24px auto;
}
}
50 changes: 50 additions & 0 deletions elciele-correa/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://fonts.googleapis.com/css?family=Manjari&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
<title>ToDo List</title>
</head>

<body>

<main class="flex">
<div class="todo__container">
<h1 class="todo__title">Lista de Tarefas</h1>
<form action="" class="todo-form" id="todoForm">
<input type="text" name="tarefa" class="todo-form__input" placeholder="Insira sua tarefa" id="todoInput"
autofocus>
<button type="submit" class="todo-form__btn" id="todoSubmit">+</button>
</form>
<div class="todo__tarefas" id="todoTarefas">
<ul class="todo__tarefas-lista" id="todoLista">
</ul>
</div>

<!-- fase bônus -->
<!-- <div class="sample" id="sample">
<div class="todo__tarefas__sample">
<div class="todo__tarefas__sample-content">
</div>
</div>
<div class="todo__tarefas__sample">
<div class="todo__tarefas__sample-content">
</div>
</div>
</div> -->

<div class="todo__btn-container">
<button class="todo__tudo-feito" id="todoMarcarTodos">Marcar todos</button>
<button class="todo__remover-todos" id="todoRemoverTodos">Limpar Lista</button>
</div>
</div>
</main>

<script type="text/javascript" src="script.js"></script>
</body>

</html>
95 changes: 95 additions & 0 deletions elciele-correa/src/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
// nó do input
const inputado = document.querySelector('#todoInput');

//nó da botao
const botao = document.getElementById('todoSubmit');

//nó da ul
const listaTarefas = document.getElementById('todoLista');

//nó do formulário
const formulario = document.getElementById('todoForm');

//nó do botão limpar
const botaoLimpar = document.getElementById('todoRemoverTodos');

// nó do botão marcar todos
const botaoMarcarTodas = document.querySelector('#todoMarcarTodos');

// criar evento botão
botao.addEventListener('click', (event) => {
//previne que o formulário seja enviado ao clicar, espera processar o que precisa da função
event.preventDefault();

const elementoLista = document.createElement('li');
const textoElemento = document.createElement('p');
const deletaElemento = document.createElement('span');

// atribuímos o valor do input ao <p> criado a partir do clique no botão
textoElemento.innerText = inputado.value;
deletaElemento.innerText = '🗑';
// para excluir itens da lista, precisamos criar um elemento que represente isso, e colocar evento para remover o nó do dom

if (textoElemento.innerText.trim() === '') {
alert("Insira uma tarefa");
} else {
//pegamos o nó mãe , e acrescentamos o elemento filho com o append
listaTarefas.appendChild(elementoLista);
elementoLista.appendChild(textoElemento);
elementoLista.appendChild(deletaElemento);

// pegamos o nó do formulário e utilizamos um método para limpar o input
formulario.reset();

}

//função de checar
textoElemento.addEventListener("click", () => {
textoElemento.classList.add("checked");
});

//função de deletar
deletaElemento.addEventListener("click", () => {
listaTarefas.removeChild(elementoLista);
// outra de forma de resolver >>> elementoLista.remove();
});



//TODO função de marcar todos
botaoMarcarTodas.addEventListener('click', () => {
// o querySelectorALl retorna um array com itens de acordo o passado como parâmetro


if (botaoMarcarTodas.innerText === 'Marcar todos') {
const todosParagrafos = document.querySelectorAll('p');
console.log(todosParagrafos, "vai retornar todos os <p> encontrados");

todosParagrafos.forEach(item => {
item.classList.add("checked");
});
botaoMarcarTodas.innerText = 'Desmarcar todos';
} else {
const todosParagrafos = document.querySelectorAll('p');
todosParagrafos.forEach(item => {
item.classList.remove("checked");
});
botaoMarcarTodas.innerText = 'Marcar todos';
}

});

//TODO função de limpar
botaoLimpar.addEventListener('click', () => {
//listaTarefas é <ul>
listaTarefas.innerHTML = '';
});

});



// Eu fiz acompanhando a aula.
//Eu ainda não consigo fazer sozinha pois ainda não consegui aprender o JavaScrip direito, então quando fica complexo assim, eu travo...
//Vou continuar estudando muito
// Obrigada pela aula.
1 change: 1 addition & 0 deletions projeto/src/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@