mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-29 08:19:13 -04:00
Build 29079087
This commit is contained in:
parent
06843047d2
commit
8e4e67e33b
17 changed files with 199 additions and 234 deletions
20
src/toast.ts
20
src/toast.ts
|
@ -1,17 +1,15 @@
|
|||
|
||||
|
||||
let div= document.createElement("div");
|
||||
div.classList = 'hidden toast';
|
||||
document.body.appendChild(div);
|
||||
let timeout: NodeJS.Timeout|undefined;
|
||||
let div = document.createElement("div");
|
||||
div.classList = "hidden toast";
|
||||
document.body.appendChild(div);
|
||||
let timeout: NodeJS.Timeout | undefined;
|
||||
export function toast(html) {
|
||||
div.classList = "toast visible";
|
||||
div.innerHTML = html;
|
||||
if(timeout) {
|
||||
clearTimeout(timeout)
|
||||
if (timeout) {
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
timeout=setTimeout(() => {
|
||||
timeout=undefined
|
||||
div.classList = 'hidden toast';
|
||||
timeout = setTimeout(() => {
|
||||
timeout = undefined;
|
||||
div.classList = "hidden toast";
|
||||
}, 1500);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue