bitjson / qr-code

A no-framework, no-dependencies, customizable, animate-able, SVG-based <qr-code> HTML element.
https://qr.bitjson.com/
MIT License
1.17k stars 58 forks source link

Allow to change "roundness" of QR code parts individually #5

Open stefan-schweiger opened 9 months ago

stefan-schweiger commented 9 months ago

Hi, first of great work, I looked through the source code and I think this project is really nicely done!

I was wondering if you might be open to extend the functionality of this package a bit to allow additional configurations. For I already have done the changes locally, just wondering if you are interested in such a thing.

My proposal looks like this:

<qr-code
  contents="bitcoincash:?r=https://bitjson.com/example-url"
  module-color="#1c7d43"
  position-ring-color="#13532d"
  position-center-color="#70C559"
  module-roundness="1"
  position-ring-roundness="1"
  position-center-roundness="1"
>
  <img src="assets/bch.svg" slot="icon" />
</qr-code>
image

All roundness settings set to 0.5:

image

All roundness settings set to 0:

image

I would also want to expose the errorCorrectionLevel and typeNumber. My last proposal is that maybe squares is not the best naming anymore with those changes and maybe it should be called raw?

Let me know if you have any interest in those changes then I will create a PR!

bitjson commented 7 months ago

Hey @stefan-schweiger, I'd be happy to accept a PR! Changes will need to maintain backwards-compatibility, but exposing additional attributes would be fine.

bitjson commented 7 months ago

(Related: I'd also love to take a PR upgrading to the latest version of Stencil, since the version in use is so outdated.)