Added stylish mountable effect
This commit is contained in:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user