vue-mo-js

1.0.0 • Public • Published

Vue Mo.js

A Vue JS wrapper for the awesome Mo.js

Limitations

This wrapper currently only supports the burst mo.js component. I may look to add more in the future. It makes it simple to add mojs burst animations to a clickable element in your Vue.js application by adding the vue directive v-mojs

Installation

npm install vue-mo-js --save

Then add the following to your main vue file

import VueMoJS from 'vue-mo-js'
Vue.use(VueMoJS)

Usage

Add this to any element that you want the burst to appear on once it has been clicked.

<a href="/" v-mojs="mojsOptions">Burst Element<a>

Then in your Vue template data option add the mo-js options.

data : function(){
        return {
          mojsOptions : {
            count : 6,
            radius: { 15: 100 },
            origin: '100% 100%',
            degree: 360,
            children: {
              shape: 'polygon',
              fill: ['black','white'],
              isSwirl:true,
              swirlSize: 10,
              swirlFrequency: 2,
              delay: 'stagger(0, 30)'
            }
          }
        }
      }

Now when you click on the html anchor tag it will display the mojs burst.

Please note that there is no need to add the parent mojs option to the data option as the wrapper will pick this up automatically.

A full list of Mo.js Burst options can be found here

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i vue-mo-js

    Weekly Downloads

    9

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    2.58 kB

    Total Files

    3

    Last publish

    Collaborators

    • aaronlumsden