close

DEV Community

Amr kilany
Amr kilany

Posted on

make css animation without leaving your html

Stop jumping back and forth between files! โœ‹ Why write 20 lines of CSS when you can just type one word? Butterfly CSS v4 is the ultimate "fast-typing" framework designed for creators who want to build beautiful, moving websites without ever leaving their HTML.

๐Ÿ“ฆ Quick Start: The 2-Second Install โšก
To unlock the magic, just paste these two lines into the

of your HTML file. No NPM, no terminal, no headache.

                    <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/AMR2010M/butterfly-css@latest/butterflycss.css">
<script src="https://cdn.jsdelivr.net/gh/AMR2010M/butterfly-css@latest/df.js"></script>
                    <script src="https://cdn.jsdelivr.net/gh/AMR2010M/butterfly-css@latest/vf.js"></script>

Enter fullscreen mode Exit fullscreen mode

๐ŸŒช๏ธ Standard Motion Attributes
These are your "Always-On" animations. Just add the word, and the element moves forever!

spin ๐ŸŒ: A smooth, continuous 360ยฐ rotation.

bounce โšฝ: A classic vertical jumping motion.

pulse ๐Ÿ’—: A rhythmic grow and fade (heartbeat style).

swing ๐Ÿงน: A playful side-to-side pendulum wiggle.

flip ๐Ÿƒ: Flips the element horizontally in a loop.

shake ๐Ÿ˜ตโ€๐Ÿ’ซ: A rapid horizontal vibration (perfect for errors).

grow ๐Ÿฃ: Continuous scaling up and back.

shrink ๐Ÿ›ฐ๏ธ: Continuous scaling down and back.

slide-x ๐Ÿ›’: Slides left and right horizontally.

slide-y ๐ŸŽˆ: Slides up and down vertically.

๐Ÿ”ฎ Floating Ball Particles (ball-move-X)
These create glowing, magical orbs that drift across the element.
(Note: Set the parent to position: relative and overflow: hidden for these to work!)

ball-move-1 ๐ŸŽพ: The standard glowing orb path.

ball-move-2 ๐ŸฅŽ: A different, slightly faster floating path.

ball-move-3 ๐ŸŒ•: A larger, more visible glowing ball.

ball-move-4 ๐ŸŽพ: Small, high-speed "kinetic" energy orb.

ball-move-5 ๐Ÿช: A giant, slow-drifting atmospheric orb.

โœจ Special & Artistic Effects
These change the actual "vibe" and texture of your elements.

butterfly="fly" ๐Ÿฆ‹: The signature move! Makes the element follow a complex, organic flight path like a real butterfly.

handdrawn โœ๏ธ: Uses an SVG filter to make borders and text look like a shaky, living sketch.

birthday-paper ๐ŸŽŠ: Creates a "Confetti Rain" effect over the element.

blur ๐ŸŒซ๏ธ: Constant 2px soft-focus filter.

๐Ÿงฌ The Morph & Shape Engine
Turn any element into a geometric shape instantly, or make it transform on hover!

Geometric Clips:
circle, triangle, star, heart, hexagon, diamond, home, message, trapezoid, x, square, rectangle, ellipse, parallelogram.

The Morph Trick:
Use morph-hover="shape-name" to transition from one to another!

why butterfly?

๐ŸŽ‰ Join the Butterfly Disco Challenge!
Ready to become a CSS wizard without any CSS? ๐Ÿง™โ€โ™‚๏ธ

We want you to design a Digital Birthday Card using these tools. Use birthday-paper for the party atmosphere, butterfly="fly" for the magic, and handrawn to surprise your friends!

Join the Butterfly Disco Challenge for making a birthday card today and let's see your HTML dance! ๐Ÿฆ‹โœจ๐ŸŽˆ
see how magic is built
or see examples
take a look at earth pro (have a happier planet for pest price):

Top comments (0)