What is animation?

Animation is the process of creating the illusion of motion and shape change by means of the rapid display of a sequence of static images that minimally differ from each other.

Description

CSS Transitions

Send Clicked button!
.button {
  display: inline-block;
  padding: .8em 1.7em 0.9em;
  border-bottom: .4em solid #006c8f;
  margin-top: 0;
  text-align: center;
  text-decoration: none;
  background-color: #008cba;
  color: #fff;
  cursor: pointer;
}
.button:hover,
.button:focus {
  color: #fff;
  background-color: #00ba62;
  border-color: #008f4b;
}
.button:active {
  margin-top: .4em;
  border-bottom-width: 0;
}
Send Clicked button!
.button {
  display: inline-block;
  padding: .8em 1.7em 0.9em;
  border-bottom: .4em solid #006c8f;
  margin-top: 0;
  text-align: center;
  text-decoration: none;
  background-color: #008cba;
  color: #fff;
  cursor: pointer;
  transition: all 300ms ease-out;
}
.button:hover,
.button:focus {
  color: #fff;
  background-color: #00ba62;
  border-color: #008f4b;
}
.button:active {
  margin-top: .4em;
  border-bottom-width: 0;
}
transition: [property] [duration] [timing-function] [delay];
            all        250ms      ease              250ms
            none       4s         ease-in           4s
            unset      2500ms     ease-out          2500ms
            inherit    etc        ease-in-out       etc
            opacity               linear
            width                 etc
            color
            etc
.tooltip {
  transition: opacity 200ms ease-in, background-color 500ms ease-in-out;
}

.footnote {
  transition-property: min-height, color;
  transition-duration: 1500ms;
  transition-timing-function: ease-out;
  transition-delay: 150ms;
}

.animate-all {
  transition: all 250ms ease-out;
}

CSS Animations

Send Clicked button!
.animated-button {
  animation-name: angry;
  animation-duration: 1500ms;
  animation-fill-mode: both;
}
@keyframes angry {
  40% {
    padding: 1.7em 1em;
    margin-left: 0;
    border: 0 solid #8f2300;
    font-size: .8em;
    border-radius: 2.2em;
    background-color: #ba2e00;
    transform: rotate(0deg);
    opacity: 1;
  }
  100% {
    margin-left: 22em;
    transform: rotate(180deg);
    opacity: 0;
  }
}
animation-name
none, arbitrary
animation-iteration-count
1, infinite, 2.5
animation-direction
normal, reverse, alternate, alternate-reverse
animation-fill-mode
none, forwards, backwards, both
animation-duration
0s, 120ms, 420ms
animation-delay
0s, 3s, 500ms
animation-timing-function
ease, ease-in, linear, cubic-bezier(0.1, 0.7, 1.0, 0.1), etc
animation-play-state
running, paused
.round-and-restless {
  [...]

  animation-name: restless;
  animation-duration: 3500ms;
  animation-iteration-count: infinite;
  animation-direction: alternate;
  animation-timing-function: ease-in-out;
}

.pause-animation {
  animation-play-state: paused;
}

@keyframes restless {
  0% {
    left: 0;
    background-color: #f00;
  }

  16.66% { background-color: #ff7f00; }
  33.33% { background-color: #ff0; }
  50%    { background-color: #0f0; }
  66.66% { background-color: #00f; }
  83.33% { background-color: #4b0082; }

  100% {
    left: 32em;
    background-color: #8f00ff;
  }
}
  • This is content

  • More lovely content

  • Guess what… content

.animated-slides {
  overflow: hidden;
  position: relative;
}
.animated-slides ul {
  width: 300%;

  animation-duration: 10000ms;
  animation-name: slide;
  animation-iteration-count: infinite;
  animation-direction: alternate;
  animation-timing-function: ease-in-out;
  animation-delay: 0;
}
.animated-slides li {
  float: left;
  width: 33.33333333%;
  padding: 1em;
}
@keyframes slide {
  0% {
    margin-left: 0;
  }
  20% {
    margin-left: 0%;
  }
  30% {
    margin-left: -100%;
  }
  70% {
    margin-left: -100%;
  }
  80% {
    margin-left: -200%;
  }
  100% {
    margin-left: -200%;
  }
}

Thank You!

slides: mcdlr.com/css-animations
more: aprend.io