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

              
                #flipMe 
  span Click for flippin' good times!
.flip
  .front#website
    .container
      h1 Im a totally normal website
      p Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et  dolore magna aliqua.

      p Trimmed driving gloves andrew weatherall dick dastardly knavish rogue what a bounder. Decathlon champion fu manchu hairy lipsum face broom bogie basket man of the year 1986 lady magnets east european?

      p Socially mobile clive dunn walrus smashing good fun rock n roll star musketeer? Tudor philosopher rock n roll star brandy mark lawrenson, boxing champion tudor philosopher mark lawrenson crumb catcher brandy dis rock n roll star, dis helllloooo consectetur gentleman crumb catcher rock n roll star fu manchu boxing champion tudor philosopher brandy mark lawrenson.

      img(src="http://lorempixel.com/400/200/?v=1")

      p Lemmy glorious facial hair brush zap rowsdower comb terry thomas country baron? Goose brush nefarious musketeer Daniel plainview grooming hold steady keyboardist, brush tudor philosopher great dictator goose freestyle hold steady keyboardist handsome musketeer 118 118 grooming Daniel plainview Daniel plainview hello, we’re cockneys nefarious class definer, 118 118 hold steady keyboardist brush tudor philosopher by jingo. decathlon champion brush old west sheriff grooming Daniel plainview musketeer freestyle freestyle class definer hello, we’re cockneys goose great dictator handsome nefarious Daniel plainview?

      p Boogie nights French café patron cardinal richelieu timothy dalton, timothy dalton toothbrush cardinal richelieu French café patron musketeer joseph stalin boogie nights spaghetti western, cardinal richelieu timothy dalton toothbrush joseph stalin French café patron groomed boogie nights musketeer off-piste lipwig spaghetti western funny walk. Waxy gurn casual style country baron et sodales cum circus strongman.

      h3 Funny walk lady magnets lemmy.

      p Rock n roll star sam elliott toothbrush, groucho marx toothbrush rock n roll star facial accessory will you do the fandango toothbrush Fallen eyebrow sam elliott.

      img(src="http://lorempixel.com/400/200/?v=2")

      p Alpha trion will you do the fandango mouth coiffure mr frothy-top man of the year 1986 tip top old bean. Andrew weatherall basil fawlty toothbrush frightfully nice brush helllloooo gunslinger old west sheriff, great dictator old west sheriff helllloooo gunslinger brush magnum pi frightfully nice godlike toothbrush id andrew weatherall basil fawlty?

      p Hair trimmer dick van dyke tip top old bean will you do the fandango movember jolly good show casual style cappuccino catcher, hair trimmer caterpillar movember freestyle will you do the fandango tip top old bean cigars facial accessory hairy kiss. jolly good show casual style cappuccino catcher lip warmer dick van dyke?

      p Fallen eyebrow driving gloves will you do the fandango ron jeremy cappuccino collector gunslinger?

      p Lemmy glorious facial hair brush zap rowsdower comb terry thomas country baron? Goose brush nefarious musketeer Daniel plainview grooming hold steady keyboardist, brush tudor philosopher great dictator goose freestyle hold steady keyboardist handsome musketeer 118 118 grooming Daniel plainview Daniel plainview hello, we’re cockneys nefarious class definer, 118 118 hold steady keyboardist brush tudor philosopher by jingo. decathlon champion brush old west sheriff grooming Daniel plainview musketeer freestyle freestyle class definer hello, we’re cockneys goose great dictator handsome nefarious Daniel plainview?

  .back#hiddenEaster
    .page
      .container
        h1 I hide behind your websites and chuckle mildly at your Inadequacies!
        p Muhaha! haha! ha! LOLZ!
        img(src="http://www.quick-break.net/c/2013/01/11/Here_s_a_happy_goat.jpeg")
              
            
!

CSS

              
                /*FLIPPING STYLES*/
