Package Exports
- bounce-ball
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bounce-ball) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Bounce Bal
We only provide JS logic, add the corresponding classname for DOM, css style is up to you.
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
Attribute | Type | Default | Description |
---|---|---|---|
id | string | - | Element id |
text | string | - | Displayed text |
speed | number | 6 | Speed of the animation |
Events
Attribute | Value | Description |
---|---|---|
run | - | The ball starts to move |
reset | - | Reset all parameters |