A Javascript library to create spin roller. Open demo.
- Install
npm install rolloc # or yarn/pnpm
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
})
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
- Fork this repository
- Make a change and commit to the forked repository
- Make a pull request to this repository