<div class="block">
  <div class="animation -ease-in">ease-in</div>
  <div class="animation -ease-out">ease-out</div>
  <div class="animation -ease-in-out">ease-in-out</div>
</div>
@keyframes move {
  to {
    left: calc(100% - 50px);
  }
}
div.block{
  border: 1px solid black;
  position: relative;
  height: 200px;
}
div.animation{
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid black;
  position: absolute;
  left: 0;
  font-size: 10px;
  text-align: center;
  box-sizing: border-box;
  
  /* 套用動畫效果 */
  animation-name: move;
  animation-duration: 5s;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

div.-ease-in{
  top: 10px;
  animation-timing-function: ease-in;
}
div.-ease-out{
  top: 70px;
  animation-timing-function: ease-out;
}
div.-ease-in-out{
  top: 130px;
  animation-timing-function: ease-in-out;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.