mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-15 19:22:52 +02:00
perf: update gsap animation logic on mobile
This commit is contained in:
parent
f7ac92fd75
commit
65929b43bc
1 changed files with 6 additions and 6 deletions
|
@ -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',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue