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

              
                / Easter Hues, according to http://design-seeds.com/index.php/home/entry/easter-hues1

- @hexcodes = ['#bed9d2', '#3f8488', '#e45f69', '#fa87a2', '#eac27d', '#ebe3a0']
- @hexcodes.each do |a|
  .a
    %p
      #{a}
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Montserrat)

$colors: (#bed9d2, #3f8488, #e45f69, #fa87a2, #eac27d, #ebe3a0)

::selection
  background-color: black

html, body
  width: 100%
  height: 100%
.a
  position: relative
  float: left
  height: 100%
  width: 16.66666666666667%
  cursor: crosshair
  transition: width .15s ease-in-out
  & p
    position: absolute
    display: none
    top: 50%
    left: 50%
    transform: translate(-50%, -50%)
    padding: 0
    margin: 0
    color: white
    font:
      family: Montserrat
      weight: 400
      size: 30px
    text-transform: uppercase

@for $i from 0 to 6
  .a:nth-child(#{$i+1})
    background: nth($colors, $i+1)
    
.hover
  width: 30%
.unhover
  width: 14%
.click
  width: 100%
.unclick
  width: 0%
              
            
!

JS

              
                $(".a").hover(function() {
    $(this).addClass("hover");
    $(this).siblings().addClass("unhover");
  }, function() {
    $(this).removeClass("hover");
    $(this).siblings().removeClass("unhover");
  }
);

$(".a").click(function(){
  $(this).toggleClass("click");
  $(this).siblings().toggleClass("unclick");
  $(this).children("p").fadeToggle(150);
}).children().click(function(e) {
  return false;
});

setTimeout(function(){
  $('.a').not('.a:nth-child(3)').addClass('unclick');
  $('.a:nth-child(3)').addClass('click');
  $('.a:nth-child(3)').children("p").fadeToggle(150);
},700);
setTimeout(function(){
  $('.a').not('.a:nth-child(3)').removeClass('unclick');
  $('.a:nth-child(3)').removeClass('click');
  $('.a:nth-child(3)').children("p").fadeToggle(150);
},1700);
              
            
!
999px

Console