Last active
August 29, 2015 14:17
-
-
Save jdsteinbach/22993641ad26b3d8973c to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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="element loading">Loading</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
| // ---- | |
| // Sass (v3.4.12) | |
| // Compass (v1.0.3) | |
| // ---- | |
| @mixin loading( | |
| $width: 50px, | |
| $border: 5px, | |
| $speed: 2s, | |
| $color: gray, | |
| $accent: black | |
| ) { | |
| &.loading { | |
| position: relative; | |
| opacity: .5; | |
| &:after { | |
| content: ''; | |
| position: absolute; | |
| width: $width; | |
| height: $width; | |
| border-radius: $width; | |
| border: $border $color solid; | |
| border-top-color: $accent; | |
| top: 50%; | |
| left: 50%; | |
| margin-top: ( -$width / 2 - $border ); | |
| margin-left: ( -$width / 2 - $border ); | |
| -webkit-animation: loading $speed linear infinite; | |
| animation: loading $speed linear infinite; | |
| } | |
| } | |
| @-webkit-keyframes loading { | |
| 0% { | |
| transform: rotate(0deg); | |
| } | |
| 100% { | |
| transform: rotate(360deg); | |
| } | |
| } | |
| @keyframes loading { | |
| 0% { | |
| transform: rotate(0deg); | |
| } | |
| 100% { | |
| transform: rotate(360deg); | |
| } | |
| } | |
| } | |
| .element { | |
| margin: 2em auto; | |
| width: 200px; | |
| height: 200px; | |
| background: #eee; | |
| line-height: 200px; | |
| text-align: center; | |
| transition: opacity; | |
| @include loading( 60px, 8px, 3s, gray, black ); | |
| } |
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
| .element { | |
| margin: 2em auto; | |
| width: 200px; | |
| height: 200px; | |
| background: #eee; | |
| line-height: 200px; | |
| text-align: center; | |
| transition: opacity; | |
| } | |
| .element.loading { | |
| position: relative; | |
| opacity: .5; | |
| } | |
| .element.loading:after { | |
| content: ''; | |
| position: absolute; | |
| width: 60px; | |
| height: 60px; | |
| border-radius: 60px; | |
| border: 8px gray solid; | |
| border-top-color: black; | |
| top: 50%; | |
| left: 50%; | |
| margin-top: -38px; | |
| margin-left: -38px; | |
| -webkit-animation: loading 3s linear infinite; | |
| animation: loading 3s linear infinite; | |
| } | |
| @-webkit-keyframes loading { | |
| 0% { | |
| transform: rotate(0deg); | |
| } | |
| 100% { | |
| transform: rotate(360deg); | |
| } | |
| } | |
| @keyframes loading { | |
| 0% { | |
| transform: rotate(0deg); | |
| } | |
| 100% { | |
| transform: rotate(360deg); | |
| } | |
| } |
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="element loading">Loading</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment