Skip to content

Instantly share code, notes, and snippets.

@syahrasi
Last active December 31, 2015 14:19
Show Gist options
  • Save syahrasi/7999421 to your computer and use it in GitHub Desktop.
Save syahrasi/7999421 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Circle</title>
<style>
.spinner {
margin: 100px auto;
width: 20px;
height: 20px;
position: relative;
}
.container1 > div, .container2 > div, .container3 > div {
width: 6px;
height: 6px;
background-color: #333;
border-radius: 100%;
position: absolute;
-webkit-animation: bouncedelay 1.2s infinite ease-in-out;
-moz-animation: bouncedelay 1.2s infinite ease-in-out;
-ms-animation: bouncedelay 1.2s infinite ease-in-out;
}
.spinner .spinner-container {
position: absolute;
width: 100%;
height: 100%;
}
.container2 {
-webkit-transform: rotateZ(45deg);
-moz-transform: rotateZ(45deg);
-ms-transform: rotateZ(45deg);
}
.container3 {
-webkit-transform: rotateZ(90deg);
-moz-transform: rotateZ(90deg);
-ms-transform: rotateZ(90deg);
}
.circle1 { top: 0; left: 0; }
.circle2 { top: 0; right: 0; }
.circle3 { right: 0; bottom: 0; }
.circle4 { left: 0; bottom: 0; }
.container2 .circle1 {
-webkit-animation-delay: -1.1s;
-moz-animation-delay: -1.1s;
-ms-animation-delay: -1.1s;
}
.container3 .circle1 {
-webkit-animation-delay: -1.0s;
-moz-animation-delay: -1.0s;
-ms-animation-delay: -1.0s;
}
.container1 .circle2 {
-webkit-animation-delay: -0.9s;
-moz-animation-delay: -0.9s;
-ms-animation-delay: -0.9s;
}
.container2 .circle2 {
-webkit-animation-delay: -0.8s;
-moz-animation-delay: -0.8s;
-ms-animation-delay: -0.8s;
}
.container3 .circle2 {
-webkit-animation-delay: -0.7s;
-moz-animation-delay: -0.7s;
-ms-animation-delay: -0.7s;
}
.container1 .circle3 {
-webkit-animation-delay: -0.6s;
-moz-animation-delay: -0.6s;
-ms-animation-delay: -0.6s;
}
.container2 .circle3 {
-webkit-animation-delay: -0.5s;
-moz-animation-delay: -0.5s;
-ms-animation-delay: -0.5s;
}
.container3 .circle3 {
-webkit-animation-delay: -0.4s;
-moz-animation-delay: -0.4s;
-ms-animation-delay: -0.4s;
}
.container1 .circle4 {
-webkit-animation-delay: -0.3s;
-moz-animation-delay: -0.3s;
-ms-animation-delay: -0.3s;
}
.container2 .circle4 {
-webkit-animation-delay: -0.2s;
-moz-animation-delay: -0.2s;
-ms-animation-delay: -0.2s;
}
.container3 .circle4 {
-webkit-animation-delay: -0.1s;
-moz-animation-delay: -0.1s;
-ms-animation-delay: -0.1s;
}
@-webkit-keyframes bouncedelay {
0%, 80%, 100% { -webkit-transform: scale(0.0) }
40% { -webkit-transform: scale(1.0) }
}
@-moz-keyframes bouncedelay {
0%, 80%, 100% { -moz-transform: scale(0.0) }
40% { -moz-transform: scale(1.0) }
}
@-ms-keyframes bouncedelay {
0%, 80%, 100% { -ms-transform: scale(0.0) }
40% { -ms-transform: scale(1.0) }
}
</style>
</head>
<body>
<div class="spinner">
<div class="spinner-container container1">
<div class="circle1"></div>
<div class="circle2"></div>
<div class="circle3"></div>
<div class="circle4"></div>
</div>
<div class="spinner-container container2">
<div class="circle1"></div>
<div class="circle2"></div>
<div class="circle3"></div>
<div class="circle4"></div>
</div>
<div class="spinner-container container3">
<div class="circle1"></div>
<div class="circle2"></div>
<div class="circle3"></div>
<div class="circle4"></div>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment