user feedback improvements

This commit is contained in:
Kyle
2021-01-27 09:58:15 -08:00
parent 1a452c8266
commit c1a9c437e1
7 changed files with 23 additions and 14 deletions

View File

@@ -8,7 +8,7 @@ function toggleMenu() {
document.querySelector('.menu').classList.add('menu-visible');
}
}
function notify(message = '') {
function notify(message = '', seconds) {
var notification = document.createElement('div');
notification.classList = 'notification padding';
var notificationMessage = document.createElement('h4');
@@ -19,6 +19,9 @@ function notify(message = '') {
close.onclick = closeNotification;
notification.appendChild(close);
document.querySelector('.notification-container').appendChild(notification);
if (seconds) {
setTimeout(function(){close.click();}, seconds * 1000)
}
}
function closeNotification(event) {
var target = event.target.closest('.notification');