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

              
                <div id="app">
  <div id="panel">
    <label>Choose a library:
      <select v-model="library" @change="libraryChange">
        <option v-for="lib in libraries" :key="lib">{{ lib }}</option>
      </select>
    </label>
    
    <br />
    
    <p>Website: <a :href="libraryData[library].url" :title="`${libraryData[library].name} website`">{{ libraryData[library].url }}</a></p>
    
    <br />
    
    <p>Animation Types: <button @click="type = 'transitions'">Transitions</button> <button @click="type = 'attention'">Attention</button></p>
    
    <br />
    
    <template v-if="type === 'transitions'">
      <p>Choose the animation for the first element leaving:</p>
      <label>Leave animation:
        <select id="leave" v-model="leave">
          <option v-for="c in libraryData[library].classes.leave" :key="c">{{ c }}</option>
        </select>
      </label>
      <p>leave-active-class="{{ libraryData[library].static }} {{ leave }}"</p>

      <br />

      <p>Choose the animation for the second element entering:</p>
      <label>Enter animation:
        <select id="enter" v-model="enter">
          <option v-for="c in libraryData[library].classes.enter" :key="c">{{ c }}</option>
        </select>
      </label>
      <p>enter-active-class="{{ libraryData[library].static }} {{ enter }}"</p> 
    </template>
    
    <template v-if="type === 'attention'">
      <p>Choose the animation for hover:</p>
      <label>
        <select id="hover" v-model="hover">
          <option v-for="hover in libraryData[library].classes.hover" :key="hover">{{ hover }}</option>
        </select>
      </label>
      <p>If the infinite box is not animating, it likely means the library only works for hover states.</p>
    </template>
  </div>
  
  <div v-if="type === 'transitions'" id="box_container" key="transitions">
    <div class="container">
      <transition
        :enter-active-class="enterClass"
        :leave-active-class="leaveClass"
        mode="out-in"
        :class="{animated: true}"
      >
        <div v-if="toggle" class="box1" key="if"></div>
        <div v-else class="box2" key="else"></div>
      </transition>
    </div>
    <button v-if="type === 'transitions'" @click="toggle = !toggle">transition elements</button>
  </div>
  
  <div v-if="type === 'attention'" id="box_container" key="attention">
    <div class="container">
      <div class="box1" @mouseenter="attentionHover = true" @mouseleave="attentionHover = false" :class="[libraryData[library].static, attentionHover ? hover : null]">hover</div>
      <div class="box2 infinite" :class="[libraryData[library].static, hover]">infinite</div>
    </div>
  </div>
</div>

              
            
!

CSS

              
                html {
  box-sizing: border-box;
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
}
*, *:before, *:after {
  box-sizing: inherit;
}

html,
body {
  background-color: #1d1e22;
  height: 100vh;
  margin: 0;
  overflow: hidden;
  padding: 0;
  position: relative;
  width: 100vw;
}

p,
label{
  display: block;
  margin: 10px;
}

a {
  color: #fff;
  
  &:hover {
    color: rebeccapurple;
  }
}

button,
select {
  font-size: 16px;
  margin: 0 10px;
  padding: 5px 10px;
}

#app {
  display: flex;
  height: 100%;
  width: 100%;
}

#panel {
  align-items: center;
  color: #fff;
  display: flex;
  flex-basis: 50%;
  flex-direction: column;
  justify-content: center;
  overflow: auto;
}

#box_container {
  align-items: center;
  border-top: 3px solid #707070;
  display: flex;
  flex-basis: 50%;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  
  .container {
    align-items: center;
    background-color: #707070;
    border: {
      color: #C5C5C5;
      style: solid;
      width: 3px;
    }
    display: flex;
    height: 200px;
    justify-content: center;
    margin: 20px;
    overflow: hidden;
    width: 300px;
  }
  
  .box1 {
    align-items: center;
    background-color: white;
    border: 4px solid #307B21;
    display: flex;
    height: 100px;
    justify-content: center;
    width: 100px;
  }
  .box2 {
    align-items: center;
    background-color: white;
    border: 4px solid rebeccapurple;
    display: flex;
    height: 100px;
    justify-content: center;
    width: 100px;
  }
  .infinite {
    animation-iteration-count: infinite;
    margin-left: 50px;
  }
}




