mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-15 19:22:52 +02:00
18 lines
534 B
Text
18 lines
534 B
Text
<script>
|
|
function resetFadeUpAnimation() {
|
|
document.querySelectorAll('.animation-fade-up').forEach((container) => {
|
|
const childElements = Array.from(container.children)
|
|
childElements.forEach(element =>
|
|
(element as HTMLElement).style.animationName = 'none',
|
|
)
|
|
requestAnimationFrame(() => {
|
|
childElements.forEach(element =>
|
|
(element as HTMLElement).style.animationName = '',
|
|
)
|
|
})
|
|
})
|
|
}
|
|
|
|
resetFadeUpAnimation()
|
|
document.addEventListener('astro:page-load', resetFadeUpAnimation)
|
|
</script>
|