\
'); } function createAndRemoveNotification(message, delay = 5) { var id = crypto.randomUUID(); if($(".custom-notifications-container").length == 0) { $("body").append('
'); } $(".custom-notifications-container").append('
' + message + '
'); setTimeout(function() { $("#" + id).removeClass("custom-notifications-open-animation"); $("#" + id).addClass("custom-notifications-close-animation"); setTimeout(function() { $("#" + id).remove(); }, 500); }, delay * 1000); } function createStackNotification(message, remove = true, delay = 5) { var id = crypto.randomUUID(); var size = $(".custom-stack-notifications-item").length; var calcHeight = (size * 50) + 10; if($(".custom-stack-notifications-container").length == 0) { $("body").append('
'); } if(size == 0) { calcHeight = 10; } $(".custom-stack-notifications-container").append('
' + message + '
'); $(".custom-stack-notifications-item").each(function(index) { if(index == 0) { $(this).css("bottom", "10px") } else { $(this).css("bottom", (52 * index) + 10 + "px"); } }); if(remove) { setTimeout(function() { $("#" + id).removeClass("custom-stack-notifications-open-animation"); $("#" + id).addClass("custom-stack-notifications-close-animation"); setTimeout(function() { $("#" + id).remove(); }, 500); }, delay * 1000); setTimeout(function() { if($(".custom-stack-notifications-container .custom-stack-notifications-item").length == 1) { $(".custom-stack-notifications-container").remove(); } }, (delay * 1000) + 500); } } function closeStackNotification(element) { element.parent().removeClass("custom-stack-notifications-open-animation").addClass("custom-stack-notifications-close-animation"); setTimeout(function() { element.parent().remove(); $(".custom-stack-notifications-item").each(function(index) { $(this).css("bottom", (52 * index) + 10 + "px"); }); if($(".custom-stack-notifications-container .custom-stack-notifications-item").length == 0) { $(".custom-stack-notifications-container").remove(); } }, 500); }