diff options
Diffstat (limited to 'static/alert-timeout.js')
-rw-r--r-- | static/alert-timeout.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/static/alert-timeout.js b/static/alert-timeout.js index e20106f..b31d461 100644 --- a/static/alert-timeout.js +++ b/static/alert-timeout.js @@ -1,8 +1,12 @@ setInterval( () => { - Array.from(document.getElementsByClassName('kysAlert')).forEach( (a)=>{ + Array.from(document.getElementsByClassName('kysAlert')).forEach( (a) => { a.addEventListener('click', (event) => { event.target.remove() } ) - if (a.style.transition=="opacity 2s") a.remove() - a.style.transition="opacity 2s" - a.style.opacity=0; + if ( a.state == undefined ) a.state = 0 + if (a.state == 4) { + a.style.transition = "opacity 1s" + a.style.opacity = 0 + } + if (a.state == 5) a.remove() + a.state += 1 } ) -}, 5000) +}, 1000) |