From bba8d7158dfbeb0b320be47e766370016897c4a6 Mon Sep 17 00:00:00 2001 From: starlord Date: Sat, 1 Jun 2024 07:08:31 -0700 Subject: [PATCH] init --- README.md | 24 ++++++ dice.html | 230 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 254 insertions(+) create mode 100644 README.md create mode 100644 dice.html diff --git a/README.md b/README.md new file mode 100644 index 0000000..c8865dc --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# dice roller + +This `html` file allows a user to perpetually add calculated dice rolls to a history list. It then encodes/compresses the entire page into an [itty.bitty](https://about.bitty.site/) url to pass between players. + +## To Use + +- Enter the name of the roller (the *actor*) and the reason for the roll (such as "*initiative*" or "*attack/damage*") +- Select the number of dice to roll (max 20) and the number of sides on those dice (max 100) +- Add a modifier (positive or negative) and apply it to the total roll or to each die rolled +- Click the roll button and see the results added to the history + +After each roll, a new [itty.bitty](https://github.com/alcor/itty-bitty/) link will be generated in the **Custom History** box. Click the button to copy and send it off to the next player! + +## Link Length + +The itty.bitty links can get [quite long](https://github.com/alcor/itty-bitty/wiki/#url-structure), so it may be prudent to use a link shortener. + +For example, the link [to come](to come) for the `dice.html` page in this repo was generated using [asso.li](https://asso.li/), an [lstu](https://lstu.fr/) instance, with the following command (Linux): + +```bash +cat dice.html | lzma -9 | base64 -w0 | xargs -0 printf "https://itty.bitty.site/#Dice Roller/%s\n" | xargs -0 -I {} curl --data-urlencode "format=json" --data-urlencode "lsturl={}" https://asso.li/a | jq -r '.short' +``` + +You can, optionally, generate such a short link with each pass to each player, as needed. diff --git a/dice.html b/dice.html new file mode 100644 index 0000000..122612f --- /dev/null +++ b/dice.html @@ -0,0 +1,230 @@ + + + + Dice Roller + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Roll Details
Who
Why
Dice
Sides
Modifier
Applies + +
+

Custom History:

+ + + + + + + + + + + + + +
TimeActorReasonRollModifierResult
+ + + +