roll-a-die
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "roll-a-die", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Simple 3D dice roll using CSS3 animation.", | ||
@@ -27,4 +27,3 @@ "main": "dist/roll-a-die.js", | ||
"dev": "node_modules/.bin/webpack -p --watch", | ||
"build": "node_modules/.bin/webpack -p", | ||
"prepush": "npm run build" | ||
"build": "node_modules/.bin/webpack -p" | ||
}, | ||
@@ -31,0 +30,0 @@ "repository": { |
# Roll A Die | ||
[![npm package](https://img.shields.io/npm/v/roll-a-die.svg?style=flat-square)](https://www.npmjs.org/package/roll-a-die) [![Build Status](https://img.shields.io/travis/chukwumaijem/roll-a-die.svg?style=flat-square)](https://travis-ci.com/chukwumaijem/roll-a-die) | ||
[![npm package](https://img.shields.io/npm/v/roll-a-die.svg?style=flat-square)](https://www.npmjs.org/package/roll-a-die) [![Build Status](https://img.shields.io/travis/chukwumaijem/roll-a-die.svg?style=flat-square)](https://travis-ci.com/chukwumaijem/roll-a-die.svg?branch=master) | ||
Simple 3D dice roll animator by CSS3 Animation. | ||
[Demo](https://codepen.io/chukwuma-ezumezu/pen/qYKOGW) | ||
## Vanilla JS | ||
@@ -11,6 +14,7 @@ Copy dist/roll-a-die.js into your library folder | ||
``` | ||
You can use the [UNPKG](https://unpkg.com) link `https://unpkg.com/roll-a-die@1.0.5/dist/roll-a-die.js`. Remember to update the package number to the most recent. | ||
Call the method with its options. | ||
``` | ||
rollDice({ element, numberDice: 2, callback}); | ||
rollADie({ element, numberDice: 2, callback}); | ||
``` | ||
@@ -20,17 +24,37 @@ | ||
Install with npm. | ||
```npm install --save roll-a-die``` | ||
``` | ||
npm install --save roll-a-die | ||
``` | ||
Call method | ||
Install with yarn. | ||
``` | ||
const rollDice = require('roll-a-die'); | ||
rollDice({ element, numberDice: 2, callback}); | ||
rollDice({ element, numberDice: 2, callback, noSound: true}); | ||
yarn add roll-a-die | ||
``` | ||
## Definitions | ||
import the library | ||
ES5 | ||
``` | ||
const rollADie = require('roll-a-die'); | ||
``` | ||
ES6 | ||
``` | ||
import rollADie from 'roll-a-die'; | ||
``` | ||
Call the method | ||
``` | ||
rollADie({ element, numberDice: 2, callback}); | ||
rollADie({ element, numberDice: 2, callback, noSound: true}); | ||
rollADie({ element, numberDice: 2, callback, delay: 1000}); | ||
``` | ||
## Parameter Definitions | ||
* `element`: The element to render die animation on. | ||
* `numberDice`: The number of dice to use.` | ||
* `callback`: Called when animation is finished. Returns an array of the values from throw. | ||
* `noSound`: Roll the die without sound. | ||
* `noSound`: Roll the die without sound (Optional). | ||
* `delay`: Time in milliseconds to delay before removing animations (Optional). | ||
@@ -37,0 +61,0 @@ ## Thanks |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
103562
64