Welcome to Tiny Dices! This JavaScript library is here to bring an extra layer of fun and magic to your dice-rolling experience. โจ Whether you're rolling for your favorite tabletop RPG or just need some virtual dice to shake things up, TinyDices makes it all possible with style!
This project was initially a custom dice application from Pony Driland repository. The tiny dice eventually evolved during the development that resulted in this project that is now published by the same creator of the Pony Driland repository.
- Roll any number of dice โ from a single die to a whole set of them! ๐ฒ
- Customizable max values โ set different max values for each die. ๐
- Spinning animation โ your dice can spin infinitely or stop after a cool animation. ๐
- Dynamic cube generation โ each die is a rotating, animated cube with unique faces. ๐ญ
- Zero-inclusive rolls โ make 0 a valid result if you need it! (Optional) ๐ฅณ
-
Create a Dice Instance:
const container = document.getElementById('myDice'); const dice = new TinyDices(container);
-
Roll Some Dice:
-
๐ฒ Roll 3 six-sided dice:
dice.roll('7,7,7'); // Rolls 3d7 ๐ฒ๐ฒ๐ฒ
-
๐ฏ Roll a mix of dice:
dice.roll('6,12,20'); // Rolls d6, d12, and d20 ๐ข๐ฒ
-
๐ Roll with infinite spinning animation:
dice.roll([10, 10], false, true); // Rolls 2d10 with infinite spin ๐๐ฒ
-
๐งฎ Roll with values starting from 0:
dice.roll([10, 10], true); // Rolls 2d10 starting from 0 ๐ฅณ๐ฒ
-
๐งช Roll a custom set of dice with zero and infinity:md-assets/tiny-crypto-suite.jpg
dice.roll([4, 8, 6], true, true); // Rolls d4, d8, and d6 from 0 with infinite spin โ๏ธ๐ฒ
Feel free to customize the appearance of your dice with different skins:
-
Background Skin: Set a cool background with solid colors like
'gray','blue', or'green', or something magical! โจdice.setBgSkin('gray'); // Sets background skin to gray ๐ซ๏ธ
-
Text Skin: Make your dice text stand out with solid color skins like
'red','yellow', or'white'! ๐dice.setTextSkin('red'); // Makes the text red ๐ด
-
Border Skin: Add a border effect to your dice with colors like
'black','orange', or'purple'! โจdice.setBorderSkin('2px solid black'); // Sets a black border โซ
-
Get Current Skins: Check what skins you're using right now:
dice.getBgSkin(); // Returns current background skin ๐จ dice.getTextSkin(); // Returns current text skin ๐๏ธ dice.getBorderSkin(); // Returns current border skin โก
Tiny Dices works by creating a customizable, 3D cube with 6 animated faces. Every time you roll, the faces spin and reveal random numbers. ๐ฒโจ
- The front face shows the result of your roll ๐ฅณ
- The other faces are randomized, creating a truly unique dice experience!
You can also customize the cube's animation. Want it to spin forever? Or just do a quick 360? ๐ก
Tiny Dices comes with cool animation effects and customizable styles. From spin effects to face transformations, the dice will roll in style. โจ
- Spin it Infinite!: Watch the dice spin forever for an endless feeling of anticipation! ๐
- Spin it Custom: You can control how the dice rotate with custom animations. Rotate along different axes for the coolest effects! ๐ฎ
Remember to check out the Tiny Dices Docs for more detailed instructions and advanced features! ๐
This project was created by Yasmin Seidel (JasminDreasond) with some extra help from ChatGPT. Tiny thanks to everyone contributing to the open-source community! ๐
This project is licensed under the GPL-3.0 License โ feel free to use and customize it for your own projects! ๐ ๏ธ
Did you like this module? Itโs part of the Tiny Essentials collection โ a set of minimal yet powerful tools to make development easier. ๐ Click here to explore more Tiny Essentials modules

