تماشای این درس نیاز به اشتراک حرفه‌ای دارد.

Overview of Animation Libraries0:00

There are many, many tools out there that can help you take your web animations to the next level. We are not going to cover all of them, but let's go on the little tour and take a look at some of the most popular JavaScript libraries in the field. Now, before we do, let me remind you that if you use a JavaScript animation library, you are going to make a trade-off in terms of, well,

Power vs Performance Trade-offs0:23

that if you use a JavaScript animation library, you are going to make a trade-off in terms of, well, you're going to have more power to make better animations, but the trade-off is the footprint that you leave. You're going to send more codes to the browser, and the performance might be affected. Remember when we were talking about GPU accelerated animation properties like transform or opacity in contrast with the CPU uh, driven animations? Well, typically with JavaScript animation libraries,

CPU vs GPU Animation Costs0:46

or opacity in contrast with the CPU uh, driven animations? Well, typically with JavaScript animation libraries, there's an increasing chance that animation will be performed on the CPU and uh, might struggle a bit during intensive tasks. One important thing that I forgot to mention while we were talking about the web animations API is that despite being authored with JavaScript, the wapi that is the web animations API has the luxury to make the work on what's called the compositor thread

Web Animations API Threads1:09

that is the web animations API has the luxury to make the work on what's called the compositor thread instead of the main thread. So the browser's main thread is where the layouts, the paints, the JavaScript execution happens, but somehow the Web Animations API is able to offload its work to the compositor thread, which means that animation might very well be GPU accelerated and battery smooth. In other words, even if you use JavaScript

and battery smooth. In other words, even if you use JavaScript to write animations, they might be performing as good as CSS animations, thanks to the web animations API, just make sure you keep that in mind as we explore a few animation libraries out there.

دوست دارید گاهی خبرهای Laracasts را ایمیل کنیم؟