Демо: https://fizzbuzzer.github.io/canvas-dice-roll/
Интерактивный игральный кубик. Для встраивания нужно указать тег и подключить JS-файл
<div data-widget="dice"></div>
Можно передать дополнительные data-атрибуты для управления цветами граней, рёбер и точек
<div
data-widget="dice"
data-face-color="black"
data-border-color="rgba(255, 255, 255, 1)"
data-dot-color="#FFFFFF"
></div>
- Управление количеством кубиков
- Внешние события
- Минификация
- Оптимизация кода