Animations make websites and apps fun and easy to use. They make apps feel alive, like when a button changes colour when clicked with some transition effect.
Imagine when you scroll on a website, cool animations pop up to show you where to look next, like arrows pointing the way or texts fading in.
It's like a fun adventure guiding you through the website!
They help things move smoothly, catch attention, and guide users.
JavaScript libraries like GSAP make adding these animations easy for developers, making websites more enjoyable.
0οΈβ£ GreenSock Animation Platform (GSAP)
A robust JavaScript library for crafting high-performance animations.
β© https://greensock.com/gsap/
1οΈβ£ Anime.js
A lightweight JavaScript animation library with a simple, yet powerful API.
β© https://animejs.com
2οΈβ£ Velocity.js
An animation engine with the same API as jQueryβs $.animate(), offering colour animation, transforms, loops, easings, SVG support, and scrolling.
β© http://velocityjs.org
3οΈβ£ Lottie
A JSON-based file format for high-quality animations, designed for cross-platform use, and easy implementation.
β© https://airbnb.design/lottie/
4οΈβ£ ScrollMagic
A JavaScript library for creating scroll interactions, offering easy customizability and extendability.
β© http://scrollmagic.io
5οΈβ£ Three.js
A JavaScript library for creating and displaying animated 3D graphics in web browsers using WebGL.
β© https://threejs.org
6οΈβ£ Popmotion
A functional JavaScript motion library allows developers to animate in any JavaScript environment.
β© https://popmotion.io
7οΈβ£ Mo.js
A JavaScript motion graphics library offering a different syntax and code animation structure approach.
β© https://mojs.github.io
8οΈβ£ Typed.js
A JavaScript library that types out sentences at a set speed, backspaces what's typed, and begins a new sentence.
β© https://mattboldt.com/demos/typed-js/
9οΈβ£ AniJS
A library that helps you raise your web design without coding, providing an easier way to manage animations
β© http://anijs.github.io
π Framer Motion
β© https://framer.com/api/motion/
π Final Thoughts
Animation libraries like GSAP and Three.js make websites and games super cool.
They let developers make amazing things out of the box.
GSAP helps write animations, while Three.js creates stunning 3D graphics.
Example - I made a website following a tutorial from the JavaScript Mastery YouTube Channel.
It's like Apple's iPhone 15 Pro website clone but simpler.
I used GSAP to make cool animations, like texts fading in smoothly and Three.js to put a 3D model of the iPhone on the site, making it look super cool and realistic!
Check it out here: https://iphone-page-arjuncodess.vercel.app/
Tutorial link: https://www.youtube.com/watch?v=kRQbRAJ4-Fs/
Comment your thoughts about this new trend in the web dev space!
Okay, that's it for today!
Connect with me @ Linktree.
Happy Coding! π
Thanks for 25920! π€
Top comments (18)
The Web Animations API is great. Particularly with a good reactive library.
Shameless plug: rmemo + the Web Animation API allowed me to replace motion.one. With simpler event timelines. And a smaller bundle payload size (< 600B overhead).
These pages include animations with a YouTube player for < 4.5kb transferred.
brookebrodack.net/brookers
brookebrodack.net/content
How do you handle timeline with WAAPI (Web Animation API) ?
I tried to replace other lib with that, and for single aniamation the API is pretty much like anime.js, but when i wanted to do timeline I've not found a clear explanation ...
Thank you for the question. I forgot to mention. I'm managing the state of the animations in the reactive memos. I extracted a primitive called a
wanimato
...a contraction of "web animation object". Wanimato is exported in ctx-core/web_animation. The types & js implementation are exported along with ctx-core/rmemo.The min + brotli size of
wanimato__new
&memo_
is 733 B according to thesize-limit
library.An animation timeline is achieved using conditionals in the reactive memo. An animation can wait for a previous animation to finish with an
if (!previous_animation$().is_finish) return
guard. I will show two examples:In the Brookers Timeline, the wanimatos are instantiated as variables.
github.com/btakita/ui--browser--br...
h1__flyin_wanimato$
is the first step of the animation sequence.h1__bounce_wanimato$_()
waits untilh1__flyin_wanimato$
is complete before starting. Since this system is reactive, the animations are controlled by the reactive state. Parallel animation tracks can occur.In the Brooke Brodack Content Page, I use a
ctx
to aid in orchestrating the animation state...along with the YouTube Player state.Here is an interesting section that shows uses
be_
functions, which take actx
to orchestrate animations in concert with the YT_Player.github.com/btakita/ui--browser--br...
Here are the first two wanimatos from the block of code.
Amazing!
Add motion.one also
This is awesome! Thanks for mentioning!
very useful information Thank you very much for this article
Glad you liked it!
Thank you
My pleasure!
This is useful thanks, I also wrote a post on websites one can build using Next.js, you can check it here
Welcome!
Do checkout web-dev-resource.capscode.in/
Here we have listed 1000+ web tools which is very much beneficial for developers.
And do share your feedback.
This is great! Thanks for mentioning this.
Great one Arjun as always! For those who're interested in more, here's some more useful javascript animations: webcurate.co/c/javascript-animation
Thanks brother!
this was super exited...
Nice!