LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
CSS
* {
  margin: 0;
  padding: 0;
}

.loading-simulator {
  position: fixed;
  width: 100%;
  height: 100%;
  background: white;
}
.loading-simulator::before {
  content: "";
  display: block;
  position: absolute;
  width: 45%;
  height: 100%;
  left: -25%;
  -webkit-animation: 1.5s linear 0s normal infinite horizontalScan;
          animation: 1.5s linear 0s normal infinite horizontalScan;
}
.loading-simulator-header {
  background-color: lightgray;
  height: 80px;
}
.loading-simulator-content {
  margin: 30px auto 0;
  width: calc(100% - 60px);
}
@media (min-width: 769px) {
  .loading-simulator-content {
    width: 750px;
  }
}
@media (min-width: 992px) {
  .loading-simulator-content {
    width: 970px;
  }
}
@media (min-width: 1200px) {
  .loading-simulator-content {
    width: 1170px;
  }
}
.loading-simulator-content > div:first-child {
  width: 95%;
}
.loading-simulator-content > div:last-child {
  width: 98%;
}
.loading-simulator-content > div::before, .loading-simulator-content > div::after {
  content: "";
  display: block;
  font-size: 1rem;
  height: 1rem;
  background-color: lightgray;
  margin-bottom: 1.4em;
}
.loading-simulator-content > div::before {
  width: 80%;
}
.loading-simulator-content > div::after {
  width: 95%;
}

@keyframes horizontalScan {
  0% {
    left: -45%;
  }
  50% {
    left: 50%;
  }
  100% {
    left: 145%;
  }
}
@-webkit-keyframes horizontalScan {
  0% {
    left: -45%;
  }
  50% {
    left: 50%;
  }
  100% {
    left: 145%;
  }
}

Description

Inspired on the Facebook Content Loading Animation. The technique is about Perceived Performance (how fast something feels for the user).
Term
Sat, 04/14/2018 - 20:45

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv