Skip to content

Improve mobile scroll animations by disabling scrub behavior#161

Draft
Katotodan wants to merge 1 commit intomeshery-extensions:masterfrom
Katotodan:chore/gsap-animation
Draft

Improve mobile scroll animations by disabling scrub behavior#161
Katotodan wants to merge 1 commit intomeshery-extensions:masterfrom
Katotodan:chore/gsap-animation

Conversation

@Katotodan
Copy link
Contributor

Notes for Reviewers
This PR improves the user experience of scroll-based animations on mobile devices.

On touch devices, fast flick scrolling can cause large jumps in scroll position. Because many animations were configured with ScrollTrigger's scrub option, the animations were tightly linked to scroll progress and would frequently reverse or jump when the scroll direction changed slightly.

To address this, this PR introduces a responsive animation configuration:

  • Detects mobile viewports using matchMedia("(max-width: 768px)")
  • Disables scrub for ScrollTrigger animations on mobile
  • Adds toggleActions: "play none none none" so animations play once when entering the viewport

Desktop behavior remains unchanged, preserving scroll-linked animation effects.

Benefits:

  • smoother mobile UX
  • prevents animation reversal during fast scrolling
  • reduces animation jitter
  • improves performance on mobile devices

No visual changes are expected on desktop.
Use the preview link on a mobile device to view the changes

Signed commits

  • Yes, I signed my commits.

Signed-off-by: DANIEL KATOTO <katotodan@gmail.com>
@github-actions
Copy link

🚀 Preview deployment for PR #161

🌐 Preview URL: https://meshery-extensions.github.io/kanvas-site/pr-preview/pr-161/

This preview will be updated automatically when you push new commits to this PR.

@Katotodan Katotodan marked this pull request as draft March 11, 2026 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant