summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
Diffstat (limited to 'static')
-rw-r--r--static/alert-timeout.js14
-rw-r--r--static/kys-link-info.js12
2 files changed, 17 insertions, 9 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)
diff --git a/static/kys-link-info.js b/static/kys-link-info.js
index f3165b2..18a0a23 100644
--- a/static/kys-link-info.js
+++ b/static/kys-link-info.js
@@ -13,8 +13,12 @@ kysLink.onclick = () => {
setInterval( () => {
Array.from(document.getElementsByClassName('kysInfo')).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)