fix: only animate transform/opacity and remove prefixed keyframes
This commit is contained in:
@ -15,56 +15,38 @@ Clean & simple animated loading animation with CSS3. If you are worried about su
|
||||
#### CSS
|
||||
|
||||
```css
|
||||
.loader {
|
||||
.snippet-demo__Animated-loading-animation {
|
||||
text-align: center;
|
||||
}
|
||||
.loader span {
|
||||
.snippet-demo__Animated-loading-animation span {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin: 50px auto;
|
||||
background: black;
|
||||
border-radius: 50px;
|
||||
-webkit-animation: loader 0.9s infinite alternate;
|
||||
-moz-animation: loader 0.9s infinite alternate;
|
||||
animation: loader 0.9s infinite alternate;
|
||||
animation: loader 0.9s infinite alternate;
|
||||
}
|
||||
.loader span:nth-of-type(2) {
|
||||
-webkit-animation-delay: 0.3s;
|
||||
-moz-animation-delay: 0.3s;
|
||||
.snippet-demo__Animated-loading-animation span:nth-of-type(2) {
|
||||
animation-delay: 0.3s;
|
||||
animation-delay: 0.3s;
|
||||
}
|
||||
.loader span:nth-of-type(3) {
|
||||
-webkit-animation-delay: 0.6s;
|
||||
-moz-animation-delay: 0.6s;
|
||||
.snippet-demo__Animated-loading-animation span:nth-of-type(3) {
|
||||
animation-delay: 0.6s;
|
||||
animation-delay: 0.6s;
|
||||
}
|
||||
@-webkit-keyframes loader {
|
||||
@keyframes loader {
|
||||
0% {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
opacity: 0.9;
|
||||
-webkit-transform: translateY(0);
|
||||
}
|
||||
100% {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
opacity: 0.1;
|
||||
-webkit-transform: translateY(-21px);
|
||||
}
|
||||
}
|
||||
@-moz-keyframes loader {
|
||||
0% {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
opacity: 0.9;
|
||||
-moz-transform: translateY(0);
|
||||
}
|
||||
100% {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
opacity: 0.1;
|
||||
-moz-transform: translateY(-21px);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Demo
|
||||
@ -88,50 +70,32 @@ Clean & simple animated loading animation with CSS3. If you are worried about su
|
||||
.snippet-demo__Animated-loading-animation span {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin: 50px auto;
|
||||
background: black;
|
||||
border-radius: 50px;
|
||||
-webkit-animation: loader 0.9s infinite alternate;
|
||||
-moz-animation: loader 0.9s infinite alternate;
|
||||
animation: loader 0.9s infinite alternate;
|
||||
animation: loader 0.9s infinite alternate;
|
||||
}
|
||||
.snippet-demo__Animated-loading-animation span:nth-of-type(2) {
|
||||
-webkit-animation-delay: 0.3s;
|
||||
-moz-animation-delay: 0.3s;
|
||||
animation-delay: 0.3s;
|
||||
animation-delay: 0.3s;
|
||||
}
|
||||
.snippet-demo__Animated-loading-animation span:nth-of-type(3) {
|
||||
-webkit-animation-delay: 0.6s;
|
||||
-moz-animation-delay: 0.6s;
|
||||
animation-delay: 0.6s;
|
||||
animation-delay: 0.6s;
|
||||
}
|
||||
@-webkit-keyframes loader {
|
||||
@keyframes loader {
|
||||
0% {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
opacity: 0.9;
|
||||
-webkit-transform: translateY(0);
|
||||
}
|
||||
100% {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
opacity: 0.1;
|
||||
-webkit-transform: translateY(-21px);
|
||||
}
|
||||
}
|
||||
@-moz-keyframes loader {
|
||||
0% {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
opacity: 0.9;
|
||||
-moz-transform: translateY(0);
|
||||
}
|
||||
100% {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
opacity: 0.1;
|
||||
-moz-transform: translateY(-21px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
#### Explanation
|
||||
|
||||
Reference in New Issue
Block a user