DiceJS

DiceJS is a free JavaScript plugin to simulate six-sided dice in webpages.
Download from GitHub.
Meet the creator, Param Siddharth.

Usage

The only dependencies are JavaScript (ES6 onwards) and HTML canvases.
To use DiceJS in the webpage, dice.js must be referenced via a <script> tag in the webpage.

<!DOCTYPE html>
<html>
    <head>
        <script src='dice.js'></script>
    </head>
...
This would allow 3 functions, namely makeDice(), makeDie(), and rollDie() to be used.

The functions may then be used via a <script> tag in the very end of the webpage body.

<body>
    ...
    <script>
    // The functions may be used here.
    </script>
</body>

Functions

Die Objects

A die object would refer to an object of the following form:

{
    name: ,
    roll:
}
Here, is the canvas element associated with the die, while is the method that would roll the die.

Examples

Footnotes

Hey there! It's me, Param.
I am a simple person who wants to become wise and loves the nature. I love learning new things and making stuff, like songs, computer applications, art, et cetera.

Here is my Facebook page.
I post often on Twitter.
I am quite active on Instagram.
Sometimes, I post videos on YouTube.
I am an artist, so you will find me in places like Spotify and DeviantArt too.
That's all for now. :) Stay happy and healthy!