import DiceBox from "/vendor/dice-box/dice-box.es.js";

document.addEventListener("DOMContentLoaded", async () => {
    document.getElementById('preview').onclick = async () => {
        document.getElementById('dice-box').replaceChildren(...[])
        const diceBox = new DiceBox("#dice-box", {
            assetPath: "/vendor/assets/",
            theme: document.getElementById('theme').value,
            themeColor: document.getElementById('themeColor').value,
            scale: 14
        });
        await diceBox.init()
        diceBox.roll(['1d2', '1d4', '1d6', '1d8', '1d10', '1d12', '1d20', '1d100']);
    }
})