/* ----------------------------------------------
 * Generated by Animista on 2019-3-20 23:56:28
 * w: http://animista.net, t: @cssanimista
 * ---------------------------------------------- */
.scale-in-center{animation:scale-in-center .5s cubic-bezier(.25,.46,.45,.94) both}
@keyframes scale-in-center{0%{transform:scale(0);opacity:1}100%{transform:scale(1);opacity:1}}
.scale-in-hor-center{animation:scale-in-hor-center .5s cubic-bezier(.25,.46,.45,.94) both}
@keyframes scale-in-hor-center{0%{transform:scaleX(0);opacity:1}100%{transform:scaleX(1);opacity:1}}
.scale-in-ver-center{animation:scale-in-ver-center .5s cubic-bezier(.25,.46,.45,.94) both}
@keyframes scale-in-ver-center{0%{transform:scaleY(0);opacity:1}100%{transform:scaleY(1);opacity:1}}
.slit-in-vertical{animation:slit-in-vertical .45s ease-out both}
@keyframes slit-in-vertical{0%{transform:translateZ(-800px) rotateY(90deg);opacity:0}54%{transform:translateZ(-160px) rotateY(87deg);opacity:1}100%{transform:translateZ(0) rotateY(0)}}
.slide-in-bck-center{animation:slide-in-bck-center .7s cubic-bezier(.25,.46,.45,.94) both}
@keyframes slide-in-bck-center{0%{transform:translateZ(600px);opacity:0}100%{transform:translateZ(0);opacity:1}}
.slide-in-elliptic-top-fwd{animation:slide-in-elliptic-top-fwd .7s cubic-bezier(.25,.46,.45,.94) both}
@keyframes slide-in-elliptic-top-fwd{0%{transform:translateY(-600px) rotateX(-30deg) scale(0);transform-origin:50% 100%;opacity:0}100%{transform:translateY(0) rotateX(0) scale(1);transform-origin:50% 1400px;opacity:1}}
.bounce-in-top{animation:bounce-in-top 1.1s both}
@keyframes bounce-in-top{0%{transform:translateY(-500px);animation-timing-function:ease-in;opacity:0}38%{transform:translateY(0);animation-timing-function:ease-out;opacity:1}55%{transform:translateY(-65px);animation-timing-function:ease-in}72%{transform:translateY(0);animation-timing-function:ease-out}81%{transform:translateY(-28px);animation-timing-function:ease-in}90%{transform:translateY(0);animation-timing-function:ease-out}95%{transform:translateY(-8px);animation-timing-function:ease-in}100%{transform:translateY(0);animation-timing-function:ease-out}}
.swing-in-top-fwd{animation:swing-in-top-fwd .5s cubic-bezier(.175,.885,.32,1.275) both}
@keyframes swing-in-top-fwd{0%{transform:rotateX(-100deg);transform-origin:top;opacity:0}100%{transform:rotateX(0deg);transform-origin:top;opacity:1}}
.puff-in-hor{animation:puff-in-hor .7s cubic-bezier(.47,0.000,.745,.715) both}
@keyframes puff-in-hor{0%{transform:scaleX(2);filter:blur(2px);opacity:0}100%{transform:scaleX(1);filter:blur(0);opacity:1}}
.flicker-in-1{animation:flicker-in-1 2s linear both}
@keyframes flicker-in-1{0%{opacity:0}10%{opacity:0}10.1%{opacity:1}10.2%{opacity:0}20%{opacity:0}20.1%{opacity:1}20.6%{opacity:0}30%{opacity:0}30.1%{opacity:1}30.5%{opacity:1}30.6%{opacity:0}45%{opacity:0}45.1%{opacity:1}50%{opacity:1}55%{opacity:1}55.1%{opacity:0}57%{opacity:0}57.1%{opacity:1}60%{opacity:1}60.1%{opacity:0}65%{opacity:0}65.1%{opacity:1}75%{opacity:1}75.1%{opacity:0}77%{opacity:0}77.1%{opacity:1}85%{opacity:1}85.1%{opacity:0}86%{opacity:0}86.1%{opacity:1}100%{opacity:1}}
.scale-out-center{animation:scale-out-center .5s cubic-bezier(.55,.085,.68,.53) both}
@keyframes scale-out-center{0%{transform:scale(1);opacity:1}100%{transform:scale(0);opacity:1}}
.scale-out-horizontal{animation:scale-out-horizontal .5s cubic-bezier(.55,.085,.68,.53) both}
@keyframes scale-out-horizontal{0%{transform:scaleX(1);opacity:1}100%{transform:scaleX(0);opacity:1}}
.scale-out-vertical{animation:scale-out-vertical .5s cubic-bezier(.55,.085,.68,.53) both}
@keyframes scale-out-vertical{0%{transform:scaleY(1);opacity:1}100%{transform:scaleY(0);opacity:1}}
.slit-out-vertical{animation:slit-out-vertical .5s ease-in both}
@keyframes slit-out-vertical{0%{transform:translateZ(0) rotateY(0);opacity:1}54%{transform:translateZ(-160px) rotateY(87deg);opacity:1}100%{transform:translateZ(-800px) rotateY(90deg);opacity:0}}
.slide-out-bck-center{animation:slide-out-bck-center .5s cubic-bezier(.55,.085,.68,.53) both}
@keyframes slide-out-bck-center{0%{transform:translateZ(0);opacity:1}100%{transform:translateZ(-1100px);opacity:0}}
.slide-out-elliptic-top-bck{animation:slide-out-elliptic-top-bck .7s ease-in both}
@keyframes slide-out-elliptic-top-bck{0%{transform:translateY(0) rotateX(0) scale(1);transform-origin:50% 1400px;opacity:1}100%{transform:translateY(-600px) rotateX(-30deg) scale(0);transform-origin:50% 100%;opacity:1}}
.bounce-out-top{animation:bounce-out-top 1.5s both}
@keyframes bounce-out-top{0%{transform:translateY(0);animation-timing-function:ease-out}5%{transform:translateY(-30px);animation-timing-function:ease-in}15%{transform:translateY(0);animation-timing-function:ease-out}25%{transform:translateY(-38px);animation-timing-function:ease-in}38%{transform:translateY(0);animation-timing-function:ease-out}52%{transform:translateY(-75px);animation-timing-function:ease-in}70%{transform:translateY(0);animation-timing-function:ease-out}85%{opacity:1}100%{transform:translateY(-800px);opacity:0}}
.swing-out-top-bck{animation:swing-out-top-bck .45s cubic-bezier(.6,-.28,.735,.045) both}
@keyframes swing-out-top-bck{0%{transform:rotateX(0deg);transform-origin:top;opacity:1}100%{transform:rotateX(-100deg);transform-origin:top;opacity:0}}
.puff-out-hor{animation:puff-out-hor .9s cubic-bezier(.165,.84,.44,1.000) both}
@keyframes puff-out-hor{0%{transform:scaleX(1);filter:blur(0);opacity:1}100%{transform:scaleX(2);filter:blur(2px);opacity:0}}
.flicker-out-1{animation:flicker-out-1 2s linear both}
@keyframes flicker-out-1{0%{opacity:1}13.9%{opacity:1}14%{opacity:0;box-shadow:none}14.9%{opacity:0;box-shadow:none}15%{opacity:1}22.9%{opacity:1}23%{opacity:0;box-shadow:none}24.9%{opacity:0;box-shadow:none}25%{opacity:1}34.9%{opacity:1}35%{opacity:0;box-shadow:none}39.9%{opacity:0;box-shadow:none}40%{opacity:1}42.9%{opacity:1}43%{opacity:0;box-shadow:none}44.9%{opacity:0;box-shadow:none}45%{opacity:1}50%{opacity:1}54.9%{opacity:1}55%{opacity:0;box-shadow:none}69.4%{opacity:0;box-shadow:none}69.5%{opacity:1}69.9%{opacity:1}70%{opacity:0;box-shadow:none}79.4%{opacity:0;box-shadow:none}79.9%{opacity:1}80%{opacity:0;box-shadow:none}89.8%{opacity:0;box-shadow:none}89.9%{opacity:1;box-shadow:none}90%{opacity:0;box-shadow:none}100%{opacity:0}}
.vibrate {animation: vibrate-1 0.3s linear infinite both;}
@keyframes vibrate-1{0%{transform:translate(0)}20%{transform:translate(-2px, 2px)}40%{transform:translate(-2px, -2px)}60%{transform:translate(2px, 2px)}80%{transform:translate(2px, -2px)}100%{transform:translate(0)}}
.flicker {animation: flicker-1 2s linear infinite both;}
@keyframes flicker-1{0%,100%{opacity:1}41.99%{opacity:1}42%{opacity:0}43%{opacity:0}43.01%{opacity:1}47.99%{opacity:1}48%{opacity:0}49%{opacity:0}49.01%{opacity:1}}
.shake-horizontal {animation: shake-horizontal 0.8s cubic-bezier(0.455, 0.030, 0.515, 0.955) both;}
@keyframes shake-horizontal{0%,100%{transform:translateX(0)}10%,30%,50%,70%{transform:translateX(-10px)}20%,40%,60%{transform:translateX(10px)}80%{transform:translateX(8px)}90%{transform:translateX(-8px)}}
.jello {animation: jello-horizontal 0.9s both;}
@keyframes jello-horizontal{0%{transform:scale3d(1, 1, 1)}30%{transform:scale3d(1.25, 0.75, 1)}40%{transform:scale3d(0.75, 1.25, 1)}50%{transform:scale3d(1.15, 0.85, 1)}65%{transform:scale3d(0.95, 1.05, 1)}75%{transform:scale3d(1.05, 0.95, 1)}100%{transform:scale3d(1, 1, 1)}}
.wobble {animation: wobble-hor-bottom 0.8s both;}
@keyframes wobble-hor-bottom{0%,100%{transform:translateX(0%);transform-origin:50% 50%}15%{transform:translateX(-30px) rotate(-6deg)}30%{transform:translateX(15px) rotate(6deg)}45%{transform:translateX(-15px) rotate(-3.6deg)}60%{transform:translateX(9px) rotate(2.4deg)}75%{transform:translateX(-6px) rotate(-1.2deg)}}
.bounce {animation: bounce-top 0.9s both;}
@keyframes bounce-top{0%{transform:translateY(-45px);animation-timing-function:ease-in;opacity:1}24%{opacity:1}40%{transform:translateY(-24px);animation-timing-function:ease-in}65%{transform:translateY(-12px);animation-timing-function:ease-in}82%{transform:translateY(-6px);animation-timing-function:ease-in}93%{transform:translateY(-4px);animation-timing-function:ease-in}25%,55%,75%,87%{transform:translateY(0px);animation-timing-function:ease-out}100%{transform:translateY(0px);animation-timing-function:ease-out;opacity:1}}
.pulsate {animation: heartbeat 1.5s ease-in-out infinite both;}
@keyframes heartbeat{from{transform:scale(1);transform-origin:center center;animation-timing-function:ease-out}10%{transform:scale(0.91);animation-timing-function:ease-in}17%{transform:scale(0.98);animation-timing-function:ease-out}33%{transform:scale(0.87);animation-timing-function:ease-in}45%{transform:scale(1);animation-timing-function:ease-out}}
.blink {animation: blink-1 0.6s both;}
@keyframes blink-1{0%,100%,50%{opacity:1}25%,75%{opacity:0}}
              
            
!

