CSS RGB Shift

by Jens Kühn

HTML

<h1 class="hero-title">
Title
</h1>

CSS

.hero-title {
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
  transform: translateY(-50%);
  -webkit-animation: animate--rgbShift 2s infinite alternate;
  -o-animation: animate--rgbShift 2s infinite alternate;
  animation: animate--rgbShift 2s infinite alternate;
  position: absolute;
  top: 43%;
  z-index: 2;
  width: 100%;
  margin: 0;
  font-size: 120px;
  font-weight: bold;
  color: #fff;
  text-align: center;
}

@-webkit-keyframes animate--rgbShift {
  0% {
    -webkit-transform: rotate(0deg);
    text-shadow: 5px 10px 0 #f5f5f1;
    opacity: 1
  }
  6% {
    -webkit-transform: rotate(0.5deg) scale(1.01);
    text-shadow: 1px 1px 0 rgba(255, 0, 0, 0.5), -5px -2px 0 rgba(0, 255, 0, 0.5), -2px 4px 0 rgba(0, 0, 255, 0.5);
    opacity: 1
  }
  10% {
    -webkit-transform: rotate(0deg);
    text-shadow: 8px -2px 0 rgba(255, 0, 0, 0.5), -5px -2px 0 rgba(0, 255, 0, 0.5), 2px -2px 0 rgba(0, 0, 255, 0.5);
    opacity: .6
  }
  12% {
    text-shadow: none;
    opacity: 1
  }
  58% {
    -webkit-transform: rotate(0deg);
    text-shadow: none;
    opacity: 1
  }
  59% {
    text-shadow: -5px -8px 0 #f5f5f1;
    opacity: .6
  }
  62% {
    -webkit-transform: rotate(-0.5deg) scale(1.01);
    text-shadow: 8px -2px 0 rgba(255, 0, 0, 0.5), -5px -2px 0 rgba(0, 255, 0, 0.5), 2px -2px 0 rgba(0, 0, 255, 0.5);
    opacity: 1
  }
  64% {
    -webkit-transform: rotate(-0.75deg) scale(1.01)
  }
  67% {
    -webkit-transform: rotate(0deg);
    text-shadow: none
  }
  100% {
    -webkit-transform: rotate(0deg)
  }
}

@-moz-keyframes animate--rgbShift {
  0% {
    -moz-transform: rotate(0deg);
    text-shadow: 5px 10px 0 #f5f5f1;
    opacity: 1
  }
  6% {
    -moz-transform: rotate(0.5deg) scale(1.01);
    text-shadow: 1px 1px 0 rgba(255, 0, 0, 0.5), -5px -2px 0 rgba(0, 255, 0, 0.5), -2px 4px 0 rgba(0, 0, 255, 0.5);
    opacity: 1
  }
  10% {
    -moz-transform: rotate(0deg);
   ...