39

Show DN: I made a CSS3 scroll position based animation library

over 6 years ago from , Full stack developer.

Hi!

I was looking for a small library to trigger animations based on the users scroll position, e.g. for animating in blocks when they are in the viewport. But every library out there was either to big or complex, or 'jacked' the users scroll, so i wrote one.

It's based on requestAnimationFrame so the animations get triggered when the browser is ready for it, and not when the user scrolls. That way the user/browser keeps their original scroll behaviour.

It triggers CSS classes so the animation possibilities are (almost) endless. And you can write animations in the language that you are used to.

Demo: https://terwanerik.github.io/ScrollTrigger

Source: https://github.com/terwanerik/ScrollTrigger

Let me know what you think!

Cheers,

Erik

27 comments