Skip to main content

2 posts tagged with "matchMedia"

View All Tags

· 6 min read
Cassie Evans
Jack Doyle
  • gsap.matchMedia() is a game-changer for responsive, accessible-friendly animations.
  • gsap.context() that greatly simplifies setup and reverting of a bunch of animations/ScrollTriggers, especially for React developers!
  • You can now revert() any animation to return the targets to their original state.
  • Set lockAxis: true on an Observer to make it lock into whichever direction the user first drags

· 6 min read
Cassie Evans
Jack Doyle
  • containerAnimation - vertical scrolling can animate a container horizontally; now you can set up ScrollTriggers on that horizontal movement. It's like having nested ScrollTriggers!
  • preventOverlaps & fastScrollEnd - when you jump to a section, do you have lingering animations that overlap? These features can save the day.
  • isInViewport() - a simple way to check if an element is in the viewport
  • positionInViewport() - find out exactly where an element is in relation to the viewport
  • Directional snapping - by default, snapping will now always go in the direction that the user last scrolled. Much more intuitive! There's even a .snapDirectional() utility method.