Skip to content

Commit

Permalink
feat: Adding a better destroy animation (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
ribasr authored Jun 23, 2023
1 parent e1362c0 commit 29fd5ba
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,17 @@ export class Toast {
if (!el)
return

el.style.opacity = '0'
el.style.visibility = 'hidden'
el.style.transform = 'translateY(10px)'

this.stopTimer()
container.removeChild(el)
instances.delete(this)

sortToast()
setTimeout(() => {
container.removeChild(el)
instances.delete(this)
sortToast()
}, 150)
}

/**
Expand Down

0 comments on commit 29fd5ba

Please sign in to comment.