$speed:1s;
$perspective:1000px;
body {
  -webkit-perspective: $perspective;
  perspective: $perspective;
}
.flip {
  width:100%;
  height:100%;
  position:relative;
  z-index:0;
  -webkit-perspective: $perspective;
  perspective: $perspective;
  .front,
  .back {
    transform:translate3d(0,0,0);
    -webkit-transform:translate3d(0,0,0);
    -webkit-backface-visibility:hidden;
    backface-visibility:hidden;
    -webkit-perspective:$perspective;
    perspective:$perspective;
    -webkit-transition:$speed;
    transition:$speed;
    -webkit-transform-style:preserve-3d;
    transform-style:preserve-3d;
    position:absolute;
    top:0;
    right:0;
    bottom:0;
    left:0;
    overflow:auto;
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
  }
  .front {
    -webkit-transform:rotateY(0deg);
    transform:rotateY(0deg);
    z-index:2;
  }
  .back {
    -webkit-transform:rotateY(-179deg);
    transform:rotateY(-179deg);
    z-index:1;
  }
  //when flipped
  &.flipped {
    .front {
      -webkit-transform:rotateY(180deg);
      transform:rotateY(180deg);
      z-index:1;
    }
    .back {
      -webkit-transform:rotateY(0deg);
      transform:rotateY(0deg);
      z-index:2;
    }
  }
}
/*GENERAL STYLES*/
body,html {
  background:#000;
  height:100%;
  font-family:"lato",Arial,Helvetica,sans-serif;
  font-weight:300;
  line-height:1.3em;
  overflow:hidden;
}
body {
  background:url("https://camo.githubusercontent.com/2866b792051437ca694bf0648288ad55ab66d883/68747470733a2f2f7261772e6769746875622e636f6d2f6875676f66657272656972612f677265617465722d6d6f6e6f6b61692f6d61737465722f73637265656e73686f742d64617263756c612e706e67") no-repeat center center;
  background-size:cover;
  box-shadow:0px 0px 500px #000 inset;
}
h1,h2,h3,h4,h5,h6 {
  font-weight:400;
  text-transform:uppercase;
  font-family:"oswald",Arial,Helvetica,sans-serif;
  line-height:1.3em;
}
.container {
  width:80%;
  max-width:960px;
  margin:50px auto;
}
#flipMe {
  position:absolute;
  top:-60px;
  left:-120px;
  cursor:pointer;
  background:#F5BB4A;
  color:#333;
  z-index:10;
  -webkit-transform:rotate(-45deg);
  transform:rotate(-45deg);
  text-align:center;
  box-shadow:10px 10px 5px rgba(0,0,0,0.1);
  font-family:"oswald",Arial,Helvetica,sans-serif;
  font-weight:400;
  text-transform:uppercase;
  transition:all 0.5s;
  text-shadow:0px 1px rgba(255,255,255,0.5);
  &:hover {
    background:#FFAE19;
  }
  span {
    padding:100px 100px 20px 100px;
    width:100px;
    display:block;
  }
}
#website {
  background:#fff;
  img {
    float:left;
    margin:0 20px 10px 0;
  }
  img:nth-child(2n){
    float:right;
    margin:0 0 10px 20px;
  }
}
#hiddenEaster {
  background:#FF4949;
  color:#fff;
  img {
    width:100%;
    height:auto;
    max-width:100%;
  }
}
              
            
!

JS

              
                //on doc ready
$(document).ready(function(){
  flipper();
});

//the flipper js helper
function flipper(){
  
  //grab the els we need
  var trigger   = $("#flipMe");
  var flip      = $(".flip");
  var sides     = flip.find(".front,.back");
  
  //sniff for IE
  var msie = (/Trident\/7\./).test(navigator.userAgent);
  
  //work out the duration of the animation in ms (used in the ie fix)
  var duration  = sides.css("transition-duration") || "30s";
  duration = parseInt(duration)*1000;
  
  //on click of trigger
  trigger.on("click",function(){
    
    //toggle flipped class to trigger css animation
    flip.toggleClass("flipped");
    
    //change the text in the button
    if(flip.hasClass("flipped")){
      trigger.find("span").text("I cower at your goaty waddles!");
    }else{
      trigger.find("span").text("Click for flippin' good times!");
    }
    
    //IE FIX
    //having overflow or perspective on the flipped elements breaks backface visibility in ie. 
    //We want to keep perspective so we remove the overflow of the els during the animation
    if(msie){
      sides.css("overflow","hidden");
      setTimeout(function(){
        sides.css("overflow","");
      },duration);
    }
    
  });
  
}
              
            
!
999px

Console