Develop #3

Merged
WilliamSimao merged 26 commits from Develop into main 2022-11-29 01:13:27 +00:00
Showing only changes of commit 19f35863d9 - Show all commits

23
js.js
View File

@ -7,11 +7,11 @@ document.addEventListener('DOMContentLoaded', function () {
const textLabelInput = "Imagem"; const textLabelInput = "Imagem";
labelInput.innerText = textLabelInput; labelInput.innerText = textLabelInput;
const form = document.querySelector('.form__tourist-attractions');
const ulList = document.querySelector('.wrapper-ul__cards');
const inputTitle = document.querySelector('.input-text__titulo'); const inputTitle = document.querySelector('.input-text__titulo');
const inputDescription = document.querySelector('.input-text__descricao'); const inputDescription = document.querySelector('.input-text__descricao');
const form = document.querySelector('.form__tourist-attractions');
const ulList = document.querySelector('.wrapper-ul__cards');
//Image Preview //Image Preview
inputFile.addEventListener('change', (e) => { inputFile.addEventListener('change', (e) => {
@ -71,10 +71,13 @@ document.addEventListener('DOMContentLoaded', function () {
list.push(spot); list.push(spot);
renderListItems(); renderListItems();
resetInputs();
}else { }else {
alert('Preencha todos os campos') alert('Preencha todos os campos')
} }
}); });
@ -91,21 +94,23 @@ document.addEventListener('DOMContentLoaded', function () {
<div class="result-card__text"> <div class="result-card__text">
<h2 class="result-card__title">${i.titulo}</h2> <h2 class="result-card__title">${i.titulo}</h2>
<p> class="result-card__description">${i.description}</p> <p class="result-card__description">${i.description}</p>
</div> </div>
</li> </li>
`; `;
}); });
ulList.innerHTML = spotStructure; ulList.innerHTML = spotStructure;
}; };
function resetInputs () {
inputTitle.value = '';
inputDescription.value = '';
labelInput.innerText = textLabelInput;
labelInput.style.border = "";
};
}); });