Last active
June 14, 2016 20:08
-
-
Save daphotron/a7bc0d83a11388b4331cd5cedcadb671 to your computer and use it in GitHub Desktop.
CSS loading - rotating spinner http://www.sassmeister.com/gist/a7bc0d83a11388b4331cd5cedcadb671
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="mask-overlay"> | |
<div class="animate-tipper"> | |
<div class="fa fa-spinner">y</div> | |
</div> | |
<div class="animate-spinner"> | |
<div class="fa fa-spinner">x</div> | |
</div> | |
<div class="h35"> | |
Uploading... | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.21) | |
// Compass (v1.0.3) | |
// ---- | |
//http://joshbroton.com/quick-fix-sass-mixins-for-css-keyframe-animations/ | |
@mixin animation($animate...) { | |
$max: length($animate); | |
$animations: ''; | |
@for $i from 1 through $max { | |
$animations: #{$animations + nth($animate, $i)}; | |
@if $i < $max { | |
$animations: #{$animations + ", "}; | |
} | |
} | |
-webkit-animation: $animations; | |
-moz-animation: $animations; | |
-o-animation: $animations; | |
animation: $animations; | |
} | |
@mixin keyframes($animationName) { | |
@-webkit-keyframes #{$animationName} { | |
@content; | |
} | |
@-moz-keyframes #{$animationName} { | |
@content; | |
} | |
@-o-keyframes #{$animationName} { | |
@content; | |
} | |
@keyframes #{$animationName} { | |
@content; | |
} | |
} | |
@include keyframes(tipper) { | |
0% { transform: rotate(0deg); } | |
7% { transform: rotate(5deg); } | |
45% { transform: rotate(-75deg); } | |
90% { transform: rotate(0deg); } | |
100% { transform: rotate(0deg); } | |
} | |
@include keyframes(spinner) { | |
0% { transform: rotate(0deg); } | |
100% { transform: rotate(360deg); } | |
} | |
.mask-overlay { | |
background: rgba(0,0,0,0.7); | |
color: #fff; | |
height: 100%; | |
left: 0; | |
padding: 5em; | |
position: fixed; | |
top: 0; | |
text-align: center; | |
width: 100%; | |
z-index: 100; | |
} | |
.animate-tipper { | |
font-size: 50px; | |
@include animation('tipper 3s ease-out 0s infinite'); | |
} | |
.animate-spinner { | |
font-size: 50px; | |
@include animation('spinner 3s ease-out 0s infinite'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@-webkit-keyframes tipper { | |
0% { | |
transform: rotate(0deg); | |
} | |
7% { | |
transform: rotate(5deg); | |
} | |
45% { | |
transform: rotate(-75deg); | |
} | |
90% { | |
transform: rotate(0deg); | |
} | |
100% { | |
transform: rotate(0deg); | |
} | |
} | |
@-moz-keyframes tipper { | |
0% { | |
transform: rotate(0deg); | |
} | |
7% { | |
transform: rotate(5deg); | |
} | |
45% { | |
transform: rotate(-75deg); | |
} | |
90% { | |
transform: rotate(0deg); | |
} | |
100% { | |
transform: rotate(0deg); | |
} | |
} | |
@-o-keyframes tipper { | |
0% { | |
transform: rotate(0deg); | |
} | |
7% { | |
transform: rotate(5deg); | |
} | |
45% { | |
transform: rotate(-75deg); | |
} | |
90% { | |
transform: rotate(0deg); | |
} | |
100% { | |
transform: rotate(0deg); | |
} | |
} | |
@keyframes tipper { | |
0% { | |
transform: rotate(0deg); | |
} | |
7% { | |
transform: rotate(5deg); | |
} | |
45% { | |
transform: rotate(-75deg); | |
} | |
90% { | |
transform: rotate(0deg); | |
} | |
100% { | |
transform: rotate(0deg); | |
} | |
} | |
@-webkit-keyframes spinner { | |
0% { | |
transform: rotate(0deg); | |
} | |
100% { | |
transform: rotate(360deg); | |
} | |
} | |
@-moz-keyframes spinner { | |
0% { | |
transform: rotate(0deg); | |
} | |
100% { | |
transform: rotate(360deg); | |
} | |
} | |
@-o-keyframes spinner { | |
0% { | |
transform: rotate(0deg); | |
} | |
100% { | |
transform: rotate(360deg); | |
} | |
} | |
@keyframes spinner { | |
0% { | |
transform: rotate(0deg); | |
} | |
100% { | |
transform: rotate(360deg); | |
} | |
} | |
.mask-overlay { | |
background: rgba(0, 0, 0, 0.7); | |
color: #fff; | |
height: 100%; | |
left: 0; | |
padding: 5em; | |
position: fixed; | |
top: 0; | |
text-align: center; | |
width: 100%; | |
z-index: 100; | |
} | |
.animate-tipper { | |
font-size: 50px; | |
-webkit-animation: tipper 3s ease-out 0s infinite; | |
-moz-animation: tipper 3s ease-out 0s infinite; | |
-o-animation: tipper 3s ease-out 0s infinite; | |
animation: tipper 3s ease-out 0s infinite; | |
} | |
.animate-spinner { | |
font-size: 50px; | |
-webkit-animation: spinner 3s ease-out 0s infinite; | |
-moz-animation: spinner 3s ease-out 0s infinite; | |
-o-animation: spinner 3s ease-out 0s infinite; | |
animation: spinner 3s ease-out 0s infinite; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="mask-overlay"> | |
<div class="animate-tipper"> | |
<div class="fa fa-spinner">y</div> | |
</div> | |
<div class="animate-spinner"> | |
<div class="fa fa-spinner">x</div> | |
</div> | |
<div class="h35"> | |
Uploading... | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment