liveBook · Manning

Timing function

As explained in Math for Web Design

A function that maps elapsed animation time to progression through an animation.

A timing function maps elapsed animation time to progress through a change. Instead of moving at a constant rate, it controls acceleration and deceleration so motion feels natural rather than mechanical. section 11.2.3 section 1.2.2

CSS supplies predefined keywords for common cubic Bézier curves:

  • linear keeps the rate constant from start to finish. section 11.2.3
  • ease starts gently, reaches higher velocity near the middle, and decelerates toward the end. section 11.2.3
  • ease-in changes slowly at first and accelerates near the end. section 11.2.3
  • ease-out changes quickly at first and settles gradually. section 11.2.3
  • ease-in-out combines gentle starts and finishes with faster movement through the middle. section 11.2.3

The cubic-bezier() function exposes the curve directly through four control-point values. Those numbers determine how quickly the animated property progresses between its starting and ending values. section 11.2 section 11.2.3

Animating a mobile menu

A menu button can toggle an open class while CSS applies an easing transition: nav elements use a transform transition with a one-second ease function. The JavaScript changes state; the timing function shapes how the menu enters or leaves the screen.

How Math for Web Design covers it

How deep it goes
Explains easing behavior, keyword meanings, and cubic-bezier() syntax, but stops short of deriving the curve mathematically.
Examples
Uses linear, ease, ease-in, ease-out, ease-in-out, a mobile menu, and custom cubic-bezier() declarations.
What it assumes
Assumes basic CSS animation or transition syntax and introduces the needed curve concepts through UI examples.
What you can do after
Apply it via CSS keywords or cubic-bezier() to control acceleration and deceleration in interface animations.
How it connects
Links animation, CSS transitions, easing curves, and cubic Bézier curves.

Also explained in

Compare how 2 books explain timing function →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Math for Web Design. The section links point to the parts of the book it draws on.