diff --git a/src/scripts/main.js b/src/scripts/main.js index 35d0d8f74..705ecc16a 100644 --- a/src/scripts/main.js +++ b/src/scripts/main.js @@ -2,6 +2,21 @@ const pushNotification = (posTop, posRight, title, description, type) => { // write code here + const notification = document.createElement('div'); + + notification.classList.add('notification', type); + notification.style.top = posTop + 'px'; + notification.style.right = posRight + 'px'; + + notification.innerHTML = ` +

${title}

+

${description}

+ `; + document.body.appendChild(notification); + + setTimeout(() => { + notification.setAttribute('hidden', ''); + }, 2000); }; pushNotification(