Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <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>
              
            
!

CSS

              
                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;}
}
              
            
!

JS

              
                
              
            
!
999px

Console