613 Views
If you’re used to animating with CSS, Velocity.js feels like cheating. Like so many, we had long since given up jQuery animations for CSS transitions (when we were lucky) and keyframes (when we weren’t). We hacked in setTimeouts that added animation-triggering classes post-render, we took care not to get flummoxed by bubbling “animationEnd” events, and we animated max-height instead of height, hoping we never had more than 9999px of text to show. We did it because it was performant. Hardware-accelerated or whatever. It was a pain, but isn’t good performance supposed to be a pain? Eventually, the level of effort became self-justifying, and the conventional wisdom around animation took hold: “jQuery (and by extension, JavaScript) might be easy, but it’s too slow. CSS is hard and fast.” And we were proud to take the hard route.