You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
382 B
18 lines
382 B
import init, { roll } from "/assets/js/dice/pkg/roll_lib.js";
|
|
|
|
const result = document.querySelector("#result");
|
|
const input = document.querySelector("#input");
|
|
|
|
init().then(() => {
|
|
const update_result = (ev) => {
|
|
if (event.key != "Enter") {
|
|
return true;
|
|
}
|
|
|
|
result.innerText = roll(ev.target.value);
|
|
}
|
|
|
|
input.addEventListener("keydown", update_result);
|
|
});
|
|
|