1.0.0 • Published 7 years ago

vue-parabola v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

vue-parabola

a vue-parabola base & inspired by react-native-smart-parabola

Usage

    const el = e.target.getBoundingClientRect()
    const shopCart = document.querySelector('.icon-shop')
    const shopCartBox = shopCart.getBoundingClientRect()
    const start = {
      x: el.left,
      y: el.top
    }
    const end = {
      x: shopCartBox.width / 2 + shopCartBox.left - 10,
      y: shopCartBox.height / 2 + shopCartBox.top - 10
    }
    this.$parabola({
      start: start,
      end: end,
      isTrigger: true,
      onParabolaFinish: () => {
        console.log('onParabolaFinish')
      }
    })

Props

PropTypeOptionalDefaultDescription
startobjectNodetermine the start coordinate (pageX, pageY)
endobjectNodetermine the end coordinate (pageX, pageY)
isTriggerboolNoIf the value is true, a new parabola view will be rendered
topnumberYes0determine the extra offset of axis y
durationnumberYes500determine the parabola animation duration
ratenumberYes1determine the value which can change the parabola trajectory
onParabolaFinishfunctionYesonParabolaFinish callback