April 13, 2015

Fire style loader

Fire style loader

Another page loader here, using purely css and no images used.

HTML

<div id='loader'>
  <div class='diamond'></div>
  <div class='diamond'></div>
  <div class='diamond'></div>
</div>

CSS

body {
  background: black;
}

#loader {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 120px;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-flow: column nowrap;
      -ms-flex-flow: column nowrap;
          flex-flow: column nowrap;
  -webkit-transform: translate(-50%, -50%);
      -ms-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
}
#loader .diamond {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 2px;
  background: #fff;
  -webkit-transform: translateY(0) rotate(45deg) scale(0);
      -ms-transform: translateY(0) rotate(45deg) scale(0);
          transform: translateY(0) rotate(45deg) scale(0);
  -webkit-animation: diamonds 1800ms linear infinite;
          animation: diamonds 1800ms linear infinite;
}
#loader .diamond:nth-child(1) {
  -webkit-animation-delay: -1200ms;
          animation-delay: -1200ms;
}
#loader .diamond:nth-child(2) {
  -webkit-animation-delay: -2400ms;
          animation-delay: -2400ms;
}
#loader .diamond:nth-child(3) {
  -webkit-animation-delay: -3600ms;
          animation-delay: -3600ms;
}
#loader .diamond:nth-child(4) {
  -webkit-animation-delay: -4800ms;
          animation-delay: -4800ms;
}

@-webkit-keyframes diamonds {
  50% {
    -webkit-transform: translateY(-50px) rotate(45deg) scale(1);
            transform: translateY(-50px) rotate(45deg) scale(1);
  }
  100% {
    -webkit-transform: translateY(-100px) rotate(45deg) scale(0);
            transform: translateY(-100px) rotate(45deg) scale(0);
  }
}

@keyframes diamonds {
  50% {
    -webkit-transform: translateY(-50px) rotate(45deg) scale(1);
            transform: translateY(-50px) rotate(45deg) scale(1);
  }
  100% {
    -webkit-transform: translateY(-100px) rotate(45deg) scale(0);
            transform: translateY(-100px) rotate(45deg) scale(0);
  }
}
demo

No comments:

Post a Comment

Popular Posts

Views