229 - Narrative Countdown Window Update (#237)

* Improved

* Fixed the mode not sticking

* Removed console log
This commit is contained in:
WBHarry 2025-07-02 23:37:23 +02:00 committed by GitHub
parent ac7fb93635
commit a79b7189b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 258 additions and 187 deletions

View file

@ -259,6 +259,28 @@ export const damageKeyToNumber = key => {
}
};
export default function constructHTMLButton({
label,
dataset = {},
classes = [],
icon = '',
type = 'button',
disabled = false
}) {
const button = document.createElement('button');
button.type = type;
for (const [key, value] of Object.entries(dataset)) {
button.dataset[key] = value;
}
button.classList.add(...classes);
if (icon) icon = `<i class="${icon}"></i> `;
if (disabled) button.disabled = true;
button.innerHTML = `${icon}${label}`;
return button;
}
export const adjustDice = (dice, decrease) => {
const diceKeys = Object.keys(diceTypes);
const index = diceKeys.indexOf(dice);