HTML Academy
Animation-timing-function, step 2
Animations25/31
Back to the list of tasks
  • 1. Hello, animation!
  • 2. @keyframes: storyboard
  • 3. @keyframes: from and to
  • 4. @keyframes: frame grouping
  • 5. Complex animation, step 1
  • 6. Complex animation, step 2
  • 7. Water adventure
  • 8. Animation play count: animation-iteration-count
  • 9. Animation direction: animation-direction, step 1
  • 10. Animation direction: animation-direction, step 2
  • 11. Animation delay: animation-delay, step 1
  • 12. Animation delay: animation-delay, step 2
  • 13. Animation delay: animation-delay, step 3
  • 14. Air journey
  • 15. Pre- and post-animation state: animation-fill-mode, step 1
  • 16. Pre- and post-animation state: animation-fill-mode, step 2
  • 17. Pre- and post-animation state: animation-fill-mode, step 3
  • 18. Pre- and post-animation state: animation-fill-mode, step 4
  • 19. Pre- and post-animation state: animation-fill-mode, step 5
  • 20. Launching a factory, step 1
  • 21. Launching a factory, step 2
  • 22. Stopping and starting an animation: animation-play-state
  • 23. Animation form, animation-timing-function
  • 24. Animation-timing-function, step 2
  • 25. Animation-timing-function, step 3
  • 26. Animation-timing-function, step 4
  • 27. Rocket to the launch pad, step 1
  • 28. Rocket to the launch pad, step 2
  • 29. Landing, step 1
  • 30. Landing, step 2
  • 31. Landing, step 3
Animation-timing-function, step 4
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

Animation-timing-function, step 3

So what’s really hiding behind the names of linear, ease and other functions? Fairly complex mathematics of cubic Bézier curves.

In essence, named functions ease-in, ease-out and others are aliases for a universal curve description, for example:

cubic-bezier(0, 0, 1, 1)    // this is linear
cubic-bezier(0.42, 0, 1, 1) // this is ease

In cubic-bezier(x1, y1, x2, y2), the values of x and y are the coordinates of curve points on the graph. Valid x values fall within the range of 0 to 1.

There is a great service that helps understand the functional representation of Bézier curves without having to study math books.

If you click this link, you will find an entire collection of various easing functions based on Bézier curves.

Bézier curves allow us to create any forms of animation. Let’s try!

Comments

  • index.html
  • style.css
HTML
<!DOCTYPE html> <html lang="en"> <head> <title>Animation-timing-function, step 3</title> <meta charset="utf-8"> <link rel="stylesheet" href="epoch4.css"> <link rel="stylesheet" href="style.css"> </head> <body class="technologic"> <div class="belt"> <span class="robot warrior"></span> </div> <div class="belt"> <span class="robot constructor"></span> </div> </body> </html>
CSS
.robot { animation-name: move; animation-duration: 3s; animation-fill-mode: forwards; } @keyframes move { to { left: 400px; } }

What didn’t you like in this task?

Thanks! We’ll fix everything at once!

The code has changed, click “Refresh” or turn autorun on.

You’ve gone to a different page

Click inside the mini-browser to shift the focus onto this window.

100%
Goalscompleted
0
    1. Assign an animation form cubic-bezier(0, 0, 1, 1) to the robots .robot,
    2. then replace it with cubic-bezier(0.785, 0.135, 0.15, 0.86) just for .constructor,
    3. then replace it with cubic-bezier(0.175, 0.885, 0.32, 1).

    Cookies ∙ Privacy ∙ License Agreement ∙ About ∙ Contacts ∙ © HTML Academy OÜ, 2019−2025

    VISAMastercard

    Log in

    or

    Forgot your password?

    Sign up

    Sign up

    or
    Log in

    Restore access

    Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.

    Forgot to connect your email to the profile? Email us and we’ll help.