Design

Crafting easing curves for user interfaces

View all posts

Since the introduction of flat design, the quality of animation has never been more essential for creating great interfaces. Through motion design, you can influence the overall brand experience of a product and set it apart from the market. Animation can simplify complex interactions and turn good designs into memorable user experiences.

But how do you create quality animation? With easing curves, you can take a decent animation and make it fantastic.

“With easing curves, you can take a decent animation and make it fantastic.”

The problem is that understanding how easing curves work can be confusing. I hope to clear that up through this post, which stems from the interest in timing functions from an article I wrote about After Effects to CSS. People wanted a better understanding about how easing curves work and how to design your own.

An easing curve is a line that defines the acceleration pattern on a graph. Easing curves are commonly referred by many other names such as motion curves, timing functions, bezier curves, or just curves. The different shapes of easing curves also have keywords like ease in, ease out, or ease in out.

How easing curves work

Easing curves are created via an X,Y axis. The meanings of the X and the Y can vary from application to application. Within development, the meaning of the X and the Y states stays pretty consistent. It’s defined as Percent of Animation(Y) over Time(X).

curves-01

So what does this easing curve look like when put into practice? That’s where the concepts of timing and spacing come into play.

Timing and spacing

Timing is the duration for an animation to finish. Spacing is the space between each “frame,” but in our case it’s the space between each percent of animation. Below I’ve shown how this spacing relates to an easing curve. Think of vertical = fast and horizontal = slow.

Linear ease spacing

curves

Within linear easing, the space the dot travels is equidistant across the length of the animation. (View on CodePen)

Ease-in spacing

curves-2

With ease-in spacing, the spacing of the dot is more condensed in the beginning and expands as the animation continues, giving the illusion of starting slow and speeding up. (View on CodePen)

Ease-out spacing

ease-out

With ease-out spacing, the spacing of the dot starts large and condenses in the end, giving the illusion of starting fast and slowing down. (View on CodePen)

Designing an easing curve

curves-3

People always ask me, “What easing curve do I use and when?”

Well, it really depends on the scenario.

There isn’t one easing curve that works for absolutely everything. Crafting easing curves is a key component of designing motion. Easing curves are commonly designed after physics within the real world, but they don’t always follow those rules.

“When crafting an easing curve, keep in mind that vertical is fast and horizontal is slow.”

The real world is a great place to gain inspiration for animation. For example, no object in the real world starts at full velocity and immediately stops like a linear easing curve does. Objects always have some kind of acceleration or deceleration. This is just one of the many concepts Disney outlines in the 12 Principles of Animation, which is largely based on physics and the exaggeration of physics.

When crafting an easing curve, keep in mind that vertical is fast and horizontal is slow. The curve you create should be dependent on the interaction you’re designing. You can create many different types of curves within the (X,Y) grid.

And when you’re crafting curves within the frame, it’s possible to break the frame! Breaking the frame will cause the animation to go outside of the values in between the keyframes. Breaking the frame can create bounce or anticipation effects.

curves-4

There are many tools for creating cubic beziers on the web. Here are a few:

Easing curves within development

Easing curves within development are called timing functions—they’re mathematical equations that create a bezier curve that defines the acceleration pattern on a graph. The function that is commonly used within development is the cubic bezier.

curves-5

Within most programming languages, there are some predefined easing curves like ease in, ease out, and ease in out. Be sure to check the documentation to see which curves are predefined. Below I listed the easing curves that are predefined within CSS:

  • ease-in = cubic-bezier(.42, 0, 1, 1)
  • ease-out = cubic-bezier(0, 0, .58, 1)
  • ease-in-out = cubic-bezier(.42, 0, .58, 1)

Defining easing curves in CSS

Global

In CSS there’s the “global” ease that can be defined in the object class. This applies the same ease to every keyframe. For example, if you have a bounce, the animation will bounce at every keyframe.

curves-6 curvecode-1

Per keyframe
You can get more precise with eases by defining them within keyframes. Keep in mind that the easing curve is defined in the percentage value before you want the ease to happen.

curves-7 curvecode-2

Curved delays
The concept of easing curves doesn’t just apply to a single animation—you can apply it to delays, too. And that can be really fun when there are many elements animating on the screen. Here’s an example of a sine wave delay. I made this by creating a sass loop and using compass math helpers to calculate sine.

curves-8 curvecode3

Now that you have a clearer picture of how easing curves work, how will you use them to create great user interfaces?

This post was originally published on Medium.

Author

Ryan Brownhill, Product Designer at Facebook
Hi, I am Ryan Brownhill! I am a born and raised Texan, currently working in San Francisco as a Product Designer at Facebook. Previously, I was at IBM Design working on The IBM Motion Design Language, and Watson. I am an alumni from the Savannah College of Art and Design. There I studied Motion Media Design with emphasis in Interaction and Service Design.

Join over 3 million designers

Who get our content first.

No sales pitches, no games, and one-click unsubscribe.

Over 3 million designers
get our newsletter
every week

Find out why

Get awesome design content in your inbox every week

Just like over 3 million of your fellow designers do.

Plus get 3 free downloads, just for signing up.

Give it a try—it only takes a click to unsubscribe.

Thanks for signing up!

You should have a thank you gift in your inbox now—and you'll hear from us again soon!

Prototype better experiences with InVision

Just like over 3 million of your fellow designers do.

I agree to InVision's Terms of Service.

Want a free t-shirt?

Join the 3 million+ designers who get our newsletter weekly for your chance to win!

We hate spam as much as you do, and you can unsubscribe anytime.

Double your chances to win!

Tweet and automatically get a second entry

Tweet Now

No Thanks

Stay in touch!

We share news, freebies, and more on Twitter.