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

Packages

Add Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import or require. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

            
              %section.container
  #stack
    #card
      %figure.front.spade
      %figure.back
            
          
!
            
              @import compass

@mixin rotate( $degrees )
  -webkit-transform: rotate(#{$degrees}deg)
  -moz-transform: rotate(#{$degrees}deg)
  -ms-transform: rotate(#{$degrees}deg)
  -o-transform: rotate(#{$degrees}deg)
  transform: rotate(#{$degrees}deg)

$table: #00cc88
$cardback:  url(https://www.toptal.com/designers/subtlepatterns/patterns/pink%20dust.png)
$cardfront: #fafafa

body
  background: $table
.container
  width: 500px
  height: 500px
  position: relative
  perspective: 800px
  margin: 20px auto
#stack
  background: $cardback
  height: 325px
  width: 250px
  border-radius: 10px
  position: absolute
  box-shadow: 2px 2px 2px rgba(0,0,0,.2)
  box-sizing: border-box
  padding: 10px
  box-shadow: 2px 2px 2px rgba(0,0,0,.2)
  transform: rotate(2deg)
  &:before
    top: -2px
    left: -2px
    transform: rotate(-1deg)
  &:after
    top: -5px
    left: -6px
    transform: rotate(-1.5deg)
  &:before, &:after
    content: ""
    background: $cardback
    height: 325px
    width: 250px
    display: block
    border-radius: 10px
    position: absolute
    box-shadow: 2px 2px 2px rgba(0,0,0,.2)
  #card
    width: 250px
    height: 325px
    position: absolute
    transform-style: preserve-3d
    transition: transform .4s ease, margin .6s ease .2s
    left: -3px
    top: -3px
    figure
      display: block
      position: absolute
      width: 100%
      height: 100%
      backface-visibility: hidden
      border-radius: 10px
      transition-delay: transform 1s
      &.front
        background: $cardfront
        transform: rotateZ(2deg) rotateY(180deg)
        &:after
          color: #555
          font-size: 120px
          font-family: arial
          position: absolute
          top: 80px
        &.spade
          &:after
            content: '♠'
            left: 95px
        &.club
          &:after
            content: '♣'
            left: 85px
        &.heart
          &:after
            content: '❤'
            left: 70px
            color: rgba(255,90,25,.8)
        &.diamond
          &:after
            content: '♦'
            left: 95px
            color: rgba(255,90,25,.8)
      &.back
        background: $cardback
  &:hover
    #card
      margin: -8px 0px 0px 300px
      transform: rotateY(-180deg)
      transition: transform .6s ease .4s, margin .8s ease
      figure
        box-shadow: 2px 2px 2px rgba(0,0,0,.2)
        
      
            
          
!
            
              // Try a class of 'spade', 'club', 'diamond', or 'heart' for other aces
// Future missions (feel free to fork and help)
// Create combo class for any card. IE figure.front.three.spade = 3 of spades
// Why? I don't know.
            
          
!
999px

Console