forked from ducminhquan/qr-code-styling
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
41 lines (39 loc) · 1.06 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>QR Code Styling</title>
</head>
<body>
<div id="canvas"></div>
<script type="text/javascript">
const qrCode = new QRCodeStyling({
width: 500,
height: 500,
data: "h",
image: "https://upload.wikimedia.org/wikipedia/commons/5/51/Facebook_f_logo_%282019%29.svg",
dotsOptions: {
type: "rounded"
},
cornersSquareOptions: {
gradient: {
type: "linear",
rotation: Math.PI * 0.2,
colorStops: [{
offset: 0,
color: 'blue'
}, {
offset: 1,
color: 'red'
}]
},
},
imageOptions: {
crossOrigin: "anonymous",
margin: 30
}
});
qrCode.append(document.getElementById("canvas"));
</script>
</body>
</html>