Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

roll-a-die

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

roll-a-die - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

5

package.json
{
"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": {

42

README.md
# 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc