Created
March 26, 2013 08:27
-
-
Save codler/5243884 to your computer and use it in GitHub Desktop.
Loading Spinner in CSS
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
@keyframes wheel { | |
to { transform:rotate(360deg); } | |
} | |
.circularProgress:before { | |
content: ''; | |
display: inline-block; | |
width: 50px; | |
height: 50px; | |
background: | |
linear-gradient(0deg, transparent 49%, white 49%, white 51%, transparent 51%) 0 0px, | |
linear-gradient(45deg, transparent 49%, white 49%, white 51%, transparent 51%) 25px -25px, | |
linear-gradient(135deg, transparent 49%, white 49%, white 51%, transparent 51%) 25px -25px, | |
linear-gradient(90deg, transparent 49%, white 49%, white 51%, transparent 51%), | |
radial-gradient(white 42%, grey 42%, grey 70%, transparent 70%); | |
clip: rect(auto, 25px, auto, auto); | |
position: absolute; /* needed for clip */ | |
} | |
.circularProgress { | |
animation: wheel 1s steps(8, end) infinite; | |
width: 50px; | |
height: 50px; | |
background: | |
linear-gradient(0deg, transparent 49%, white 49%, white 51%, transparent 51%) 0 -1px, | |
linear-gradient(45deg, transparent 49%, white 49%, white 51%, transparent 51%) 25px -25px, | |
linear-gradient(135deg, transparent 49%, white 49%, white 51%, transparent 51%) 25px -25px, | |
linear-gradient(90deg, transparent 49%, white 49%, white 51%, transparent 51%) 0 0px, | |
radial-gradient(white 42%, lightgrey 42%, lightgrey 70%, transparent 70%); | |
} |
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="circularProgress"></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
// alert('Hello world!'); |
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
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Försöker göra en Loading Spinner helt i CSS :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Vad är det här? Nyfiken... :)