mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-02 11:18:53 +00:00
fix/feat(esx_notify): use correct length and add animations correctly
This commit is contained in:
@@ -57,8 +57,9 @@ notification = (data) => {
|
||||
}
|
||||
}
|
||||
|
||||
const id = Math.floor(Math.random() * Math.random());
|
||||
const notification = $(`
|
||||
<div class="notify ${data.type}">
|
||||
<div id="${id}" class="notify ${data.type} fadeIn">
|
||||
<div class="innerText">
|
||||
<span class="material-symbols-outlined icon">${types[data.type] ? types[data.type]["icon"] : types["info"]["icon"]}</span>
|
||||
<p class="text">${data["message"]}</p>
|
||||
@@ -67,8 +68,16 @@ notification = (data) => {
|
||||
`).appendTo(`#root`);
|
||||
|
||||
setTimeout(() => {
|
||||
notification.fadeOut(70);
|
||||
}, 10000);
|
||||
document.getElementById(id).classList.remove("fadeIn");
|
||||
}, 300);
|
||||
|
||||
setTimeout(() => {
|
||||
document.getElementById(id).classList.add("fadeOut");
|
||||
|
||||
setTimeout(() => {
|
||||
document.getElementById(id).remove();
|
||||
}, 400);
|
||||
},data.length);
|
||||
|
||||
return notification;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user