startv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource
via CSS Lint

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource
via JS Hint

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Want a Run Button?

If active, the preview will update automatically when you change code.

HTML

            
              <article>
  <div class="overlay" data-state="0"></div>
  
  <div class="wrapper">
    <h1>My money's in that office, right?</h1>
  
    <section>
    <p>
     If she start giving me some bullshit about it ain't there, and we got to go someplace else and get it, I'm gonna shoot you in the head then and there. Then I'm gonna shoot that bitch in the kneecaps, find out where my goddamn money is. She gonna tell me too.
    </p>
    <p>
    Hey, look at me when I'm talking to you, motherfucker. You listen: we go in there, and that nigga Winston or anybody else is in there, you the first motherfucker to get shot.
    </p>
    </section>
  
    <h2>You understand?</h2>
  </div>
</article>
            
          
!

CSS

            
              @import "compass/css3";

@import url(http://fonts.googleapis.com/css?family=Dosis:400,700,800);

* {
  @include box-sizing (border-box);
}

body {
  margin: 1em;
  font: 2em 'Dosis', sans-serif;
  overflow-x:hidden;
}

.overlay {
  position:absolute;
  top:0;
  left:0;
  width:200px;
  height:200px;
  border-radius:50%;
  box-shadow: 
    /* overlay */
    0 0 0 200em rgba(255, 255, 255, 1)
  ;
  border: .35em solid #666;
  @include background(radial-gradient(rgba(255, 255, 255, 0) 0%, rgba(0, 0, 0, .4) 80%));
  
  @include transition(
    transform .2s ease-in-out, 
    background .2s ease-in-out,
    box-shadow .35s ease-in-out,
    border .15s ease-in-out
  );
  
  &:after {
    $factor: 3;
    position:absolute;
    left:50%;
    top:50%;
    height:.15em * $factor;
    width:.15em * $factor;
    margin:-.075em * $factor 0 0 -.075em * $factor;
    border-radius:50%;
    background:rgba(0, 0, 0, .2);
  }
  
  &[data-state="1"] {
    @include transform(scale(2, 2));
    @include background(radial-gradient(rgba(255, 255, 255, 0) 0%, rgba(0, 0, 0, .4) 80%),
      radial-gradient(rgba(255, 0, 0, .4) 10%, rgba(200, 0, 0, .1) 30%));
    
    box-shadow: 
      /* overlay */
      0 0 0 200em rgba(255, 255, 255, 1),
    
      /* lens */
      inset 0 -1em 0 .05em rgba(120, 120, 120, .4),
      inset 0 1em 0 .05em rgba(120, 120, 120, .4)
    ;
    
    border: .5em solid #B83D4B;
    
    &:after {
      content:'';
    }
    
    + .wrapper {
      font-size:1.25em;
    }
  }
}

.wrapper {
  @include transition(
    font-size .25s ease-in-out
  );
}

article {
  h1 {
    font-weight:800;
    font-size:2.25em;
    color: rgba(240,192,0,.8);
    margin:1em 0;
  }
  
  h2 {
    font-weight:700;
    color: rgba(240,0,0,.8);
    margin:.5em 0;
  }
  
  section {
    @include columns(10em 2);
  }
}
            
          
!

JS

            
               /**
  Creepy eye

  Move the creepy eye to show the content hidden by a overlay (box-shadow).

  Inspired by nimbletank.com (Thanks to Francesco Trillini)

  # 2013 by Tim Pietrusky
  # timpietrusky.com
**/

var overlay = document.querySelector('.overlay'),
    height = 200,
    width = 200;

/**
 * Change position of overlay on movement
 */
document.addEventListener('mousemove', function(e) {
  setPosition(e);
});

document.addEventListener('touchmove', function(e) {
  setPosition(e);
});

/**
 * Change state of overlay on click/touch stuff
 */
overlay.addEventListener('click', function(e) {
  if (overlay.dataset['state'] == 0) {
    overlay.dataset['state'] = 1;
  } else {
    overlay.dataset['state'] = 0;
  }
  
  setPosition(e);
});

function setPosition(e) {
  overlay.style.top = e.pageY - height / 2 + "px";
  overlay.style.left = e.pageX - width / 2 + "px";
}
            
          
!
999px
Loading ..................

Console