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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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 class="wrap">
  <div class="click" onclick="play()">
    <div class="restart">
      <div class="circle outer"></div>
      <div class="circle inner"></div>
      <div class="bar outer"></div>
      <div class="bar inner"></div>
    </div>
  </div>
  <svg height="45" width="530">
    <path id="i0" d="M37.576,41.792v-26.8L26.023,32.527h-0.235l-11.436-17.36v26.625H5.496V0.739h9.735l10.792,17.36l10.791-17.36h9.736
      v41.052H37.576z"/>
    <path id="i1" d="M65.786,41.792V0.739h30.966v8.035H74.759v8.329h19.354v8.032H74.759v8.621h22.287v8.035H65.786z"/>
    <path id="i2" d="M133.642,9.067v32.725h-9.032V9.067h-12.492V0.739h34.016v8.328H133.642z"/>
    <path id="i3" d="M187.363,41.792l-8.798-13.136h-7.096v13.136h-9.031V0.739h18.767c9.677,0,15.483,5.102,15.483,13.547v0.118
      c0,6.627-3.578,10.792-8.798,12.726l10.029,14.661H187.363z M187.539,14.757c0-3.872-2.698-5.867-7.096-5.867h-8.974v11.789h9.149
      c4.398,0,6.92-2.345,6.92-5.806V14.757z"/>
    <path id="i4" d="M234.163,42.497c-12.667,0-21.758-9.443-21.758-21.113v-0.118c0-11.67,9.208-21.23,21.875-21.23
      s21.757,9.442,21.757,21.113v0.117C256.038,32.936,246.832,42.497,234.163,42.497z M246.597,21.266
      c0-7.038-5.161-12.902-12.434-12.902c-7.271,0-12.315,5.747-12.315,12.785v0.117c0,7.038,5.161,12.903,12.433,12.903
      s12.316-5.748,12.316-12.786V21.266z"/>
    <path id="i5" d="M301.666,41.792l-19.88-26.098v26.098h-8.915V0.739h8.327l19.238,25.278V0.739h8.912v41.052H301.666z"/>
    <path id="i6" d="M348.527,42.497c-12.667,0-21.759-9.443-21.759-21.113v-0.118c0-11.67,9.208-21.23,21.875-21.23
      c12.668,0,21.758,9.442,21.758,21.113v0.117C370.401,32.936,361.195,42.497,348.527,42.497z M360.958,21.266
      c0-7.038-5.16-12.902-12.432-12.902c-7.273,0-12.316,5.747-12.316,12.785v0.117c0,7.038,5.161,12.903,12.433,12.903
      c7.273,0,12.315-5.748,12.315-12.786V21.266z"/>
    <path id="i7" d="M419.315,41.792v-26.8L407.76,32.527h-0.234l-11.436-17.36v26.625h-8.856V0.739h9.735l10.791,17.36l10.792-17.36h9.736
      v41.052H419.315z"/>
    <path id="i8" d="M446.938,41.792V0.739h30.966v8.035h-21.993v8.329h19.354v8.032h-19.354v8.621h22.286v8.035H446.938z"/>
    <path id="i9" d="M495.323,8.481V0.739h27.74v6.803l-10.381,9.912c5.631,0.938,11.025,3.87,11.025,11.553
      c0,7.799-5.629,13.489-14.778,13.489c-7.39,0-12.492-2.935-16.011-7.097l6.216-5.924c2.815,3.168,5.747,4.926,9.912,4.926
      c3.399,0,5.806-1.933,5.806-5.043c0-3.399-2.873-5.277-8.035-5.277h-3.753l-1.407-5.747l9.794-9.853H495.323z"/>
  </svg>
</div>
              
            
!

CSS

              
                html,body {
  height: 100%;
  margin: 0;
}
.wrap {
  background-image: url('http://15.metronome3.com/assets/dots.png');
  position: relative;
  height: 100%;
}
svg {
  position: absolute;
  top: 0;  left: 0;
  right: 0; bottom: 0;
  margin: auto;
  overflow: hidden;
}
path {
  fill: #fff;
  stroke:#000;
  stroke-width: 1;
}
.fadein {
  fill: #000;
  -webkit-transition: fill 1s;
  -moz-transition: fill 1s;
  transition: fill 1s;
}
.click {
  position: fixed;
  background: #000;
  top:10px;
  left:10px;
  width:50px;
  height:50px;
  cursor: pointer;
  border-radius: 5px;
}
.restart {
  position: relative;
  height: 100%;
}
.circle {
  border-radius: 20px;
  position: absolute;
  top: 0;  left: 0;
  right: 0; bottom: 0;
  margin: auto;
  overflow: hidden;
}
.circle.outer {
  background: #fff;
  width: 30px;
  height: 30px;
}
.circle.inner {
  background: #000;
  width: 24px;
  height: 24px;
}
.bar {
  position: absolute;
}
.bar.outer {
  background: #000;
  height: 20px;
  width: 14px;
  left: 50%;
  margin-left: -7px;
  top: 4px;
}
.bar.inner {
  background: #fff;
  height: 18px;
  width: 4px;
  left: 50%;
  margin-left: -2px;
  top: 6px;
  border-radius: 2px;
}
              
            
!

JS

              
                play();

function play() {
  var current_frame = 0;
  var total_frames = 60;
  var path = new Array();
  var length = new Array();
  
  for(var i=0; i<10;i++){
    path[i] = document.getElementById('i'+i);
    l = path[i].getTotalLength();
    length[i] = l;
    path[i].style.strokeDasharray = l + ' ' + l; 
    path[i].style.strokeDashoffset = l;
    //path[i].style.fill = "none";
  }
  
  var handle = 0;
  
  var draw = function() {
     var progress = current_frame/total_frames;
    
     if (progress > 1) {
       for(var j=0; j<path.length; j++){
         path[j].setAttribute("class", "fadein");
       } 
       window.cancelAnimationFrame(handle);
     } else {
       current_frame++;
       for(var j=0; j<path.length;j++){
         path[j].style.strokeDashoffset = Math.floor(length[j] * (1 - progress));
         path[j].setAttribute("class", "");
       }
       handle = window.requestAnimationFrame(draw);
     }
  };
  draw();
  
}
              
            
!
999px

Console