You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dynamically generated QR codes for modern browsers.
7
6
Uses [QR Code Generator][qrcode] (MIT).
8
7
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
+
9
83
10
84
## License
11
85
The MIT License (MIT)
12
86
13
-
Copyright (c) 2020 Lars Jung (https://larsjung.de)
87
+
Copyright (c) 2024 Lars Jung (https://larsjung.de)
14
88
15
89
Permission is hereby granted, free of charge, to any person obtaining a copy
16
90
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
0 commit comments