window.onclick = function (event) {
if(event.target == modal) {
modal.style.display = "none";
}
if(event.target == modal2) {
modal2.style.display = "none";
}
}
modal1btn.addEventListener(`click`, (e) => {
e.preventDefault();
modal1.classList.add(`modal--hidden`);
}
modal2btn.addEventListener(`click`, (e) => {
e.preventDefault();
modal2.classList.add(`modal--hidden`);
}