Robert Crocker

Craft obsessed developer who designs.

← All craft
2 min read
CSS TransformsFramer MotionInteractive

Transform Explorer

An interactive CSS transform visualizer with real-time controls for translation, rotation, scale, and transform-origin.

CSS Transform Explorer

Hover on the element to see smooth transitions using custom easing functions.

transform: translate(0px, 0px) rotate(0deg) scale(1);
transform-origin: center;
0px
0px
0deg
1

The Invisible Physics of Transform

CSS transforms are deceptively simple. Four properties—translate, rotate, scale, and transform-origin—yet mastering them unlocks the foundation of every meaningful UI animation.

The playground above lets you feel how these properties interact. But there's nuance worth understanding.

Transform Order Matters

Transforms are applied right-to-left. This means:

transform: translate(100px, 0) rotate(45deg) scale(1.5);

...is fundamentally different from:

transform: scale(1.5) rotate(45deg) translate(100px, 0);

In the first, the element scales, then rotates, then moves. In the second, it moves first (by 100px), then rotates around its new position, then scales from there.

Play with the controls above and watch how the element behaves differently depending on which property you adjust first.

Transform Origin: The Pivot Point

This is where things get interesting. The transform-origin property defines the point around which transformations occur. By default, it's center—but watch what happens when you change it to top left:

  • Rotation now pivots from the corner, not the center
  • Scale grows outward from that corner
  • The element feels anchored differently

This is why origin-aware animations feel more natural. When a dropdown appears, it should scale from its trigger—not from some abstract center point.

The Spring Animation

Notice how the element doesn't just snap to its new position? That's Framer Motion's spring physics at work:

transition={{
  type: "spring",
  stiffness: 300,
  damping: 30,
}}

Springs create the feeling of physical mass. The element has weight. It overshoots slightly, then settles. This is what separates mechanical UI from interfaces that feel alive.

Performance Note

All transforms here are GPU-accelerated. We're only animating transform and opacity—the two properties browsers can composite without triggering layout recalculations.

Never animate top, left, width, or height if you can avoid it. Transform can achieve the same visual result with a fraction of the performance cost.


Try hovering over the element. The subtle scale bump on hover uses the same spring physics, creating a cohesive tactile response throughout the interaction.