cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <figure>
  <figcaption>SVG PIE Chart with CSS animation</figcaption>
	<svg viewBox="0 0 63.6619772368 63.6619772368">
		<circle class="pie1" cx="31.8309886184" cy="31.8309886184" r="15.9154943092"/>
		<circle class="pie2" cx="31.8309886184" cy="31.8309886184" r="15.9154943092"/>
		<circle class="pie3" cx="31.8309886184" cy="31.8309886184" r="15.9154943092"/>
		<circle class="pie4" cx="31.8309886184" cy="31.8309886184" r="15.9154943092"/>
	</svg>
</figure>
            
          
!
            
              figure {
  background-color: #eee;
  display: block;
  height: 0;
  margin: 0 auto;
  position: relative;
  font-size:16px;
  font-size:1vw;
  width: 40em;
  padding-bottom: 40em;
}
figcaption {
  font-size:1rem;
  text-align:center;
  color:#fff;
  width: 100%;
  position: absolute;
  left: 0;
  top:40%;
  z-index:2;
}
svg {
  display: block;
  height: 100%;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
}
circle {
	fill:rgba(0,0,0,0);
  stroke-width:31.8309886184;
  stroke-dasharray: 0,0,0,100;
  stroke-dashoffset: 25;
  -webkit-animation: pie1 3s infinite ease both;
  animation: pie1 6s infinite ease both;
}
.pie1 {
  stroke:hsl(180,70%,30%);
}
.pie2 {
  stroke:hsl(180,70%,50%);
  -webkit-animation-name: pie2;
  animation-name: pie2;
}
.pie3 {
  stroke:hsl(180,70%,20%);
  -webkit-animation-name: pie3;
  animation-name: pie3;
}
.pie4 {
  stroke:hsl(180,0%,70%);
  -webkit-animation-name: pie4;
  animation-name: pie4;
}
/*
 pie percentage made by stroke-dasharray.
 stroke-dasharray format is...

 keyframe 100% : 0 offset this-percentage rest

 I added keyframe 50% for infinite presentation.
*/

/* 1st pie is 40% */
@-webkit-keyframes pie1 {
  50%,100% {stroke-dasharray: 40,60,0,0;}
}
@keyframes pie1 {
  50%,100% {stroke-dasharray: 40,60,0,0;}
}
/* 2nd pie is 30% */
@-webkit-keyframes pie2 {
  50%,100% {stroke-dasharray: 0,40,30,30;}
}
@keyframes pie2 {
  50%,100% {stroke-dasharray: 0,40,30,30;}
}
/* 3rd pie is 30% */
@-webkit-keyframes pie3 {
  50%,100% {stroke-dasharray: 0,70,20,10;}
}
@keyframes pie3 {
  50%,100% {stroke-dasharray: 0,70,20,10;}
}
/* 4th pie is 10% */
@-webkit-keyframes pie4 {
  50%,100% {stroke-dasharray: 0,90,10,0;}
}
@keyframes pie4 {
  50%,100% {stroke-dasharray: 0,90,10,0;}
}
            
          
!
999px
Loading ..................

Console