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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              %div{:class => "container"}
  %ul{:class => "lock"}
    - (0...40).each do |i|
      %li
        | 
        - case 0
        - when i 
          = i
        - case 5
        - when i 
          = i
        - case 10
        - when i 
          = i
        - case 15
        - when i 
          = i 
        - case 20
        - when i 
          = i
        - case 25
        - when i 
          = i
        - case 30
        - when i 
          = i
        - case 35
        - when i 
          = i
            
          
!

CSS

            
              @import "compass/css3";

@import url(https://fonts.googleapis.com/css?family=Roboto+Slab:300,700);

// mixin from http://hugogiraudel.com/2013/04/02/items-on-circle/ thanks :)

@mixin putOnCircle( 
$nb-items, //Number of items
$circle-size, //Parent size
$item-size, //Item size
$class-for-IE: false //Base class name, false means use of pseudo-selectors
) {
  $half-item:     $item-size / 2;
  $half-parent: $circle-size / 2;
  
  position: relative;               /* [1] */
  width:  $circle-size;
  height: $circle-size;
  padding: 0;
  border-radius: 50%; 
  list-style: none;                 /* [2] */ 
  @include box-sizing(content-box); /* [3] */ 
  
  > * {                             /* [4] */
    display: block;
    position: absolute;
    top:  50%; 
    left: 50%;
    width:  $item-size;
    height: $item-size;
    margin: -$half-item;
    text-align:center;
    font-size:0.8em;
    color:rgba(255,255,255,0.9);
    
    $angle: 360 / $nb-items;
    $rot: 270;
    @for $i from 1 to $nb-items+1 {
      
      // If no support for IE8-
      
      @if $class-for-IE == false {
        &:nth-of-type(#{$i}) {
            @include transform(rotate(#{$rot}deg) translate($half-parent) rotate(90deg));
          }
      }
      
      // If support for IE8-  
      
      @else {
        &.#{$class-for-IE}#{$i} {
          // If CSS transforms are not supported
          $mt: sin($rot * pi() / 180) * $half-parent - $half-item;
          $ml: cos($rot * pi() / 180) * $half-parent - $half-item;
          margin: $mt 0 0 $ml;
        }
      }
      $rot: $rot + $angle;
    }
  }
}

body {
  background:#ddd;
  color:#333;
  font-weight:300;
  font-family:"Roboto Slab", sans-serif;
  &:after {
    content:attr(data-content);
      position:absolute;
      top:0.2em;
      left:0.2em;
      font-size:0.7em;
  }
  &:before {
      content:"[37][3][7]";
      text-align:center;
      display:block;
      font-size:3em;
      width:100%;
      top:2em;
      @include transition(all 1s);
      position:absolute;
      z-index:-1;
    }
}

.lock {
  @include putOnCircle(40, 11em, 1em, false); 
  width:10em;
  height:10em;
  @include border-radius(100%);
  margin:0 auto;
  position:relative;
  background:rgba(0,0,0,0.8);
  border:2.5em solid rgba(0,0,0,0.9);
  @include box-sizing(border-box);
  @include box-shadow(inset 0 0.17em 0.2em rgba(255,255,255,0.2));
  @include transition(transform 1s);
  top:2em;
  z-index:100;
  &:before {
    content:"Master";
      color:white;
      position:absolute;
      top:1.8em;
      left:0.6em;
      font-weight:700;
      font-size:1.05em;
      color:rgba(255,255,255,0.8);
      letter-spacing:0.1em;
  }
}


.container {
  width:13em;
  height:13em;
  background:darken(#ddd,5%);
  margin:19em auto 0;
  position:relative;
  @include border-radius(100%);
  @include box-shadow(0 0.2em 0.75em rgba(0,0,0,0.5));
  &:after {
      content:"";
      position:absolute;
      display:block;
      @include border-radius(100% 100% 0 0);
      width:6em;
      height:7em;
      background:transparent;
      top:-6em;
      left:1.5em;
      z-index:-1;
      border:2em solid darken(#ddd,5%);
      border-bottom:0;
      @include box-shadow(0 0.3em 0.75em rgba(0,0,0,0.5), inset 0 0.2em 0.75em rgba(0,0,0,0.5));
    }
    &:before {
      content:"";
      position:absolute;
      display:block;
      width:0.3em;
      height:0.7em;
      background:darken(red,20%);
      left:49%;
      top:1.5em;
      z-index:50;
      @include border-radius(1em);
      @include box-shadow(inset 0 0.1em 0.1em black, inset -0.1em -0.1em 0.1em white);
    }
}


.lock li:nth-child(5n+1) {
  font-weight:700;
}


.gotFirst {
  &:before {
      content:"[\2713][3][7]";
    }
}
.gotSecond {
  &:before {
      content:"[\2713][\2713][7]";
    }
}
.gotThird {
  &:before {
      content:"Boo yah!";
      font-size:6em;
    }
    .container {
      top:-100em;
      @include transition(all 5s);
      @include transition-delay(1.25s);
      position:relative;
      &.container:after {
          top:-7em;
          left:3em;
          @include transform(rotate(15deg));
          @include transition(all 1s);
        }
    }
}
            
          
!

JS

            
              var min = $(".lock").width();
var max = $(window).width();

$(window).resize(function () {
  var sizeNow = $(this).width();
  
  var num1 = 37;
  var num2 = 3;
  var num3 = 7;
  
  var calc = ((sizeNow - min) / (max - min) * 360) - 360;
  
  // last number is for fine tuning
  var c1 = Math.round( (((num1 * 9) * max) / 360)) + 6;
  var c2 = Math.round( (((num2 * 9) * max) / 360) + (((max - min) * 2) + min)) - 5;
  var c3 = Math.round( c2 - ( (max - min) - (num3 - num2) * 9 ));
  
  $(".lock").css("-webkit-transform", "rotate(" + -calc + "deg)");  
  
  if (sizeNow === c1) {
    $("body").addClass("gotFirst");
  } else {
    $("body").attr('data-content',sizeNow - c1);
  }

  if ($('body').hasClass('gotFirst')) {
    if (sizeNow === c2) {
      $("body").addClass("gotSecond");
    } else {
      $("body").attr('data-content',sizeNow - c2);
    }
    
    if ($('body').hasClass('gotSecond')) {
      
      if (sizeNow === c3) {
        $("body").addClass("gotThird");
      } else {
        $("body").attr('data-content',sizeNow - c3);
        if ($('body').hasClass("gotThird")) {
        } else {}
      }
    }
  }
});
            
          
!
999px

Console