It still didn't work, honestly. And you had some panels off screen, like, I don't know, running some WebGL or some videos. It was actually quite tricky. And right now you have the intersection of server API, and that's super simple, because you just check if the panel is intersecting, you run the animations, and for a super easy performance gain, you can just unobserve the target. Cool.
Intersection of server. This is actually quite old. So, person in old browsers. We have animations. As I told you, every time that we intercepted one of these panels, we wanted to animate pretty much everything that was inside it, because we were really into motion design. And specifically, we were doing complex animation flows. So we wanted promise-based animations. We didn't have that. There were actually great animation libraries. There was GreenSock, which was one of my favorites at the time. But it had no promises. It was all callbacks, and it was actually quite hard when you needed to animate, I don't know, more than seven elements, and these animations were actually quite convoluted.
For animations, yeah, we created our own promise wrapper for GreenSock, which added a lot of code on top of the other code that we had. So we didn't like it, and right now you have an animate function for each HTML element. You just grab the HTML element, call .animate, pass an array of transforms that you want to do, and the most interesting thing is that this returns an animation object, and that animation object has a finished promise. You can await and await and await and await, and that's actually a promise all for if you want concurrent animations. It's super cool. It's just one line. Amazing. Web animation API. And the last thing that I'm going to talk about today is view transitions. You might have heard of it, because it's actually quite new. It's only on Chrome and Chromium. But the main thing is that just for this thing, we had to use a framework. I'm not against frameworks, but these projects were not hard to build because of the web application feature, but because of these hacks.
Comments