Skip to content

Commit 6aca1f7

Browse files
committed
Update.
1 parent b3fd09d commit 6aca1f7

7 files changed

+4798
-4748
lines changed

.eslintignore

-4
This file was deleted.

.eslintrc.yml

-182
This file was deleted.

README.md

+77-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,90 @@
11
# kjua
22

3-
[![license][license-img]][github] [![web][web-img]][web] [![github][github-img]][github] [![npm][npm-img]][npm]
4-
[![version][npm-v-img]][npm] [![downloads][npm-dm-img]][npm]
3+
[![license][license-img]][github] [![github][github-img]][github] [![npm][npm-img]][npm]
54

65
Dynamically generated QR codes for modern browsers.
76
Uses [QR Code Generator][qrcode] (MIT).
87

8+
Choose between rendering the code as `canvas`, `img` or `svg`. The generated QR code will be in the least possible version requiered to encode the content (least number of blocks). Takes care of device pixel ratio to render crisp codes on all devices. Works in all modern browsers.
9+
10+
<!-- See a #[a(href='latest/demo/', title='demo of the latest version') demo] to get a first impression. -->
11+
12+
## Usage
13+
14+
The syntax is simple. Use global method `kjua` to create a fresh `canvas`, `img` or `svg` element displaying the QR code and add it to your page. For example:
15+
```js
16+
var el = kjua({text: 'hello!'});
17+
document.querySelector('body').appendChild(el);
18+
```
19+
20+
## jQuery
21+
22+
A jQuery plugin is included, you can use it like
23+
```js
24+
$('#my_container').kjua({text: 'Hello'});
25+
```
26+
27+
## Options
28+
29+
The available options and their default values are:
30+
```js
31+
{
32+
// render method: 'canvas', 'image' or 'svg'
33+
render: 'image',
34+
35+
// render pixel-perfect lines
36+
crisp: true,
37+
38+
// minimum version: 1..40
39+
minVersion: 1,
40+
41+
// error correction level: 'L', 'M', 'Q' or 'H'
42+
ecLevel: 'L',
43+
44+
// size in pixel
45+
size: 200,
46+
47+
// pixel-ratio, null for devicePixelRatio
48+
ratio: null,
49+
50+
// code color
51+
fill: '#333',
52+
53+
// background color
54+
back: '#fff',
55+
56+
// content
57+
text: 'no text',
58+
59+
// roundend corners in pc: 0..100
60+
rounded: 0,
61+
62+
// quiet zone in modules
63+
quiet: 0,
64+
65+
// modes: 'plain', 'label' or 'image'
66+
mode: 'plain',
67+
68+
// label/image size and pos in pc: 0..100
69+
mSize: 30,
70+
mPosX: 50,
71+
mPosY: 50,
72+
73+
// label
74+
label: 'no label',
75+
fontname: 'sans',
76+
fontcolor: '#333',
77+
78+
// image element
79+
image: null
80+
}
81+
```
82+
983

1084
## License
1185
The MIT License (MIT)
1286

13-
Copyright (c) 2020 Lars Jung (https://larsjung.de)
87+
Copyright (c) 2024 Lars Jung (https://larsjung.de)
1488

1589
Permission is hereby granted, free of charge, to any person obtaining a copy
1690
of this software and associated documentation files (the "Software"), to deal
@@ -31,16 +105,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
31105
THE SOFTWARE.
32106

33107

34-
[web]: https://larsjung.de/kjua/
35108
[github]: https://github.com/lrsjng/kjua
36109
[npm]: https://www.npmjs.org/package/kjua
37110

38111
[license-img]: https://img.shields.io/badge/license-MIT-a0a060.svg?style=flat-square
39-
[web-img]: https://img.shields.io/badge/web-larsjung.de/kjua-a0a060.svg?style=flat-square
40112
[github-img]: https://img.shields.io/badge/github-lrsjng/kjua-a0a060.svg?style=flat-square
41113
[npm-img]: https://img.shields.io/badge/npm-kjua-a0a060.svg?style=flat-square
42114

43-
[npm-v-img]: https://img.shields.io/npm/v/kjua.svg?style=flat-square
44-
[npm-dm-img]: https://img.shields.io/npm/dm/kjua.svg?style=flat-square
45-
46115
[qrcode]: https://github.com/kazuhikoarase/qrcode-generator

dist/kjua.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)