A Pen by Maciej Jarczok on CodePen.
Last active
March 9, 2021 18:43
-
-
Save jmak/35afbb544a8f80d4be4e to your computer and use it in GitHub Desktop.
A Pen by Maciej Jarczok.
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
.overlay | |
.spinner.center | |
- for (var i = 0; i < 12; ++i) | |
.spinner-blade | |
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
$spinner-size: 75px !default; | |
$spinner-color: #69717d !default; | |
$overlay-color: black !default; | |
@mixin absolute-center { | |
position: absolute; | |
left: 0; | |
right: 0; | |
top: 0; | |
bottom: 0; | |
margin: auto; | |
} | |
.overlay { | |
background: rgba($overlay-color,.9); | |
@include absolute-center; | |
} | |
.spinner { | |
font-size: $spinner-size; | |
position: relative; | |
display: inline-block; | |
width: 1em; | |
height: 1em; | |
&.center { | |
@include absolute-center; | |
} | |
} | |
.spinner-blade { | |
position: absolute; | |
left: .4629em; | |
bottom: 0; | |
width: .074em; | |
height: .2777em; | |
border-radius: .5em; | |
background-color: transparent; | |
transform-origin: center -.2222em; | |
animation: spinner-fade 1s infinite linear; | |
$animation-delay: 0s; | |
$blade-rotation: 0deg; | |
@for $i from 1 through 12 { | |
&:nth-child(#{$i}) { | |
animation-delay: $animation-delay; | |
transform: rotate($blade-rotation); | |
$blade-rotation: $blade-rotation + 30; | |
$animation-delay: $animation-delay + .083; | |
} | |
} | |
} | |
@keyframes spinner-fade { | |
0% { | |
background-color: $spinner-color; | |
} | |
100% { | |
background-color: transparent; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment