-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathqrcodegen-input-demo.html
149 lines (147 loc) · 5.56 KB
/
qrcodegen-input-demo.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<!--
- QR Code generator input demo (HTML+JavaScript)
-
- Copyright (c) Project Nayuki. (MIT License)
- https://www.nayuki.io/page/qr-code-generator-library
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of
- this software and associated documentation files (the "Software"), to deal in
- the Software without restriction, including without limitation the rights to
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- the Software, and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
- * The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
- * The Software is provided "as is", without warranty of any kind, express or
- implied, including but not limited to the warranties of merchantability,
- fitness for a particular purpose and noninfringement. In no event shall the
- authors or copyright holders be liable for any claim, damages or other
- liability, whether in an action of contract, tort or otherwise, arising from,
- out of or in connection with the Software or the use or other dealings in the
- Software.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>QR Code generator input demo (JavaScript)</title>
<style type="text/css">
html {
font-family: sans-serif;
}
h1 {
text-align: center;
}
table {
border-collapse: collapse;
}
td {
vertical-align: top;
padding-top: 0.2em;
padding-bottom: 0.2em;
}
td:first-child {
white-space: pre;
padding-right: 0.5em;
}
input, textarea {
font-size: inherit;
font-family: inherit;
}
input[type=radio], input[type=checkbox] {
margin: 0em 0.2em 0em 0em;
padding: 0em;
}
label + label {
margin-left: 0.8em;
}
hr {
margin: 2em 0em;
border: none;
border-top: 0.1em solid #A0A0A0;
}
</style>
</head>
<body>
<h1>QR Code generator input demo (JavaScript)</h1>
<div id="loading">
<p>Loading application...</p>
<p>(Are the JavaScript files missing?)</p>
<p>(The JavaScript code needs to be compiled from the TypeScript code.)</p>
</div>
<form id="loaded" hidden="hidden" onsubmit="event.preventDefault();">
<table>
<tbody>
<tr>
<td><strong>Text string:</strong></td>
<td><textarea placeholder="Enter your text to be put into the QR Code" id="text-input" style="width:30em; height:5em"></textarea></td>
</tr>
<tr>
<td><strong>QR Code:</strong><br/><a id="download">(download)</a></td>
<td>
<canvas id="qrcode-canvas" style="padding:1em; background-color:#E8E8E8"></canvas>
<svg id="qrcode-svg" style="width:30em; height:30em; padding:1em; background-color:#E8E8E8">
<rect width="100%" height="100%" fill="#FFFFFF" stroke-width="0"></rect>
<path d="" fill="#000000" stroke-width="0"></path>
</svg>
</td>
</tr>
<tr>
<td><strong>Error correction:</strong></td>
<td>
<label><input type="radio" name="errcorlvl" id="errcorlvl-low" checked="checked">Low</label>
<label><input type="radio" name="errcorlvl" id="errcorlvl-medium">Medium</label>
<label><input type="radio" name="errcorlvl" id="errcorlvl-quartile">Quartile</label>
<label><input type="radio" name="errcorlvl" id="errcorlvl-high">High</label>
</td>
</tr>
<tr>
<td>Output format:</td>
<td>
<label><input type="radio" name="output-format" id="output-format-bitmap" checked="checked">Bitmap</label>
<label><input type="radio" name="output-format" id="output-format-vector">Vector</label>
</td>
</tr>
<tr>
<td>Border:</td>
<td><input type="number" value="4" min="0" max="100" step="1" id="border-input" style="width:4em"> modules</td>
</tr>
<tr id="scale-row">
<td>Scale:</td>
<td><input type="number" value="8" min="1" max="30" step="1" id="scale-input" style="width:4em"> pixels per module</td>
</tr>
<tr>
<td>Colors:</td>
<td>
Light = <input type="text" value="#FFFFFF" id="light-color-input" style="width:6em">,
dark = <input type="text" value="#000000" id="dark-color-input" style="width:6em">
</td>
</tr>
<tr>
<td>Version range:</td>
<td>
Minimum = <input type="number" value="1" min="1" max="40" step="1" id="version-min-input" style="width:4em" oninput="app.handleVersionMinMax('min');">,
maximum = <input type="number" value="40" min="1" max="40" step="1" id="version-max-input" style="width:4em" oninput="app.handleVersionMinMax('max');">
</td>
</tr>
<tr>
<td>Mask pattern:</td>
<td><input type="number" value="-1" min="-1" max="7" step="1" id="mask-input" style="width:4em"> (−1 for automatic, 0 to 7 for manual)</td>
</tr>
<tr>
<td>Boost ECC:</td>
<td><label><input type="checkbox" checked="checked" id="boost-ecc-input">Increase <abbr title="error-correcting code">ECC</abbr> level within same version</label></td>
</tr>
<tr>
<td>Statistics:</td>
<td id="statistics-output" style="white-space:pre"></td>
</tr>
</tbody>
</table>
</form>
<script type="application/javascript" src="qrcodegen.js"></script>
<script type="application/javascript" src="qrcodegen-input-demo.js"></script>
<hr>
<p>Copyright © Project Nayuki – <a href="https://www.nayuki.io/page/qr-code-generator-library">https://www.nayuki.io/page/qr-code-generator-library</a></p>
</body>
</html>