1.0.3 • Published 4 years ago

vue-animate-component v1.0.3

Weekly downloads
2
License
ISC
Repository
-
Last release
4 years ago

vue-animation-component

Setup

via yarn:

$ yarn add vue-animate-component

via npm:

$ npm i --save vue-animate-component

Example

Props are based on Keyframe Formats and EffectTiming.
You can control the start timing of the animation by setting v-model attribute.

<template>
  <div id="app">
    <div id="rect">
      <animation v-model="active" :duration="1000" easing="ease">
        <keyframe transform="translate(0, 0)" :offset="0" />
        <keyframe transform="translate(100px, 0)" :offset="0.25" />
        <keyframe transform="translate(50px, 0)" :offset="0.5" />
        <keyframe transform="translate(120px, 0)" :offset="1" />
      </animation>
    </div>
    {{ active ? 'Animating' : 'Stopping' }}
    <button @click="active = !active">Toggle</button>
  </div>
</template>

<script>
import { Animation, Keyframe } from 'vue-animate-component'
export default {
  components: {
    Animation,
    Keyframe
  },
  data() {
    return {
      active: false
    }
  }
}
</script>

<style>
#rect {
  width: 100px;
  height: 100px;
  background-color: red;
}
</style>

Author

shundroid

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago