~/todd-fleeman/case-study — session log entry

~/CSS Micro Animations - Butterflies

started 2026-09-06 · last touched 2026-09-08
why this exists

Two butterflies, flapping. Each one is three layered SVG pieces moved only with CSS: no JavaScript animation, no library. It's a small demo of how much life you can add to a page with a few lines of motion.

built on / learned
Graphics
Learned
  • One wing, used twice. There's a single wing SVG. The left wing is the same file mirrored with scaleX(-1). Half the art, and both sides always match.
  • Flapping in 3D. Each wing rotates on the Y axis around the body's edge, so it folds toward you instead of just squishing flat. That's the difference between a flap and a wobble.
  • Re-skinning with variables. The palette is CSS custom properties. One prop swaps orange, gold, and teal for red, white, and blue, with no new art and no extra code.
  • Speed as a prop. Flap speed is a CSS variable set per instance, so two butterflies on the same page don't flap in sync like they're on the same motor
where this might go

It's not the butterflies, it's what they can be. Swap the art and colors, and it's a team mascot doing a victory flap when your side scores. A loading indicator that has some personality. A notification badge that wiggles once and settles down. A sponsor logo that comes alive for a second. For a sports site, the red, white, and blue version isn't hypothetical. It's the team-colors pitch, already built.