Rolloc
A Javascript library to create spin roller. Open demo.
Installation
- Install
npm install rolloc # or yarn/pnpm
Basic Usage
HTML:
<div id="roller"></div>
JS:
import { createRolloc } from "rolloc"
const options = {
size: {
height: 400,
width: 400
},
// The roll default options
rollOptions: {
duration: 5000
}
}
const rolloc = createRolloc("#roller", options)
// Roll and override the default rollOptions
rolloc.roll({
duration: ~~input.value
})
Running the demo locally
git clone https://github.com/zuramai/rolloc.git
cd rolloc
pnpm install -r
# Run the js
pnpm run js:dev
# And run the demo site (vite)
pnpm run dev
Contributing
- Fork this repository
- Make a change and commit to the forked repository
- Make a pull request to this repository