Added stylish mountable effect

This commit is contained in:
2017-06-20 20:13:04 +02:00
parent 540ce452fc
commit b09d3027de
14 changed files with 81 additions and 32 deletions

View File

@ -32,6 +32,7 @@ export class AnimeNotifier {
}
onContentLoaded() {
this.updateMountables()
this.updateAvatars()
for(let element of findAll(".action")) {
@ -73,6 +74,25 @@ export class AnimeNotifier {
}
}
updateMountables() {
const delay = 20
const maxDelay = 1000
let time = 0
for(let element of findAll(".mountable")) {
setTimeout(() => {
window.requestAnimationFrame(() => element.classList.add("mounted"))
}, time)
time += delay
if(time > maxDelay) {
time = maxDelay
}
}
}
// onResize(e: UIEvent) {
// let hasScrollbar = this.app.content.clientHeight === this.app.content.scrollHeight