JS

              
                var libraryData = {
  animate: {
  	name: 'animate.css',
    url: 'https://daneden.github.io/animate.css/',
    static: 'animated',
    classes: {
      enter: ['bounceIn','bounceInDown','bounceInLeft','bounceInRight','bounceInUp','fadeIn','fadeInDown','fadeInDownBig','fadeInLeft','fadeInLeftBig','fadeInRight','fadeInRightBig','fadeInUp','fadeInUpBig','flipInX','flipInY','lightSpeedIn','rotateIn','rotateInDownLeft','rotateInDownRight','rotateInDown','jackInTheBox','rollIn','zoomIn','zoomInDown','zoomInLeft','zoomInRight','zoomInUp','slideInDown','slideInLeft','slideInRight','slideInUp'],
      leave:['bounceOut','bounceOutDown','bounceOutLeft','bounceOutRight','bounceOutUp','fadeOut','fadeOutDown','fadeOutDownBig','fadeOutLeft','fadeOutLeftBig','fadeOutRight','fadeOutRightBig','fadeOutUp','fadeOutUpBig','flipOutX','flipOutY','lightSpeedOut','rotateOut','rotateOutDownLeft','rotateOutDownRight','rotateOutUpLeft','rotateOutUpRight','hinge','rollOut','zoomOut','zoomOutDown','zoomOutLeft','zoomOutRight','zoomOutUp','slideOutDown','slideOutLeft','slideOutRight','slideOutUp'],
      hover: ['bounce', 'flash', 'pulse', 'rubberBand', 'shake', 'swing', 'tada', 'wobble', 'jello', 'heartBeat']
    }
  },
  animista: {
    name: 'animista',
    url: 'http://animista.net/',
    static: '',
    classes: {
      enter: ['scale-in-center','scale-in-hor-center','scale-in-ver-center','slit-in-vertical','slide-in-bck-center','slide-in-elliptic-top-fwd','bounce-in-top','swing-in-top-fwd','puff-in-hor','flicker-in-1'],
      leave: ['scale-out-center','scale-out-horizontal','scale-out-vertical','slit-out-vertical','slide-out-bck-center','slide-out-elliptic-top-bck','bounce-out-top','swing-out-top-bck','puff-out-hor','flicker-out-1'],
      hover: ['vibrate', 'flicker', 'shake-horizontal', 'jello', 'wobble', 'bounce', 'pulsate', 'blink']
    }
  },
  tuesday: {
    name: 'tuesday',
    url: 'http://shakrmedia.github.io/tuesday/',
    static: 'animated',
    classes: {
      enter: ['tdFadeIn', 'tdFadeInDown', 'tdFadeInLeft', 'tdFadeInUp', 'tdFadeInRight', 'tdExpandIn', 'tdExpandInBounce', 'tdStampIn', 'tdStampInSwing', 'tdShrinkIn', 'tdShrinkInBounce', 'tdSwingIn', 'tdDropInLeft', 'tdDropInRight', 'tdPlopIn', 'tdPlopInDown', 'tdFadeInUp', 'tdHingeFlipIn'],
      leave: ['tdFadeOut', 'tdFadeOutDown', 'tdFadeOutLeft', 'tdFadeOutUp', 'tdFadeOutRight', 'tdExpandOut', 'tdExpandOutBounce', 'tdShrinkOut', 'tdShrinkOutBounce', 'tdSwingOut', 'tdHingeFlipOut'],
      hover: []
    }
  },
  csshake: {
  	name: 'csshake',
    url: 'https://elrumordelaluz.github.io/csshake/',
    static: '',
    classes: {
    	enter: [],
      leave: [],
      hover: ['shake', 'shake-hard', 'shake-slow', 'shake-little', 'shake-horizontal', 'shake-vertical', 'shake-rotate', 'shake-opacity', 'shake-crazy', 'shake-chunk']
    }
  }
}

new Vue({
  el: "#app",
  data: {
    toggle: true,
    enter: '',
    leave: '',
    hover: '',
    library: 'animate',
    libraryData: libraryData,
    libraries: ['animate','animista', 'tuesday', 'csshake'],
    type: 'transitions',
    attentionHover: false
  },
  computed: {
  	leaveClass: function () {
    	return `${this.libraryData[this.library].static} ${this.leave}`;
    },
  	enterClass: function () {
    	return `${this.libraryData[this.library].static} ${this.enter}`;
    }
  },
  methods: {
  	libraryChange () {
    	this.enter = '';
      this.leave = '';
    }
  }
});


              
            
!
999px

Console