I started writing this post as I was chilling out next to the cross country skiing route, in a coffee shop, with excellent cake, and then we drank coffee, ate cake, and did some more skiing, so the blog didn’t get written until now.
I wrote a little web app for dice rolls because I couldn’t find a nice and simple, free, privacy-respecting app on my phone’s shop. And it seemed simple enough to do to be a feasible little project.
Little did I know about the tar pit of progressive web apps (PWA). Oh well! I *think* it’s solved now, thanks to some advice by @frotz and the Mozilla Developer Network series on progressive web apps:
Progressive Web Apps (PWAs) are web apps that use service workers, manifests, and other web-platform features in combination with progressive enhancement to give users an experience on par with native apps. – Progressive web apps
I hope it works? Add it to your home-screen, as we say in the land of poisonous apples. I don’t know how you do it in the land of robots disguised as humans.
This is it:
https://campaignwiki.org/roll/
I did spend a few minutes recording dice rolls of the appropriate dice to add to the app. A very important feature, yes!
Anyway, no need to look for it on any stores. It’s free, it works offline, it respects your privacy as far as possible. It’s a web app served by my server, so there are probably four days of the usual logs somewhere, and these include your IP number because I need the IP number to block people from abusing my sites. I also don’t know how you would switch off the network for a particular web app you installed. That’d be interesting to know. I just turned on Airplane mode and verified that it still worked.
The things I’d love it do on my iPhone:
I’d also love to hear about usability for people with a sight impairment.
I guess if we got rid of the samples and had a piece of Javascript synthesizing the audio of a dice roll, I’d like that, too.
If you’d like to take a look, sources are available:
#RPG #Programming
(Please contact me if you want to remove your comment.)
⁂
Nice one! My effort a few years ago: https://dicey.maclure.info/
Features: Shared history between clients (online required), funky dice for DCC, renders OK on mobile.
– starmonkey 2023-03-05 14:59 UTC
---
Nice!
– Alex 2023-03-05 22:30 UTC
---
I just saw that @salamandar had also posted a dice roller! It’s in the air. 😀
https://www.salamandar.net/gen/dice/
– Alex 2023-03-06 10:43 UTC
---
This is fantastic. The audio really makes it. Cheers/danke 🙂
– Andrew Wynn 2023-03-26 04:09 UTC
---
Thanks. 😀
– Alex 2023-03-26 10:38 UTC
---
Yes, this is very cool.
– bluetyson 2023-04-22 04:08 UTC
---
Now we need to make a DCC version.
– bluetyson 2023-04-22 04:13 UTC
---
When I tried to use it in play, I often used it for a bunch of dice and the problem is that it’s not a cool experience to click the buttons five times. There’s a bit of a delay, something isn’t working... So now I think I’d like to press, pull down to pick the number of dice, and let go, and it’d roll them all.
– Alex 2023-04-22 10:26 UTC
---
On the desktop, you can now use the keyboard to roll dice. You can long-click on the dice so you can pick how many dice you want to roll in one go (1 to 12). On a phone, you should be able to long-press in order to get this working (nearly done).
If you’ve installed it before, you need to run it in a separate browser (Firefox Focus?) for the next 24h, I guess? I have no idea when it “expires”.
– Alex 2023-04-22 18:17 UTC
---
Added DCC and Fudge dice.
– Alex 2023-04-23 11:56 UTC
---
Still grumpy about the dice roller on my phone that doesn’t update. I have to basically use `https://campaignwiki.org/roll?` (adding a query to the URL) for it to be “new”.
There’s a lot still to learn about this.
On these platforms, the only way to get the new manifest metadata is to re-install the app from the browser. … it has been a common practice to add a manual version identifier within the start_url property, such as `/?version=3` to identify the version. – Learn PWA: Update
Hm. That does sound familiar.
– Alex 2023-04-26 07:47 UTC
---
@PenPaperDice said:
… an event is triggered if manifest.json or service-worker.js is updated. Because of that, people store the version in the service-worker, because updating the number will trigger an update. – Only two events…
I think this means:
Let’s see whether that does it.
– Alex 2023-04-26 08:35 UTC
---
Sadly, no improvements. I ended up visiting `https://campaignwiki.org/roll/?version=2` in Safari and adding that to the home-screen. This works.
– Alex 2023-04-26 10:39 UTC
---
More suggested reading by @PenPaperDice:
Whichever strategy of handling Service Worker updates we apply, it has its own cons and probably means the traditional trait of the ever-green Web with no need to apply updates is more or less broken. That’s the unfortunate side of how Service Workers lifecycle is implemented and there’s no other way than to embrace it. – Handling Service Worker updates – how to keep the app updated and stay sane
Handling Service Worker updates – how to keep the app updated and stay sane
– Alex 2023-04-26 12:46 UTC
---
I recently added more audio samples for the d3, d5, d7, d14, d16 and d24. And I found that the upgrade mechanism seems to work! Yay!
– Alex 2023-05-06 08:15 UTC
---
On iOS, you need to reinstall the app.
---