MENU

Fun & Interesting

Responsive & Accessible Animation with gsap.matchMedia()

GSAP Learning 42,197 lượt xem 2 years ago
Video Not Working? Fix It Now

In this video we'll walk through the new gsap.matchMedia() and create some responsive and accessible animation! 🥳

gsap.matchMedia() lets you tuck setup code into a function that only executes when a particular media query matches and then when it no longer matches, all the GSAP animations and ScrollTriggers created during that function's execution get reverted automatically! Customizing for mobile/desktop or prefers-reduced-motion accessibility is remarkably simple.

Docs - https://greensock.com/docs/v3/GSAP/gsap.matchMedia()
Demos - https://codepen.io/collection/vBebgJ

Comment