Loading Indicators Animation in HTML & CSS


1. Loader Animation in HTML & CSS

This is the CSS part of the loader logo.





body {
  background-color: lightblue;
  font-family: 'Barlow Semi Condensed', sans-serif;
}
.all {
  display: flex;
  justify-content: space-between;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.container {
  height: 80px;
  margin: 0 8px;
  background-color: blue;
  position: relative;
}
.container .circle {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: absolute;
  left: calc(50% - 5px);
  top: 0;
}
.container .circle:nth-child(1) {
  top: 0;
  animation: anim_a 2s infinite ease-in-out;
  background-color: yellow;
}
.container .circle:nth-child(2) {
  top: calc(100% - 5px);
  transform: scale(1.5);
  animation: anim_b 2s infinite ease-in-out;
  background-color: green;
}

@keyframes anim_a {
  0% {top: 0; z-index: 50;}
  20% {transform: scale(1.5);}
  50% {top: calc(100% - 5px);}
  50.1% {z-index: 0;}
  75% {transform: scale(0.8); z-index: 0;}
  100% {top: 0; z-index: 2;}
}
@keyframes anim_b {
  0% {top: calc(100% - 5px); z-index: 1;}
  25% {transform: scale(0.8);}
  50% {top: 0;}
  50.1% {z-index: 2;}
  80% {transform: scale(1.5); z-index: 2;}
  100% {top: calc(100% - 5px); z-index: 0;}
}

.container:nth-child(2) .circle {
  animation-delay: -0.1s;
}
.container:nth-child(3) .circle {
  animation-delay: -0.2s;
}
.container:nth-child(4) .circle {
  animation-delay: -0.3s;
}
.container:nth-child(5) .circle {
  animation-delay: -0.4s;
}
.container:nth-child(6) .circle {
  animation-delay: -0.5s;
}
.container:nth-child(7) .circle {
  animation-delay: -0.6s;
}
.container:nth-child(8) .circle {
  animation-delay: -0.7s;
}
.container:nth-child(9) .circle {
  animation-delay: -0.8s;
}
.container:nth-child(10) .circle {
  animation-delay: -0.9s;
}
.container:nth-child(11) .circle {
  animation-delay: -1s;
}
.container:nth-child(12) .circle {
  animation-delay: -1.1s;
}

#link {
  bottom: 20px;
  color: #000;
  opacity: 0.6;
  display: flex;
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
#link p {font-size: 20px; margin: 0; margin-left: 5px;}
#link:hover {opacity: 1;}

Given Below is the Html part of the logo.





2. SunShine Loader




Html




CSS

body {
  background: #4cbda7;
}

ul {
  position: absolute;
	margin: auto;
	top: 0; left: 0; bottom: 0; right: 0;  
  width: 150px;
  height: 150px;
  padding: 0;
  list-style: none;
}

li {
  position: absolute;
  width: 150px ;
  height: 150px ;
  border-radius: 5px;
  background: #fad335;
  opacity: 0.8;
}

li:nth-child(2) {
  animation:         rotation1 3s infinite;  
  -o-animation:      rotation1 3s infinite;
  -moz-animation:    rotation1 3s infinite;
  -webkit-animation: rotation1 3s infinite;
}

li:nth-child(3) {
  animation:         rotation2 3s infinite;  
  -o-animation:      rotation2 3s infinite;
  -moz-animation:    rotation2 3s infinite;
  -webkit-animation: rotation2 3s infinite;
  animation-delay:         0.2s;
	-o-animation-delay:      0.2s;
	-moz-animation-delay:    0.2s;
  -webkit-animation-delay: 0.2s;
}

li:nth-child(4) {
  animation:         rotation3 3s infinite;  
  -o-animation:      rotation3 3s infinite;
  -moz-animation:    rotation3 3s infinite;
  -webkit-animation: rotation3 3s infinite;
  animation-delay:         0.4s;
	-o-animation-delay:      0.4s;
	-ms-animation-delay:     0.4s;
	-moz-animation-delay:    0.4s;
  -webkit-animation-delay: 0.4s;
}

/* first rotation */
@keyframes rotation1 {
	from     { transform:rotate(-360deg); }
  30%,60%  { transform:rotate(20deg); }
  80%      { transform:rotate(0); }
}
@-o-keyframes rotation1 {
	from     { -o-transform:rotate(-360deg); }
  30%,60%  { -o-transform:rotate(20deg); }
  80%      { -o-transform:rotate(0); }
}
@-moz-keyframes rotation1 {
	from     { -moz-transform:rotate(-360deg); }
  30%,60%  { -moz-transform:rotate(20deg); }
  80%      { -moz-transform:rotate(0); }
}
@-webkit-keyframes rotation1 {
	from     { -webkit-transform:rotate(-360deg); }
  30%,60%  { -webkit-transform:rotate(20deg); }
  80%      { -webkit-transform:rotate(0); }
}

/* second rotation */
@keyframes rotation2 {
	from     { transform:rotate(-360deg); }
  30%, 60% { transform:rotate(45deg); }
  80%      { transform:rotate(0); }
}
@-o-keyframes rotation2 {
	from     { -o-transform:rotate(-360deg); }
  30%, 60% { -o-transform:rotate(45deg); }
  80%      { -o-transform:rotate(0); }
}
@-moz-keyframes rotation2 {
	from     { -moz-transform:rotate(-360deg); }
  30%, 60% { -moz-transform:rotate(45deg); }
  80%      { -moz-transform:rotate(0); }
}
@-webkit-keyframes rotation2 {
	from     { -webkit-transform:rotate(-360deg); }
  30%, 60% { -webkit-transform:rotate(45deg); }
  80%      { -webkit-transform:rotate(0); }
}

/* third rotation */
@keyframes rotation3 {
	from    { transform:rotate(-360deg); }
  30%,60% { transform:rotate(75deg); }
  80%     { transform:rotate(0); }
}
@-o-keyframes rotation3 {
	from    { -o-transform:rotate(-360deg); }
  30%,60% { -o-transform:rotate(75deg); }
  80%     { -o-transform:rotate(0); }
}
@-moz-keyframes rotation3 {
	from    { -moz-transform:rotate(-360deg); }
  30%,60% { -moz-transform:rotate(75deg); }
  80%     { -moz-transform:rotate(0); }
}
@-webkit-keyframes rotation3 {
	from    { -webkit-transform:rotate(-360deg); }
  30%,60% { -webkit-transform:rotate(75deg); }
  80%     { -webkit-transform:rotate(0); }
}

Post a Comment

0 Comments