Skip to the content

Korokoroコロコロ

Roll mixed dice or type notation, compare exact probabilities, keep a history and replay seeded rolls.

Korokoro describes something small rolling in Japanese. About the name

Contents

Reference

Automatic tag registration

import { … } from "@johnmorrisdotca/korokoro/element/define";

97.2 kB minified and gzipped, with everything it imports (measured with esbuild)

The custom element, registered by being imported:

<script type="module" src="…/dist/element-define.js"></script>

<korokoro-roller notation="2d20kh1+5"></korokoro-roller> <korokoro-die sides="20"></korokoro-die>

This is the one module of the package that does something when it is imported, and package.json says so, so that a bundler keeps it. ./element exports the same class and defineRoller() with no effect of its own, for a page that wants to choose when, or under what tag.

Exports

NameKindWhat it is
defineDiefunctionRegister <korokoro-die>, as that tag unless another is asked for.
defineRollerfunctionRegister the element, as <korokoro-roller> unless another tag is asked for.
DIE_TAGconstantThe die's tag, unless another is asked for.
KorokoroDieclassONE DIE ON ITS OWN, as a custom element:
KorokoroRollerclassThe <korokoro-roller> element.
ROLLER_TAGconstantThe element's tag, unless another is asked for.

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/korokoro 1.16.0.