Skip to content

Instantly share code, notes, and snippets.

@ToDou
Forked from csssecrets/dabblet.css
Created December 11, 2017 09:41
Show Gist options
  • Save ToDou/1ee1176e98a34cb1f30badda2d2272be to your computer and use it in GitHub Desktop.
Save ToDou/1ee1176e98a34cb1f30badda2d2272be to your computer and use it in GitHub Desktop.
Animated pie chart
/**
* Animated pie chart
*/
.pie {
width: 100px; height: 100px;
border-radius: 50%;
background: yellowgreen;
background-image: linear-gradient(to right, transparent 50%, currentColor 0);
color: #655;
}
.pie::before {
content: '';
display: block;
margin-left: 50px;
height: 100%;
width:50%;
border-radius: 0 100% 100% 0 / 50%;
background-color: #FFEBE9;
transform-origin: left;
animation: spin 3s linear infinite, bg 6s step-end infinite;
}
@keyframes spin {
to { transform: rotate(.5turn); }
}
@keyframes bg {
50% { background: currentColor; }
}
<div class="pie"></div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment