perf: update gsap animation logic on mobile

This commit is contained in:
radishzzz 2025-05-26 12:17:42 +01:00
parent f7ac92fd75
commit 65929b43bc

View file

@ -90,8 +90,8 @@ function setupPostPageAnimation() {
} }
else { else {
// Post Content + Tags + Comments // Post Content + Tags + Comments
// First 7 elements // First 5 elements
gsap.to(allElements.slice(0, 7), { gsap.to(allElements.slice(0, 5), {
opacity: 1, opacity: 1,
y: 0, y: 0,
duration: 0.5, duration: 0.5,
@ -99,13 +99,13 @@ function setupPostPageAnimation() {
ease: 'power2.out', ease: 'power2.out',
stagger: 0.05, stagger: 0.05,
}) })
// Rest elements as the 8th element // Rest elements as the 6th element
if (allElements.length > 7) { if (allElements.length > 5) {
gsap.to(allElements.slice(7), { gsap.to(allElements.slice(5), {
opacity: 1, opacity: 1,
y: 0, y: 0,
duration: 0.5, duration: 0.5,
delay: 0.2 + 0.05 * 7, delay: 0.2 + 0.05 * 5,
ease: 'power2.out', ease: 'power2.out',
}) })
} }