BigJk / snd

Sales & Dungeons — Thermal Printer as D&D / TTRPG Utility
https://sales-and-dungeons.app/
MIT License
474 stars 17 forks source link

QR Code generation #62

Closed MrG4dget closed 3 months ago

MrG4dget commented 4 months ago

Just in case someone can use this:

Wanted to create a QR code that opens the URL to the dndbeyond entry of a spell. Got it working with the following:

<img style="display: block; margin-left: auto; padding: 20px;  margin-right: auto; width: 50%;" 
src="{{"https://api.qrserver.com/v1/create-qr-code/?size=150x150&data="+"https://www.dndbeyond.com/spells/"+config.name | replace(" ","-") | lower+""}}"></img>

So if the config has the Spells name, it should create the correct QR code. Screenshot 2024-05-20 160019

BigJk commented 4 months ago

Nice idea! 😍

Because this is not a bug/issue maybe we can start a useful snippets discussion here: https://github.com/BigJk/snd/discussions/63

So that we can keep the issues for bugs and problems. It would be awesome if you could post this snippet again over there ❤️