|
|
|
@ -1,7 +1,10 @@
|
|
|
|
|
import anime from 'animejs/lib/anime.es.js';
|
|
|
|
|
const notifcation = document.getElementById('notifications');
|
|
|
|
|
const message = document.getElementById('notifyMessage');
|
|
|
|
|
const messageText = document.getElementById('message-text');
|
|
|
|
|
const iconGood = document.getElementById('notify-good');
|
|
|
|
|
const iconLame = document.getElementById('notify-lame');
|
|
|
|
|
const iconWorking = document.getElementById('notify-working');
|
|
|
|
|
|
|
|
|
|
export default class Notfications {
|
|
|
|
|
//--------------------------
|
|
|
|
|
// constructor
|
|
|
|
@ -12,26 +15,44 @@ export default class Notfications {
|
|
|
|
|
//--------------------------
|
|
|
|
|
|
|
|
|
|
alert(text, status) {
|
|
|
|
|
messageText.innerHTML = text;
|
|
|
|
|
notifcation.style.display = 'flex';
|
|
|
|
|
//notifcation.style.display = 'flex';
|
|
|
|
|
iconWorking.style.display = 'none';
|
|
|
|
|
iconGood.style.display = 'none';
|
|
|
|
|
iconLame.style.display = 'none';
|
|
|
|
|
var color = '';
|
|
|
|
|
status ? (color = '#32cd32') : (color = '#F64747');
|
|
|
|
|
if (status !== null) {
|
|
|
|
|
if (status) {
|
|
|
|
|
color = '#32cd32';
|
|
|
|
|
iconWorking.style.display = 'none';
|
|
|
|
|
iconGood.style.display = 'block';
|
|
|
|
|
} else {
|
|
|
|
|
color = '#F64747';
|
|
|
|
|
iconWorking.style.display = 'none';
|
|
|
|
|
iconLame.style.display = 'block';
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
color = '#200317';
|
|
|
|
|
iconWorking.style.display = 'block';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
notifcation.classList.remove('notify-close');
|
|
|
|
|
notifcation.classList.add('notify-open');
|
|
|
|
|
messageText.innerHTML = text;
|
|
|
|
|
anime({
|
|
|
|
|
targets: messageText,
|
|
|
|
|
backgroundColor: color,
|
|
|
|
|
easing: 'easeInOutQuint',
|
|
|
|
|
duration: 500,
|
|
|
|
|
duration: 700,
|
|
|
|
|
complete: () => {
|
|
|
|
|
if (status !== null) {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
anime({
|
|
|
|
|
targets: messageText,
|
|
|
|
|
backgroundColor: '#374857',
|
|
|
|
|
easing: 'easeOutQuint',
|
|
|
|
|
duration: 500
|
|
|
|
|
});
|
|
|
|
|
notifcation.classList.add('notify-close');
|
|
|
|
|
notifcation.classList.remove('notify-open');
|
|
|
|
|
}, 1000);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
/*
|
|
|
|
|
anime({
|
|
|
|
|
targets: message,
|
|
|
|
|
marginTop: '-20px',
|
|
|
|
@ -53,6 +74,7 @@ export default class Notfications {
|
|
|
|
|
}, 1000);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------
|
|
|
|
|