123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm 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. We'll also process your JavaScript with Babel.

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

Code Indentation

     

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.

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.

            
              <!-- vue and vue-flipper JS -->
<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/vue-flipper"></script>

<!-- vue-flipper CSS -->
<link rel="stylesheet" href="https://unpkg.com/vue-flipper/dist/vue-flipper.css" />

<div id="app">
  <flipper
    class="Card"
    width="270px"
    height="300px"
    :flipped="isFlipped"
    @click="isFlipped = !isFlipped"
  >
    <div class="Card__face" slot="front">
      <span class="Card__value Card__value--top">10</span>
      <span class="Card__center">♣</span>
      <span class="Card__value Card__value--bottom">10</span>
    </div>

    <figure class="Card__pattern" slot="back"></figure>
  </flipper>
</div>
            
          
!
            
              .Card
  &__face
  &__pattern
    width 100%
    height @width
    border-radius 20px
    box-shadow 0 3px 15px rgba(#000, .45)
    cursor pointer

  &__pattern
    background-image url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iNjAiIGhlaWdodD0iMzAiPgo8ZGVmcz4KPHJlY3QgaWQ9InIiIHdpZHRoPSIzMCIgaGVpZ2h0PSIxNSIgZmlsbD0iI2JiMDg1ZiIgc3Ryb2tlLXdpZHRoPSIyLjUiIHN0cm9rZT0iIzdhMDU0ZCI+PC9yZWN0Pgo8ZyBpZD0icCI+Cjx1c2UgeGxpbms6aHJlZj0iI3IiPjwvdXNlPgo8dXNlIHk9IjE1IiB4bGluazpocmVmPSIjciI+PC91c2U+Cjx1c2UgeT0iMzAiIHhsaW5rOmhyZWY9IiNyIj48L3VzZT4KPHVzZSB5PSI0NSIgeGxpbms6aHJlZj0iI3IiPjwvdXNlPgo8L2c+CjwvZGVmcz4KPHVzZSB4bGluazpocmVmPSIjcCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtMjUpIHNrZXdZKDQwKSI+PC91c2U+Cjx1c2UgeGxpbms6aHJlZj0iI3AiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDMwIDApIHNrZXdZKC00MCkiPjwvdXNlPgo8L3N2Zz4=')

  &__face
    position: relative

  &__value
    position absolute
    font-size 18pt

    &--top
      top: 10px
      left: @top

    &--bottom
      right: 10px
      bottom: @right

  &__center
    position absolute
    top 50%
    left 50%
    display block
    font-size 32pt
    transform translateX(-50%) translateY(-50%)

// =========================== //
// Centralize <body>'s content //
// =========================== //
html
body
  height 100%

body
  display flex
  align-items center
  justify-content center

            
          
!
            
              Vue.component('Flipper', VueFlipper);

new Vue({
  el: '#app',
  data: {
    isFlipped: true
  }
});

            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console