<div class='button slider slide-in'></div>
div {
  height: 100px;
  width: 100px;
  background-color: red;
}

/* Transition */
.button {
  transition: background-color 0.6s ease;
}

/* Animation */
@keyframes slide-in {
  from {
    transform: translateX(-80%);
  }
  to {
    transform: translateX(1);
  }
}
.slider {
  animation: slide-in 5s 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.