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

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

CSS

              
                @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)
        
      
              
            
!

JS

              
                // 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