mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
229 - Narrative Countdown Window Update (#237)
* Improved * Fixed the mode not sticking * Removed console log
This commit is contained in:
parent
ac7fb93635
commit
a79b7189b6
16 changed files with 258 additions and 187 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue