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

              
                <!-- 
     We wanted something different
     for the logo hover on tumblr... 
     and like the answer to so many questions,
     gifs were the sollution
-->

<svg class="svg-logo" width="58px" height="78px" viewBox="0 0 29 39" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <pattern id="rollover" width="1" height="1" viewBox="0 0 100 100" preserveAspectRatio="none">
      <image id="rollover-image" xlink:href="https://s3-us-west-2.amazonaws.com/s.cdpn.io/277/1.gif" width="100" height="100" preserveAspectRatio="none" />
    </pattern>
    <g id="main-logo" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
      <path class="large-shadow" d="M21.9956664,26.3 L21.9956664,19.0055544 L27.9954227,19.0055542 L27.9954227,13.0048828 L27.9954227,11.0108643 L23.522766,11.0108643 L23.5540067,11.6669807 L23.7388305,15.5486452 L17.6832886,15.4792482 L17.4,24 C17.5,26.3 18.8,26.5 19.8,26.5 C20.2,26.5 21.4956664,26.4 21.9956664,26.3 Z M18.7154541,4.00225829 L17.4,2.9 L17.4,8 L22.000122,7.34490957 L22.000122,4.00225829 L18.7154541,4.00225829 Z M24.3,29.6 L24.9,31.5 C23.8,32.9 21,34 18.4,34 L18.1,34 C16.3,34 14.8,33.7 13.6,33.2 C15,35.4 17.5999998,38.0021971 21.7999998,38.0021971 C21.7999996,38.6099361 22.0022113,38.0021971 22.0999998,38.0021971 C24.6999998,38.0021971 27.4,36.1 28.6,34.7 L26.7,28.8 C26,29.2 25.1,29.5 24.3,29.6 Z" id="Shape" fill="#000000"></path>
      <path class="inner" d="M18.5,33.6 L18.3,33.6 C11.1,33.6 9,28.2005493 9,25.0005493 L9,15 C8.58245849,15 4.99298096,15 5,15 L4.99298096,10.0285034 C4.99298096,9.92850342 5.1,9.9 5.2,9.9 C8.9,8.5 11.3,6.7 11.9,2.3 C11.8,2 12,2 12,2 L16.8,2 L17,2 L17,9.00006104 L23.012207,9.00006104 L23.012207,15 L17,15 L17,24.0839844 C17,26.1839844 17.8,27.3 19.8,27.3 C20.6,27.3 21.5,27.1 22.4,26.8 C22.5,26.8 22.6,26.8 22.6,26.9 L24.1,31.3 L24.1,31.7 C23,32.8 20.7,33.6 18.5,33.6 Z"></path>
      <path class="outer" d="M26.1,32.2 L26.3,31.9 L23.9,25.1 C23.9,25 23.8,25 23.8,25 L19.2,25 C19.1,25 19,25.1 19,25 C18.9,24.8 19,24.4 19,24.1 L19,17 L25,17 L25,7 C25,7 19,7 19,7 L19,0 L8,0 C7.3,0 6.4,0.8 6.3,1.8 C5.8,5.9 4.1,7.5 0.5,8.7 L0.1,8.8 C0,8.9 0,8.9 0,9 L0,17.0000006 C0,17.1000006 0.1,17 0.1,17 L4,17 L4,24.8 C4,31.8 8.46560059,36.0067139 17.3656006,36.0067139 C22.0656006,36.0067139 25,33.7 26.1,32.2 Z M18.5,33.6 L18.3,33.6 C11.1,33.6 9,28.2005493 9,25.0005493 L9,15 C8.58245849,15 4.99298096,15 5,15 L4.99298096,10.0285034 C4.99298096,9.92850342 5.1,9.9 5.2,9.9 C8.9,8.5 11.3,6.7 11.9,2.3 C11.8,2 12,2 12,2 L16.8,2 L17,2 L17,9.00006104 L23.012207,9.00006104 L23.012207,15 L17,15 L17,24.0839844 C17,26.1839844 17.8,27.3 19.8,27.3 C20.6,27.3 21.5,27.1 22.4,26.8 C22.5,26.8 22.6,26.8 22.6,26.9 L24.1,31.3 L24.1,31.7 C23,32.8 20.7,33.6 18.5,33.6 Z"></path>
      <path class="small-shadow" d="M4,19 L7,19 L7,17.0833333 C7,17 6.9,17 6.9,17 L4,17 L4,19 L4,19 Z" opacity="0.5" fill="#37465D"></path>
    </g>
  </svg>
<p>Tumblr logo Hover<br>
  <small>(Hover multiple times)</small>
</p>
              
            
!

CSS

              
                html, body {
  background: #35465E;
  padding: 0px;
  margin: 0px;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.svg-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100px;
  margin-left: -50px;
  margin-top: -50px;
  cursor: pointer;
  text-align: center;
  
  .inner {
    transition: opacity 200ms;
    opacity: 0;
  }
  
  &:hover {
    .inner {
      opacity: 1;
      fill: url(#rollover);      
    }
  }
}

p {
  width: 300px;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -150px;
  text-align: center;
  margin-top: 50px;
  color: #fff;
  font-family: helvetica;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 2px;
  -webkit-font-smoothing: antialiased;
  font-weight: bold;
  line-height: 18px;
}

.outer {
  fill: #fff;
}

.large-shadow {
  opacity: 0.25;
}
              
            
!

JS

              
                var Logo = {
	
  $logoFillArea: null,
	imageIds: [],
	imageCount: 10,
  assetBase: 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/277/',
  
  init: function() {
		// Bind hover events
    
    this.$logoFillPattern = $('#rollover-image');
    this.mixImages();
    this.applyImage();
    
		$('.svg-logo').mouseleave(function() {
      Logo.applyImage();
    })
  },
  
  mixImages: function() {
     this.imageIds = _.shuffle(_.range( 1, this.imageCount + 1));
  },
  
  applyImage: function() {

    if( this.imageIds.length === 0 ) {
    	this.mixImages();
    }
    
    var imageUrl = this.assetBase + this.imageIds[0] + '.gif';
  	this.$logoFillPattern.attr('xlink:href', imageUrl);    
 
    this.imageIds.shift();
  }
}

Logo.init();

              
            
!
999px

Console