0.0.2 • Published 4 years ago

bounce-ball v0.0.2

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

Bounce Bal

We only provide JS logic, add the corresponding classname for DOM, css style is up to you.

npm.io

Use

Yarn or NPM

$ yarn add -D bounce-ball
import BounceBall from 'bounce-ball'

const bounceBall = new BounceBall({
  id: 'main',
  text: 'Goodbye 2019 Hello 2020'
})

bounceBall.run()

// <div id="main"></div>

Example

$ git clone git@github.com:dengwb1991/bounce-ball.git

$ cd bounce-ball

$ yarn

$ yarn start

API

AttributeTypeDefaultDescription
idstring-Element id
textstring-Displayed text
speednumber6Speed of the animation

Events

AttributeValueDescription
run-The ball starts to move
reset-Reset all parameters

From

Ball Bouncing On Text