ani.css: A CSS Animation Library
I've always loved CSS animations. There's something satisfying about bringing interfaces to life with smooth transitions and engaging effects. But repeatedly writing the same animation code for every project gets tedious. That's why I created ani.css.
It's a lightweight CSS library focused on button and text animations. Simple to use, easy to integrate, and designed to make your UI feel more dynamic with minimal effort.
The Concept
The idea was straightforward. Create a collection of pre-built CSS animations that developers could drop into any project with just a class name. No JavaScript required, no complex setup, just pure CSS doing what it does best.
I wanted the naming convention to be intuitive. Button animations are prefixed with ani-btn- followed by a letter from a to z. Text animations follow the same pattern with ani-txt-. So you have 26 button animations and 26 text animations, plus some extras.
Building the Library
The challenge was creating animations that were visually interesting but not overwhelming. Each animation needed to serve a purpose, whether it was drawing attention, indicating interactivity, or adding personality to otherwise static elements.
I experimented with different effects. Hover animations that scale, rotate, or shift elements. Text effects that create typing animations, glitch effects, or gradient transitions. Button animations that pulse, bounce, or slide.
The goal was variety without bloat. Each animation is optimized to be as lightweight as possible while still looking smooth and polished.
Distribution via CDN
Making ani.css easy to use was a priority. I published it to npm and set up jsDelivr CDN distribution. Now anyone can include the entire library with a single link tag in their HTML. No downloads, no build steps, just instant access to all the animations.
The minified version keeps the file size small, so it doesn't impact page load times. You get the full library without any performance penalty.
How It Works
Using ani.css is intentionally simple. Include the CDN link in your HTML head, then add a class to any button or text element. That's it. The element immediately gets the animation or effect associated with that class.
Want a button with a bounce animation? Add ani-btn-b. Want text with a gradient effect? Add ani-txt-a. The simplicity is the point. No configuration, no customization needed unless you want to override the defaults in your own CSS.
The Website
I built a showcase website at iamovi.github.io/ani.css where you can see all the animations in action. Each effect has a live preview so you can see exactly how it looks and behaves before using it in your project.
The website itself is minimal and focused. It's there to demonstrate the library, not to overwhelm you with documentation. The code examples are short and clear, making it easy to copy and paste into your own projects.
What I Learned
This project taught me about CSS animation performance, building reusable component libraries, npm packaging and distribution, and CDN integration. It also taught me the value of simplicity in API design. The easier something is to use, the more likely people are to actually use it.
Creating a library that "just works" requires careful thought about defaults, naming conventions, and documentation. You have to anticipate how people will want to use it and remove as much friction as possible.
Try It Yourself
The library is available on GitHub, published on npm, and accessible via CDN. Check out the showcase website to see all the animations, or just drop the CDN link into your next project and start experimenting.
It's all open source under the MIT license, so feel free to use it, modify it, or contribute improvements. Animation should be easy, and ani.css tries to make it exactly that.
Under MIT License by Ovi ren