Skip to content

A Vue plugin for adding Anime bindings to Vue components

License

Notifications You must be signed in to change notification settings

BenAHammond/vue-anime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vue-Anime

Simple Vue bindings for Anime.js

Install

$ npm install --save vue-animejs
import VueAnime from 'vue-animejs';

Vue.use(VueAnime)

Usage

Adds a simple directive named v-anime that passes all arguments directly to anime.js

<div v-anime="{ rotate: '1turn', backgroundColor: '#FFF', duration: 2000, loop: true }"></div>

Also adds this.$anime to your components

export default {
  name: "my-component",
  data() {
    return {};
  },
  mounted() {
    const targets = this.$el;
    this
      .$anime
      .timeline()
      .add({
        targets,
        translateX: 250,
        easing: 'easeOutExpo',
      })
      .add({
        targets,
        translateX: 250,
        easing: 'easeOutExpo',
      });
      /* ... etc ... */
  },
}

About

A Vue plugin for adding Anime bindings to Vue components

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published