mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-29 08:19:13 -04:00
Build 29068563
This commit is contained in:
parent
6ef13f2d19
commit
df8bfbb350
25 changed files with 384 additions and 336 deletions
25
src/toast.ts
25
src/toast.ts
|
@ -1,8 +1,17 @@
|
|||
export function toast(html){
|
||||
const div =document.createElement('div')
|
||||
div.classList='toast'
|
||||
div.innerHTML=html
|
||||
document.body.appendChild(div)
|
||||
// TOast
|
||||
// setTimeout(()=>div.remove() , 500 )
|
||||
}
|
||||
let onScreen = 0;
|
||||
|
||||
export function toast(html) {
|
||||
const div = document.createElement("div");
|
||||
div.classList = "toast";
|
||||
div.innerHTML = html;
|
||||
const lasts = 1500 + onScreen * 200;
|
||||
div.style.animationDuration = lasts + "ms";
|
||||
div.style.top = 40 + onScreen * 50 + "px";
|
||||
|
||||
document.body.appendChild(div);
|
||||
onScreen++;
|
||||
setTimeout(() => {
|
||||
div.remove();
|
||||
onScreen--;
|
||||
}, lasts);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue