Rotating Loading Animation (Pure CSS)
I used 2 different keyframes to rotate the squares on the X and Y axes.
Originally posted with another account.
<div id="square">
<div id="square">
<div id="text"> Loading... </div>
</div>
<div id="square2">
</div>
<div id="square3">
</div>
<div id="square4">
</div>
<div id="square5">
</div>
<div id="square6">
</div>
<div id="square7">
</div>
<div id="square8">
</div>
<div id="square9">
</div>
#text {
#text {
font-family:"Avenir";
color:LightCoral;
padding-left:27%;
padding-top:40%;
}
#square {
position:absolute;
margin-left:250px;
margin-top:200px;
width: 150px;
height: 150px;
background: lightblue;
animation: rotate1 5s;
animation: rotate1 5s;
animation-iteration-count:infinite;
animation-iteration-count:infinite;
animation-direction:alternate;
animation-direction:alternate;
transform-origin: 50% 50%;
}
#square2 {
position:absolute;
margin-left:100px;
margin-top:50px;
width: 150px;
height: 150px;
background: lightblue;
animation: rotate1 5s;
animation: rotate1 5s;
animation-iteration-count:infinite;
animation-iteration-count:infinite;
animation-direction:alternate;
animation-direction:alternate;
transform-origin: 50% 50%;
}
#square3 {
position:absolute;
margin-left:400px;
margin-top:50px;
width: 150px;
height: 150px;
background: lightblue;
animation: rotate1 5s;
animation: rotate1 5s;
animation-iteration-count:infinite;
animation-iteration-count:infinite;
animation-direction:alternate;
animation-direction:alternate;
transform-origin: 50% 50%;
}
#square8 {
position:absolute;
margin-left:400px;
margin-top:350px;
width: 150px;
height: 150px;
background: lightblue;
animation: rotate1 5s;
animation: rotate1 5s;
animation-iteration-count:infinite;
animation-iteration-count:infinite;
animation-direction:alternate;
animation-direction:alternate;
transform-origin: 50% 50%;
}
#square9 {
position:absolute;
margin-left:100px;
margin-top:350px;
width: 150px;
height: 150px;
background: lightblue;
animation: rotate1 5s;
animation: rotate1 5s;
animation-iteration-count:infinite;
animation-iteration-count:infinite;
animation-direction:alternate;
animation-direction:alternate;
transform-origin: 50% 50%;
}
@-webkit-keyframes rotate1 {
from {
transform: rotateX(0deg) rotateY(0deg);
}
to{
transform: rotateX(360deg) rotateY(360deg);
}
}
@keyframes rotate1 {
from {
transform: rotateX(0deg) rotateY(0deg);
}
to{
transform: rotateX(360deg) rotateY(360deg);
}
}
/*MARROON */
#square4 {
position:absolute;
margin-left:250px;
margin-top:50px;
width: 150px;
height: 150px;
background: LightCoral;
animation: rotate2 5s;
animation: rotate2 5s;
animation-iteration-count:infinite;
animation-iteration-count:infinite;
animation-direction:alternate;
animation-direction:alternate;
transform-origin: 50% 50%;
}
#square5 {
position:absolute;
margin-left:100px;
margin-top:200px;
width: 150px;
height: 150px;
background: LightCoral;
animation: rotate2 5s;
animation: rotate2 5s;
animation-iteration-count:infinite;
animation-iteration-count:infinite;
animation-direction:alternate;
animation-direction:alternate;
transform-origin: 50% 50%;
}
#square6 {
position:absolute;
margin-left:400px;
margin-top:200px;
width: 150px;
height: 150px;
background: LightCoral;
animation: rotate2 5s;
animation: rotate2 5s;
animation-iteration-count:infinite;
animation-iteration-count:infinite;
animation-direction:alternate;
animation-direction:alternate;
transform-origin: 50% 50%;
}
#square7 {
position:absolute;
margin-left:250px;
margin-top:350px;
width: 150px;
height: 150px;
background: LightCoral;
animation: rotate2 5s;
animation: rotate2 5s;
animation-iteration-count:infinite;
animation-iteration-count:infinite;
animation-direction:alternate;
animation-direction:alternate;
transform-origin: 50% 50%;
}
@-webkit-keyframes rotate2 {
from {
transform: rotateY(0deg) rotateX(360deg);
}
to{
transform: rotateY(360deg) rotateX(0deg);
}
}
@keyframes rotate2 {
from {
transform: rotateY(0deg) rotateX(360deg);
}
to{
transform: rotateY(360deg) rotateX(0deg);
}
}