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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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 class="stream1 stream playing">
  <div class="loader" title="playing">
    <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 24 24" xml:space="preserve">
      <rect x="0" y="0" width="4" height="24" fill="slategray">
        <animateTransform  attributeType="xml"
          attributeName="transform" type="translate"
          from="0 20" to="0 0"
          begin="0s" dur="0.5s" repeatCount="indefinite" />      
      </rect>
      <rect x="5" y="0" width="4" height="24" fill="slategray">
        <animateTransform  attributeType="xml"
          attributeName="transform" type="translate"
          from="5 20" to="5 0"
          begin="0.2s" dur="0.7s" repeatCount="indefinite" />       
      </rect>
      <rect x="10" y="0" width="4" height="24" fill="slategray">
        <animateTransform  attributeType="xml"
          attributeName="transform" type="translate"
          from="10 20" to="10 0"
          begin="0.4s" dur="0.5s" repeatCount="indefinite" />       
      </rect>
    </svg>
  </div>
  <div class="stream-info">
    <div class="stream-name">Station Name</div>
    <div class="stream-program">Program Name</div>
  </div>
</div>
<br />
<div class="stream2 stream playing">
  <div class="loader" title="playing">
  <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 24 24" xml:space="preserve">
      <rect x="0" y="0" width="4" height="9" fill="#333">
        <animateTransform  attributeType="xml"
          attributeName="transform" type="scale"
          values="1,1; 1,3; 1,1"
          begin="0s" dur="0.6s" repeatCount="indefinite" />       
      </rect>

      <rect x="10" y="0" width="4" height="6" fill="#333">
        <animateTransform  attributeType="xml"
          attributeName="transform" type="scale"
          values="1,1; 1,3; 1,1"
          begin="0.2s" dur="0.6s" repeatCount="indefinite" />       
      </rect>
      <rect x="20" y="0" width="4" height="8" fill="#333">
        <animateTransform  attributeType="xml"
          attributeName="transform" type="scale"
          values="1,1; 1,3; 1,1"
          begin="0.4s" dur="0.6s" repeatCount="indefinite" />       
      </rect>
    </svg>
  </div>
  <div class="stream-info">
    <div class="stream-name">Station Name</div>
    <div class="stream-program">Program Name</div>
  </div>
</div>
<br />
<div class="stream3 stream playing">
  <div class="loader" title="playing"></div>
  <div class="stream-info">
    <div class="stream-name">Station Name</div>
    <div class="stream-program">Program Name</div>
  </div>
</div>

<br />
<div class="stream4 stream playing">
  <div class="loader bars" title="playing">
    <div class="bar"></div>
    <div class="bar"></div>
    <div class="bar"></div>
    <div class="bar"></div>
  </div>
  <div class="stream-info">
    <div class="stream-name">Station Name</div>
    <div class="stream-program">Program Name</div>
  </div>
</div>
<br />
<div class="stream5 stream not-playing">
  <div class="playme" title="not-playing">
    <div class="button">
      <svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" preserveAspectRatio="xMinYMin">
        <path d="m30.50001,20.6l0,0l-16.5,8.3c-0.1,0.1 -0.2,0.1 -0.3,0.2l0,0l0,0c-0.1,0 -0.3,0.1 -0.4,0.1c-0.7,0 -1.3,-0.5 -1.3,-1.2v-16.8c0,-0.7 0.6,-1.2 1.3,-1.2c0.2,0 0.4,0 0.6,0.1l0,0l16.7,8.5l0,0c0.4,0.2 0.6,0.6 0.6,1c-0.1,0.4 -0.3,0.8 -0.7,1z" fill="#FFFFFF"/>
      </svg>
    </div>
  </div>
  <div class="loader bars" title="playing">
    <div class="bar"></div>
    <div class="bar"></div>
    <div class="bar"></div>
    <div class="bar"></div>
  </div>
  <div class="stream-info">
    <div class="stream-name">Station Name</div>
    <div class="stream-program">Program Name</div>
  </div>
</div>
<br />
<div class="stream6 stream not-playing">
  <div class="playme" title="not-playing">
    <div class="button"></div>
  </div>
  <div class="loader bars" title="playing">
    <div class="bar"></div>
    <div class="bar"></div>
    <div class="bar"></div>
    <div class="bar"></div>
  </div>
  <div class="stream-info">
    <div class="stream-name">Station Name</div>
    <div class="stream-program">Program Name</div>
  </div>
