|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
import anime from 'animejs/lib/anime.es.js';
|
|
|
|
|
const notifcation = document.getElementById('notifications');
|
|
|
|
|
const notify = document.getElementById('notifyMessage');
|
|
|
|
|
const messageText = document.getElementById('message-text');
|
|
|
|
|
const iconGood = document.getElementById('notify-good');
|
|
|
|
|
const iconLame = document.getElementById('notify-lame');
|
|
|
|
@ -15,7 +16,7 @@ export default class Notfications {
|
|
|
|
|
//--------------------------
|
|
|
|
|
|
|
|
|
|
alert(text, status) {
|
|
|
|
|
//notifcation.style.display = 'flex';
|
|
|
|
|
notifcation.style.display = 'block';
|
|
|
|
|
iconWorking.style.display = 'none';
|
|
|
|
|
iconGood.style.display = 'none';
|
|
|
|
|
iconLame.style.display = 'none';
|
|
|
|
@ -35,8 +36,8 @@ export default class Notfications {
|
|
|
|
|
iconWorking.style.display = 'block';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
notifcation.classList.remove('notify-close');
|
|
|
|
|
notifcation.classList.add('notify-open');
|
|
|
|
|
notify.classList.remove('notify-close');
|
|
|
|
|
notify.classList.add('notify-open');
|
|
|
|
|
messageText.innerHTML = text;
|
|
|
|
|
anime({
|
|
|
|
|
targets: messageText,
|
|
|
|
@ -46,8 +47,11 @@ export default class Notfications {
|
|
|
|
|
complete: () => {
|
|
|
|
|
if (status !== null) {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
notifcation.classList.add('notify-close');
|
|
|
|
|
notifcation.classList.remove('notify-open');
|
|
|
|
|
notify.addEventListener('transitionend', () => {
|
|
|
|
|
notifcation.style.display = 'none';
|
|
|
|
|
});
|
|
|
|
|
notify.classList.add('notify-close');
|
|
|
|
|
notify.classList.remove('notify-open');
|
|
|
|
|
}, 1000);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|