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

              
                <head>
  <link href='https://fonts.googleapis.com/css?family=Roboto|Electrolize' rel='stylesheet' type='text/css' />
</head>

<body>
  <div id="wrapper">
    <div id="life" class="menu-container" tabindex="1">
      <div class="label">life</div>
      <div class="tile"><i class="icon-user"></i></div>
      <div class="bar">
        <div class="buttons">
          <!-- Image links here -->
        </div>
      </div>
    </div>
    <div id="work" class="menu-container" tabindex="2">
      <div class="label">work</div>
      <div class="tile"><i class="icon-briefcase"></i></div>
      <div class="bar">
        <div class="buttons">
          <!-- Image links here -->
        </div>
      </div>
    </div>
    <div id="play" class="menu-container" tabindex="3">
      <div class="label">play</div>
      <div class="tile"><i class="icon-gamepad"></i></div>
      <div class="bar">
        <div class="buttons">
          <!-- Image links here -->
        </div>
      </div>
    </div>
    <div id="talk" class="menu-container" tabindex="4">
      <div class="label">talk</div>
      <div class="tile"><i class="icon-comments"></i></div>
      <div class="bar">
        <div class="buttons">
          <!-- Image links here -->
        </div>
      </div>
    </div>
    <div id="link" class="menu-container" tabindex="5">
      <div class="label">links</div>
      <div class="tile"><i class="icon-link"></i></div>
      <div class="bar">
        <div class="buttons">
          <p>COMING SOON</p>
        </div>
      </div>
    </div>
  </div>
  <audio id="secret-found" preload="auto">
    <source src="http://www.nickbrombal.com/audio/ZSS_Secret.mp3"></source>
    <source src="http://www.nickbrombal.com/audio/ZSS_Secret.ogg"></source>
  </audio>
</body>
              
            
!

CSS

              
                @import "compass/css3";

* { margin: 0; padding: 0; border: 0; outline: 0; }

body {
  background: #444444 url("http://nickbrombal.com/images/bg_pixel-grey.jpg") repeat fixed;
}

#wrapper {
  margin-top: 100px;
}

.menu-container {
  margin: 10px auto;
  width: 64px;
  height: 64px;
  white-space: nowrap;
  box-shadow: 3px 3px #2E2E2E;
  .label {
    display: none;
    position: absolute;
    font: 26px/64px electrolize;
    width: 64px;
    text-align: center;
    color: white;
  }
  .tile {
    float: left;
    height: 64px;
    width: 64px;
  }
  .bar {
    display: inline-block;
    height: 64px;
    vertical-align: top;
    width: 0px;
    overflow: hidden;
    background: #777;
    .buttons {
      width: 300px;
      height: 64px;
      text-align: center;
      img {
        height: 48px;
        padding: 8px 0;
      }
      p {
        font: 12px/64px roboto;
        color: #fff;
        letter-spacing: 3px;
      }
    }
  }
}

/* Tile colouring */
#life .label, #life .tile { background: #52CC5C; }
#work .label, #work .tile { background: #CC5252; }
#play .label, #play .tile { background: #52A3CC; }
#talk .label, #talk .tile { background: #CCCC52; }
#link .label, #link .tile { background: #7C22D6; }

/* Styling for font text icons */
[class^="icon-"] {
  display: inline-block;
  width: 100%;
  line-height: 64px;
  text-align: center;
  height: 64px;
  font-size: 37px;
  background: -webkit-linear-gradient(#fff, #ccc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  &:before { display: initial; }
}

/* Vertical adjustments to font text icons */
.icon-briefcase { line-height: 68px; }
.icon-gamepad { line-height: 60px; }
.icon-comments { line-height: 62px; }
.icon-link { line-height: 66px; }

/* Hide the secret (shh!) menu */
#link { display: none; }
              
            
!

JS

              
                $(document).ready(function() { 
  // Perform animations on menu containers and items
  $('.menu-container').hover(function() { // Tile animations on hover, for desktop browsers
    category = '#' + this.id; 
    $(category + ' .label').stop().animate({width:'100px'}, {queue: false, duration: 300}).fadeIn();
    $(category + ' .tile').stop().animate({width:'100px'}, {queue: false, duration: 300});
    $(category + ' .bar').stop().animate({width:'300px'}, {queue: false, duration: 300});
    $(this).stop().animate({width:'400px'}, {queue: false, duration: 300}); 
  }, function() { // Tile reset on unhover, for desktop browsers
    $(category + ' .label').stop().animate({width:'64px'}).fadeOut({queue: false});
    $(category + ' .tile').stop().animate({width:'64px'});
    $(category + ' .bar').stop().animate({width:'0px'});
    $(this).stop().animate({width:'64px'});
  }).focus(function() { // Tile animation on focus (click), for mobile browsers
    category = '#' + this.id;
    $(category + ' .label').stop().animate({width:'100px'}, {queue: false, duration: 300}).fadeIn();
    $(category + ' .tile').stop().animate({width:'100px'}, {queue: false, duration: 300});
    $(category + ' .bar').stop().animate({width:'300px'}, {queue: false, duration: 300});
    $(this).stop().animate({width:'400px'}, {queue: false, duration: 300});
  }).blur(function() { // Tile reset on blur (unclick), for mobile browsers
    $('.label').stop().animate({width:'64px'}, {queue: false, duration: 300}).fadeOut({queue: false});
    $('.tile, .menu-container').stop().animate({width:'64px'}, {queue: false, duration: 300});
    $('.bar').stop().animate({width:'0px'}, {queue: false, duration: 300}); 
  });
        
  // If possible, use event listener for secret menu access
  if (window.addEventListener) {
    // Define holder for pressed keys, marker for secret status, and code sequence.
    var pressed = [];
    var status = 'hidden';
    var konamiCode = '38,38,40,40,37,39,37,39,66,65';
    // Listen for key presses and record their codes in "pressed" array
    window.addEventListener('keydown', function(k) {
      pressed.push(k.keyCode);
      // The first time the user enters the correct sequence...
      if (pressed.toString().indexOf(konamiCode) >= 0 && status == 'hidden') {
        // Reveal secret, then clear array and change status
        surprise();
        pressed = [];
        status = 'found';
      }
    }, true);
  }
  
  // Reveal secret menu and play sound
  var surprise = function() {
    $('#link').fadeIn();
    $('#secret-found')[0].play();
  };
}); 
              
            
!
999px

Console