This commit is contained in:
Renan LE CARO 2025-05-03 20:22:25 +02:00
parent 9e12f62b81
commit 892f800107
14 changed files with 2866 additions and 2840 deletions

View file

@ -3,16 +3,16 @@ div.classList = "hidden toast";
document.body.appendChild(div);
let timeout: NodeJS.Timeout | undefined;
export function toast(html: string, className = "") {
clearToasts()
clearToasts();
div.classList = "toast visible " + className;
div.innerHTML = html;
timeout = setTimeout(clearToasts, 1500);
}
export function clearToasts(){
export function clearToasts() {
if (timeout) {
clearTimeout(timeout);
timeout = undefined
timeout = undefined;
}
div.classList = "hidden toast";
}
div.classList = "hidden toast";
}