vue-tweezing

Automatic tweening values nicely served in scoped slots
1,933 99
Install
npm install vue-tweezing
Latest Version:0.1.6
Vue:2
License:MIT
Last Updated:Jun 18, 2019
Links: GitHub  ·  npm
Maintainer: posva

vue-tweezing Build Status npm package coverage donate

Easy, customizable and automatic tweening nicely served in scoped slots

VueTweezing works with any tweening engine and provide easy integration with some engines like tween.js and Tweezer

Demo (TODO link)

Usage

Install it as a plugin:

import { Tweezing, tweezerHelper } from 'vue-tweezing'
// import Tweezer to use it as our Tweening engine
import Tweezer from 'tweezer.js'

// install the plugin with one single engines
// use the tweezerHelper to generate the function
// needed by VueTweezing to handle tweezing
Vue.use(Tweezing, {
  tweezer: tweezerHelper(Tweezer)
})

Use it as a component:

<Tweezing ref="tweezing" :to="value" duration="500" @end="doSomething">
  <pre slot-scope="tweenedValue">
    target: {{ value }}
    val: {{ tweenedValue }}
  </pre>
</Tweezing>

Change value as you would usually do:

const vm = new Vue({
  el: '#app',
  data: {
    value: 0
  }
})
// somewhere else
vm.value = 200

You can play with the tween object by accessing the property $tween in the Tweening component:

// given the example above
vm.$refs.tweezing.$tween.stop()

Passing tweening options

Any prop passed to Tweezing different from tween and to will be considered an option and passed

Supported Tweening engines

WIP

Tweezer

Tween.js

Adding your own

WIP

You can check the examples in src/index.js to see how to create your own helpers.

License

MIT

Related Packages

vue-femtotween

Vue 3 Composition API reactivity wrapper for femtoTween

4,400 0
@nativescript-community/tween

Natively wraps tween.js, a tweening engine for easy animations, incorporating op...

1,602 7
@productdevbook/motion

The motion library for Vue 3

1,072
fy-form-render3

测试环境版本新的更新

10,811
use-on-demand

按需使用的代码工具仓库。

5,487

Version History

Version Released Vue License
0.1.6 ^2.5.13 MIT
0.1.5 ^2.5.13 MIT
0.1.4 ^2.5.13 MIT
0.1.3 ^2.5.13 MIT
0.1.2 ^2.5.13 MIT