</div>
<br />
<div class="stream7 stream playing">
  <div class="loader2 bars2" title="playing">
    <div class="bar2"></div>
    <div class="bar2"></div>
    <div class="bar2"></div>
  </div>
  <div class="stream-info">
    <div class="stream-name">Station Name</div>
    <div class="stream-program">Program Name</div>
  </div>
</div>
              
            
!

CSS

              
                body{
  padding: 1em;
  background: #373f46;
  color: #777;
  text-align: center;
  width: 80%;
  margin: 0 auto;
}

.stream-info {
  display:inline-block;
}
.stream-name,
.stream-program {
  display: block;
  text-align: left;
  margin: 0;
  padding: 0;
}

.stream-program {
  font-size: 110%;
  color: white;
}

/* - - - EXAMPLE 1 - SVG Translate - - -  */
.loader{
  text-align: center;
  padding: .5em .5em .25em;
  margin: 0 auto;
  display: inline-block;
  vertical-align: top;
  background: rgba(255,255,255,.05);
  border-radius: 4px;
}

/* - - - EXAMPLE 2 - SVG Scale - - -  */
.stream2 svg {
 transform: rotate(180deg);
}
svg path,
svg rect{
  fill: slategray;
}

/* - - - EXAMPLE 3 - SVG Inline - - -  */

.stream3 .loader:before {
  content: url(http://russgossett.com/images/playing.svg);
}

/* - - - EXAMPLE 4 - CSS3 Animation - - -  */
.stream4.playing .loader {
  width: 1.25em;
  height: 1.5em;
  border-radius: 50%;
  background: none;
  border: 1px solid rgba(255,255,255,.1);
}

.bars {
  height: 1em;
  position: relative;
}

.bar {
  background: slategray;
  bottom: .5em;
  height: .1em;
  position: absolute;
  width: 3px;
  animation: sound 1s cubic-bezier(.17,.37,.43,.67) infinite alternate;
}

@keyframes sound {
  0% {
   opacity: .35;
    height: .1em; 
  }
  100% {
    opacity: 1;       
    height: 1em;        
  }
}

.bar:nth-child(1)  { left: .6em; animation-duration: .4s; }
.bar:nth-child(2)  { left: .9em; animation-duration: .2s; }
.bar:nth-child(3)  { left: 1.2em; animation-duration: 1s; }
.bar:nth-child(4)  { left: 1.5em; animation-duration: .3s;}

/* - - - EXAMPLE 5 - SVG Play Button - - -  */
.stream5.not-playing .playme {
  height: 2.425em;
  width: 2.45em;
  border-radius: 50%;
  background: none;
  border: 1px solid rgba(255,255,255,.1);
  display: inline-block;
  transform: scale(.95);
}

.stream5.not-playing .loader {display:none;}

/* - - - EXAMPLE 6 - CSS Play Button - - -  */
.stream6 {cursor: pointer;}

.stream6.not-playing .playme {
  height: 2.425em;
  width: 2.45em;
  border-radius: 50%;
  background: none;
  border: 1px solid rgba(255,255,255,.1);
  display: inline-block;
  transform: scale(.95);
}
.stream6 .playme .button {
	width: 0; 
	height: 0; 
	border-top: .6em solid transparent;
	border-bottom: .6em solid transparent;
	border-left: 1em solid slategray;
  position: absolute;
  top: .65em;
  left: .85em;
}

.stream6.not-playing .loader {display:none;}

.stream6 .loader {
    width: 20px;
    height: 24px;
}

/* - - - EXAMPLE 7 - CSS3 Animation - - -  */
.stream7.stream.playing {
  display: inline-block;
}

.stream7.playing .loader2 {
  width: 1.5em;
  height: .5em;
  border-radius: 50%;
  background: none;
  float:left;
  margin: 1em 1em 1em 0;
}

.bars2 {
  height: 1em;
  position: relative;
}

.bar2 {
  background: slategray;
  bottom: 0em;
  height: .1em;
  position: absolute;
  width: 3px;
  animation: sound2 1s cubic-bezier(.17,.37,.43,.67) infinite alternate;
}

@keyframes sound2 {
  0% {
   opacity: .35;
    height: .1em; 
  }
  100% {
    opacity: 1;       
    height: 1em;        
  }
}

.bar2:nth-child(1)  { left: .6em; animation-duration: 400ms; }
.bar2:nth-child(2)  { left: .9em; animation-duration: 600ms; }
.bar2:nth-child(3)  { left: 1.2em; animation-duration: 800ms; }


              
            
!

JS

              
                $(".stream6").click(function() {
  $(this).toggleClass("not-playing");
});
              
            
!
999px

Console