<html>
  <head>
    <title>CSS animation-timing-function</title>
  </head>
  <body>
    <div class="page">
      <div class="page__help">Чтобы увидеть работу примера, задержите мышку на элементом.</div>
      <div class="example-item"> 
        <p class="example-item__text">Пример использования CSS свойства <code>animation-timing-function</code> со значением <code>ease</code>:</p>
        <div class="example-item__content">
          <div class="example-item__block example-item__block--0 example-item__block--bounce"></div>
        </div>
      </div>
      <div class="example-item"> 
        <p class="example-item__text">Пример использования CSS свойства <code>animation-timing-function</code> со значением <code>ease-in</code>:</p>
        <div class="example-item__content">
          <div class="example-item__block example-item__block--1 example-item__block--bounce"></div>
        </div>
      </div>
      <div class="example-item"> 
        <p class="example-item__text">Пример использования CSS свойства <code>animation-timing-function</code> со значением <code>ease-out</code>:</p>
        <div class="example-item__content">
          <div class="example-item__block example-item__block--2 example-item__block--bounce"></div>
        </div>
      </div>
      <div class="example-item"> 
        <p class="example-item__text">Пример использования CSS свойства <code>animation-timing-function</code> со значением <code>linear</code>:</p>
        <div class="example-item__content">
          <div class="example-item__block example-item__block--3 example-item__block--bounce"></div>
        </div>
      </div>
      <div class="page__copyright">
         Пример использования свойства <a class="page__copyright-link" href="https://tuhub.ru/refs/css/animation-timing-function" target="blank">animation-timing-function в CSS</a>
      </div>
    </div>
  </body>
</html>
@keyframes bounce {
  0% {
    margin-left: 0;
  }
  100% {
    margin-left: 50%;
  }
}

.example-item__block--bounce {
  animation-name: bounce;
  animation-duration: 1.5s;
  animation-iteration-count: infinite;
  width: 50px;
  height: 50px;
  background-color: red;
  border-radius: 3px;
  animation-play-state: paused;
}

.example-item:hover .example-item__block--bounce {
  animation-play-state: running;
}

.example-item__block--0 {
  animation-timing-function: ease;
}

.example-item__block--1 {
  animation-timing-function: ease-in;
}

.example-item__block--2 {
  animation-timing-function: ease-out;
}

.example-item__block--3 {
  animation-timing-function: linear;
}

External CSS

  1. https://tuhub.ru/themes/custom/tuhub/dist/css/codepen.css

External JavaScript

This Pen doesn't use any external JavaScript resources.