diff --git a/desafios/07/script.js b/desafios/07/script.js index c344f96..1235369 100644 --- a/desafios/07/script.js +++ b/desafios/07/script.js @@ -11,13 +11,7 @@ btnLogin.addEventListener("click", event => { }); const formError = document.querySelector(".validate-error"); - if (formError) { - formError.addEventListener("animationend", event => { - if (event.animationName === "nono") { - formError.classList.remove("validate-error"); - } - }); - } else { + if (!formError) { form.classList.add("form-hide"); } }); @@ -33,6 +27,10 @@ form.addEventListener("animationend", event => { form.style.display = "none"; document.querySelector("body").style.overflow = "none"; } + + if (event.animationName === "nono") { + form.classList.remove("validate-error"); + } }); /* background squares */