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

Simple 3D dice roll using CSS3 animation.

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
54
increased by14.89%
Maintainers
1
Weekly downloads
 
Created
Source

Roll A Die

npm package Build Status

Simple 3D dice roll animator by CSS3 Animation.

Vanilla JS

Copy dist/roll-a-die.js into your library folder Load it into your HTML script

<script type="text/javascript" src="path/to/roll-a-die.js"></script>

Call the method with its options.

rollDice({ element, numberDice: 2, callback});

With npm (and CommonJS builder)

Install with npm. npm install --save roll-a-die

Call method

const rollDice = require('roll-a-die');
rollDice({ element, numberDice: 2, callback});
rollDice({ element, numberDice: 2, callback, noSound: true});

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.

Thanks

License

MIT License

Keywords

FAQs

Package last updated on 12 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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