Created
January 9, 2019 16:18
-
-
Save MathRobin/e29b2f9e538bf41c2355b5177da354ee to your computer and use it in GitHub Desktop.
Sass loader
This file contains hidden or 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="lds-spinner"> | |
<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div> | |
</div> |
This file contains hidden or 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
/** for custom sizes, respect this schema | |
.custom { | |
width: ($top + $left) * 2; | |
height: ($top + $left) * 2; | |
div { | |
transform-origin: $top + $left $top + $left; | |
&:after { | |
top: $top; <-- important variable | |
left: $left; <-- important variable | |
width: $left * 2; | |
height: $top * 6; | |
} | |
} | |
} | |
*/ | |
.lds-spinner { | |
color: #000; | |
display: inline-block; | |
position: relative; | |
width: 42px; | |
height: 42px; | |
div { | |
transform-origin: 21px 21px; | |
animation: lds-spinner 1.2s linear infinite; | |
&:after { | |
content: " "; | |
display: block; | |
position: absolute; | |
top: 2px; | |
left: 19px; | |
width: 4px; | |
height: 12px; | |
border-radius: 20%; | |
background: #000; | |
} | |
@for $i from 0 through 11 { | |
$value: 30; | |
$unit: 0.1; | |
&:nth-child(#{$i + 1}) { | |
transform: rotate(#{$value * ($i)}deg); | |
animation-delay: -#{(1 + $unit) - ($i * $unit)}s; | |
} | |
} | |
} | |
} | |
@keyframes lds-spinner { | |
0% { | |
opacity: 1; | |
} | |
100% { | |
opacity: 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment