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

              
                <script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.14.1/lodash.min.js"></script>

<body>
  
<div id="list-complete-demo" class="demo">
  <div class="menu">
    <button v-on:click="add">Add</button>
    <!-- <button v-on:click="remove">Remove</button> -->
  </div>
  
<div class="section-content justify-content">
  
    <transition-group mode="in-out" name="slideme">
      <div
        v-for="(item, index) in items"
        v-on:click="removeItem(index)"
        v-bind:key="item"
        class="boxframe"
           >
        {{ item }}
        <p>click to delete</p>
      </div>
    </transition-group>
  </div>

</div>
  
</body>
              
            
!

CSS

              
                html {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
*, *:before, *:after {
  -webkit-box-sizing: inherit;
  -moz-box-sizing: inherit;
  box-sizing: inherit;
}

.menu {
  position: fixed;
  width: 100%;
  height: 35px;
  top: 0;
  left: 0;
  margin-top: 25px;
  text-align: center;
  z-index: 100;
}

.demo {
  position: fixed;
  display: block;
  left: 0;
  top: 0;
  margin: 0 auto;
  padding-top: 65px;
  width: 100vw;
  height: 100vh;
  border: solid 1px red;
  overflow: scroll;
}

.boxframe {
  transition: all 1s;
  cursor: pointer;
  display: inline-block;
  position: relative;
  max-width: 1150px;
  height: 200px;
  color: white;
  text-align: center;
  padding 30px 30px 30px 30px;
  background-color: gray;
  border: solid 1px red;
  /* margin-right: 10px;*/
}

.boxframe p {
  position: absolute;
  width: 100%;
}

/* ****** START Grid ****** */

@media all and (min-width: 801px) {
  .boxframe {float:left; width:32%; margin:0 2% 1em 0; }
  .boxframe:nth-of-type(3n+3) {margin-right:0;}
  .boxframe img {width:100%; height:auto; margin:0;}
  .boxframe:nth-of-type(3n+4) {clear:left;}
  .boxframe:nth-last-child(1) {margin: 0;}
}


@media all and (min-width: 501px) and (max-width: 800px) {
  .boxframe {float:left; width:49%; margin:0 2% 1em 0; }
  .boxframe:nth-of-type(even) {margin-right:0;}
  .boxframe img {width:100%; height:auto; margin:0;}
  .boxframe:nth-of-type(even) {clear:right;}
}


@media all and (max-width: 500px) {
  .boxframe {float:left; width:100%; margin:0 0 .75em 0; }
  .boxframe:nth-of-type(3n+3) {margin-right:0;}
  .boxframe img {width:100%; height:auto; margin:0;}
  .boxframe:nth-of-type(3n+4) {clear:left;}
}

.justify-content {
  text-align: left;
  font-size: 1em; /* IE 9 & 10 don't like font-size: 0; */
}

.justify-content:after {
  content: '';
  width: 100%; /* Ensures there are at least 2 lines of text, so justification works */
  display: inline-block;
}

.justify-content div {
  float: none;
}


/* Nope - it's not the issue */

.justify-content .columns:last-child:not(:first-child) {
    float: none;
}


.justify-content:nth-last-child(n) {
	text-align: center;
}



/* ****** END Grid ****** */



/* slideme in or out - modal-button */

.slideme-enter {
  opacity: 0;
  width: 0;
}

.slideme-enter-active {
  transition: all .35s ease-in;
}


@media all and (min-width: 801px) {
  .slideme-enter-to {
    /* Vue JS Default is opacity: 1; */
    width: 32%;
    /* max-width: 10.6%; */
  }
}

@media all and (min-width: 501px) and (max-width: 800px) {
  .slideme-enter-to {
    /* Vue JS Default is opacity: 1; */
    width: 49%;
    /* max-width: 24.5%; */
  }
}

@media all and (max-width: 500px) {
  .slideme-enter-to {
    /* Vue JS Default is opacity: 1; */
    width: 100%;
  }
}



@media all and (min-width: 801px) {
  .slideme-leave {
    /* Vue JS Default is opacity: 1; */
    width: 32%;
    /* max-width: 10.6%; */
  }
}

@media all and (min-width: 501px) and (max-width: 800px) {
  .slideme-leave {
    /* Vue JS Default is opacity: 1; */
    width: 49%;
    /* max-width: 24.5%; */
  }
}

@media all and (max-width: 500px) {
  .slideme-leave {
    /* Vue JS Default is opacity: 1; */
    width: 100%;
    /* height: 100%; */
  }
}

.slideme-leave-active {
  transition: all .35s ease-out;
  position: absolute;
  /* this need to be absolute to get out of the other elements way during the transition */
}

.slideme-leave-to {
  opacity: 0;
  width: 0;
  /* height: 0; */
}

.slideme-move {
  transition: transform 1.35s;
}
              
            
!

JS

              
                

new Vue({
  el: '#list-complete-demo',
  data: {
    items: [1,2,3,4],
    message: 'click to delete',
    nextNum: 10
  },
  methods: {

    removeItem: function (index) {
      this.items.splice(index, 1);
    },
    randomIndex: function () {
      return Math.floor(Math.random() * this.items.length)
    },
    add: function () {
      this.items.splice(this.randomIndex(), 0, this.nextNum++)
    },
    remove: function () {
      this.items.splice(this.randomIndex(), 1)
    },
    shuffle: function () {
      this.items = _.shuffle(this.items)
    }
  }
})
              
            
!
999px

Console