Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

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.

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

              
                <div id="circles">
 <svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   id="svg5144"
   version="1.1"
   viewBox="0 0 69.066415 69.066415">
  <defs
     id="defs5138" />
  <metadata
     id="metadata5141">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     transform="translate(-70.466793,-113.96679)"
     id="layer1">
    <path
       id="big"
       d="M 138.87175,148.5 A 33.871749,33.871749 0 0 1 105,182.37175 33.871749,33.871749 0 0 1 71.128251,148.5 33.871749,33.871749 0 0 1 105,114.62825 33.871749,33.871749 0 0 1 138.87175,148.5 Z"
       style="fill:none;fill-opacity:1;stroke:#ff5555;stroke-width:1.32291663;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" />
    <path
       id="middle"
       d="M 132.02625,148.5 A 27.026255,27.026255 0 0 1 105,175.52625 27.026255,27.026255 0 0 1 77.973744,148.5 27.026255,27.026255 0 0 1 105,121.47375 27.026255,27.026255 0 0 1 132.02625,148.5 Z"
       style="fill:none;fill-opacity:1;stroke:#ff9c55;stroke-width:1.32291663;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" />
    <path
       id="small"
       d="M 120.92019,148.5 A 15.920185,15.920185 0 0 1 105,164.42019 15.920185,15.920185 0 0 1 89.079816,148.5 15.920185,15.920185 0 0 1 105,132.57981 15.920185,15.920185 0 0 1 120.92019,148.5 Z"
       style="fill:none;fill-opacity:1;stroke:#ffda55;stroke-width:1.32291663;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers" />
  </g>
</svg>
</div>
              
            
!

CSS

              
                #circles
  margin: 0 auto
  width: 300px

#big
  stroke-dasharray: 2px 10px !important
  stroke-dashoffset: 213px !important
  animation: dash 3s ease-in-out infinite
  animation-direction: alternate !important
  transform-origin: 50% 50%
  transform: rotate(90deg)


@keyframes dash {
  to {
    stroke-dashoffset: 0;
    transform: rotate(120deg)
  }
}

#middle 
  stroke-dasharray: 1px 5px !important
  stroke-dashoffset: 170px !important
  animation: dashmed 3s ease-in-out infinite
  animation-direction: alternate !important
  transform-origin: 50% 50%


@keyframes dashmed {
  to {
    stroke-dashoffset: 0;
    transform: rotate(240deg)
  }
}

#small 
  stroke-dasharray: 3px 6px !important
  stroke-dashoffset: 100px !important
  animation: dashmin 3s ease-in-out infinite
  animation-direction: alternate !important
  transform-origin: 50% 50%
  transform: rotate(180deg)


@keyframes dashmin {
  to {
    stroke-dashoffset: 0;
    transform: rotate(240deg)
  }
}
              
            
!

JS

              
                // calculate the length of path
// https://css-tricks.com/svg-line-animation-works/
var path = document.querySelector('#big');
var length = path.getTotalLength();
console.log(length)
              
            
!
999px

Console