diff options
| author | Adam Soltys <[email protected]> | 2026-06-25 16:09:38 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-06-25 16:09:38 -0700 |
| commit | 89828ed523015f426eb575cb69dceb83ae263d06 (patch) | |
| tree | efe2345f37d6b15b21e223d8bf2d6dc60cc9fde7 /src | |
| parent | 656a8110d30fb0774902dbd6e92c173f5f6b072c (diff) | |
| download | coinosv3-89828ed523015f426eb575cb69dceb83ae263d06.tar.gz coinosv3-89828ed523015f426eb575cb69dceb83ae263d06.zip | |
Gift QR: use error-correction level L for a less dense, easier-to-scan grid
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/app.js | 2 | ||||
| -rw-r--r-- | src/qr.js | 7 |
2 files changed, 6 insertions, 3 deletions
@@ -1170,7 +1170,7 @@ function giftCard() { h('div', { class: 'warn-box' }, t('giftLinkWarn')), ui.giftCode ? h('div', { class: 'col', style: 'align-items:center;gap:10px' }, - h('div', { html: qrSvg(giftUrl()) }), + h('div', { html: qrSvg(giftUrl(), { ec: 'L' }) }), h('div', { class: 'addr-box break', style: 'width:100%;font-size:12px' }, giftUrl()), h('div', { class: 'row gap6 wrap' }, copyBtn(giftUrl(), t('copyLink')), @@ -3,8 +3,11 @@ import qrcode from 'qrcode-generator'; -export function qrSvg(text, { margin = 2 } = {}) { - const qr = qrcode(0, 'M'); // type 0 = auto-size, error correction M +// ec: error-correction level. 'M' by default; pass 'L' for long payloads (e.g. +// gift links) where a smaller, chunkier grid scans more easily — on-screen QRs +// are scanned immediately and don't need the damage tolerance of higher levels. +export function qrSvg(text, { margin = 2, ec = 'M' } = {}) { + const qr = qrcode(0, ec); // type 0 = auto-size qr.addData(text); qr.make(); |
