feat: add fade up animation to post page, optimize global animation curves and durations, refine animation-related naming conventions

This commit is contained in:
radishzzz 2025-05-17 20:18:41 +01:00
parent d4ea4c470b
commit a35999629a
14 changed files with 122 additions and 52 deletions

View file

@ -0,0 +1,18 @@
<script>
function resetFadeUpAnimation() {
document.querySelectorAll('.animation-fade-up').forEach((container) => {
const childElements = Array.from(container.children).slice(0, 20)
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>