freecoding.school100% FREE · NO SIGNUP
Neon DistrictISSUE #4 of 50

timing functions · ease · cubic-bezier · steps

PrismaVSJank the Janitor
Prisma saysTiming functions shape an animation’s pace: ease, linear, cubic-bezier, and steps.

The timing function is the "personality" of motion. ease starts and ends slow; linear is constant; cubic-bezier() defines a custom curve; steps() jumps in discrete frames (sprite animation). The right curve makes motion feel natural.

Power-ups you unlock

Jank the Janitor attacks — common mistakes

Boss battleCompare the same move with linear, ease, and a custom cubic-bezier.

Example code

<!doctype html><html><head><meta charset="utf-8">
<style>.b{width:40px;height:40px;background:#b388ff;margin:8px 0;transition:transform 1s}.lin{transition-timing-function:linear}.cb{transition-timing-function:cubic-bezier(.68,-0.55,.27,1.55)}body:hover .b{transform:translateX(200px)}</style></head><body style="background:#06040d;padding:20px"><div class="b lin"></div><div class="b"></div><div class="b cb"></div><p style="color:#8a82b0">hover anywhere</p></body></html>
▶ Open the interactive comic issue
‹ Transitions · Property · Duration · Timing · DelayAnimations · Keyframes · Iteration · Direction ›