qrdx 0.0.52 → 0.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.js +7 -7
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +7 -7
- package/dist/core.mjs.map +1 -1
- package/dist/element.browser.mjs +17 -17
- package/dist/element.browser.mjs.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/index.mjs.map +1 -1
- package/dist/qr-code-canvas.js +1 -1
- package/dist/qr-code-canvas.js.map +1 -1
- package/dist/qr-code-canvas.mjs +1 -1
- package/dist/qr-code-canvas.mjs.map +1 -1
- package/dist/src/frame-spec.d.ts.map +1 -1
- package/dist/src/frame.d.ts +13 -3
- package/dist/src/frame.d.ts.map +1 -1
- package/dist/src/template/arrow.d.ts +0 -1
- package/dist/src/template/arrow.d.ts.map +1 -1
- package/dist/src/template/frame-template.d.ts +19 -0
- package/dist/src/template/frame-template.d.ts.map +1 -0
- package/dist/src/template/halloween.d.ts +0 -1
- package/dist/src/template/halloween.d.ts.map +1 -1
- package/dist/src/template/square-border.d.ts +0 -1
- package/dist/src/template/square-border.d.ts.map +1 -1
- package/dist/src/template/standard-box.d.ts +0 -1
- package/dist/src/template/standard-box.d.ts.map +1 -1
- package/dist/src/template/striked-box.d.ts +0 -1
- package/dist/src/template/striked-box.d.ts.map +1 -1
- package/dist/types/frame-spec.d.ts +554 -0
- package/dist/types/frame-spec.d.ts.map +1 -1
- package/dist/types/index.js +2 -2
- package/dist/types/index.js.map +1 -1
- package/dist/types/index.mjs +2 -2
- package/dist/types/index.mjs.map +1 -1
- package/dist/types/qr.d.ts +111 -0
- package/dist/types/qr.d.ts.map +1 -1
- package/dist/types/template.d.ts +7 -0
- package/dist/types/template.d.ts.map +1 -1
- package/dist/vanilla.browser.mjs +15 -15
- package/dist/vanilla.browser.mjs.map +1 -1
- package/package.json +1 -1
- package/src/frame-spec.ts +17 -2
- package/src/frame.tsx +57 -7
- package/src/template/arrow.ts +14 -0
- package/src/template/frame-template.tsx +70 -0
- package/src/template/halloween.ts +14 -0
- package/src/template/specs/arrow.json +26 -0
- package/src/template/specs/halloween.json +144 -0
- package/src/template/specs/square-border.json +27 -0
- package/src/template/specs/standard-box.json +31 -0
- package/src/template/specs/striked-box.json +56 -0
- package/src/template/square-border.ts +14 -0
- package/src/template/standard-box.ts +14 -0
- package/src/template/striked-box.ts +14 -0
- package/types/frame-spec.ts +67 -4
- package/types/template.ts +7 -0
- package/src/template/arrow.tsx +0 -40
- package/src/template/halloween.tsx +0 -147
- package/src/template/square-border.tsx +0 -43
- package/src/template/standard-box.tsx +0 -43
- package/src/template/striked-box.tsx +0 -42
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qrdx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.53",
|
|
4
4
|
"description": "Customizable QR code generator for React and plain JavaScript: SVG and canvas rendering, dot and eye patterns, gradients, logos, frames, Logo QR and Image QR art, PNG/JPG/WebP/SVG/PDF/EPS export, a scan score and QR scanning.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"qr-code",
|
package/src/frame-spec.ts
CHANGED
|
@@ -131,6 +131,10 @@ function specBackground(
|
|
|
131
131
|
bgColor: ColorConfig | undefined
|
|
132
132
|
): { color: string; plate: boolean } {
|
|
133
133
|
const background = getSolidColor(bgColor, DEFAULT_BGCOLOR);
|
|
134
|
+
if (spec.qr.plate === "none") {
|
|
135
|
+
// No plate: the code's own background and margin are its light space
|
|
136
|
+
return { color: background, plate: false };
|
|
137
|
+
}
|
|
134
138
|
if (isOpaque(background)) {
|
|
135
139
|
return { color: background, plate: true };
|
|
136
140
|
}
|
|
@@ -440,10 +444,21 @@ function compileShape(
|
|
|
440
444
|
resolve: Resolve
|
|
441
445
|
): FrameShape[] {
|
|
442
446
|
const outline = outlineOf(shape, k);
|
|
447
|
+
const stroke =
|
|
448
|
+
"stroke" in shape && shape.stroke
|
|
449
|
+
? {
|
|
450
|
+
stroke: resolve(shape.stroke.color),
|
|
451
|
+
strokeWidth: shape.stroke.width * k,
|
|
452
|
+
}
|
|
453
|
+
: undefined;
|
|
443
454
|
if (typeof shape.fill === "object" && "gradient" in shape.fill) {
|
|
444
|
-
|
|
455
|
+
const steps = gradientSteps(outline, shape.fill.gradient, resolve);
|
|
456
|
+
// The outline goes over the steps, drawn once along the whole shape
|
|
457
|
+
return stroke
|
|
458
|
+
? [...steps, { ...outline, fill: "none", ...stroke } as FrameShape]
|
|
459
|
+
: steps;
|
|
445
460
|
}
|
|
446
|
-
return [{ ...outline, fill: resolve(shape.fill) } as FrameShape];
|
|
461
|
+
return [{ ...outline, fill: resolve(shape.fill), ...stroke } as FrameShape];
|
|
447
462
|
}
|
|
448
463
|
|
|
449
464
|
// ── Labels ─────────────────────────────────────────────────────────────────
|
package/src/frame.tsx
CHANGED
|
@@ -27,21 +27,30 @@ export interface FrameBox {
|
|
|
27
27
|
radius: number;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
/**
|
|
31
|
+
* An outline along a shape's edge (centered on it, mitered corners), drawn
|
|
32
|
+
* after its fill. `fill` may be "none" for an outline alone.
|
|
33
|
+
*/
|
|
34
|
+
export interface FrameStroke {
|
|
35
|
+
stroke?: string;
|
|
36
|
+
strokeWidth?: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface FrameRect extends FrameBox, FrameStroke {
|
|
31
40
|
type: "rect";
|
|
32
41
|
fill: string;
|
|
33
42
|
/** Area cut out of the rect (where the QR code shows through) */
|
|
34
43
|
hole?: FrameBox;
|
|
35
44
|
}
|
|
36
45
|
|
|
37
|
-
export interface FramePolygon {
|
|
46
|
+
export interface FramePolygon extends FrameStroke {
|
|
38
47
|
type: "polygon";
|
|
39
48
|
points: [number, number][];
|
|
40
49
|
fill: string;
|
|
41
50
|
}
|
|
42
51
|
|
|
43
52
|
/** Any outline, as SVG path data in artwork coordinates. */
|
|
44
|
-
export interface FramePath {
|
|
53
|
+
export interface FramePath extends FrameStroke {
|
|
45
54
|
type: "path";
|
|
46
55
|
d: string;
|
|
47
56
|
fill: string;
|
|
@@ -180,6 +189,13 @@ function boxPath({ x, y, width, height, radius }: FrameBox): string {
|
|
|
180
189
|
);
|
|
181
190
|
}
|
|
182
191
|
|
|
192
|
+
/** SVG attributes of a shape's outline, if it has one. */
|
|
193
|
+
function strokeProps(shape: FrameStroke) {
|
|
194
|
+
return shape.stroke && shape.strokeWidth
|
|
195
|
+
? { stroke: shape.stroke, strokeWidth: round(shape.strokeWidth) }
|
|
196
|
+
: {};
|
|
197
|
+
}
|
|
198
|
+
|
|
183
199
|
function renderShape(shape: FrameShape, key: number) {
|
|
184
200
|
if (shape.type === "rect" && shape.hole) {
|
|
185
201
|
return (
|
|
@@ -188,6 +204,7 @@ function renderShape(shape: FrameShape, key: number) {
|
|
|
188
204
|
fill={shape.fill}
|
|
189
205
|
fillRule="evenodd"
|
|
190
206
|
key={key}
|
|
207
|
+
{...strokeProps(shape)}
|
|
191
208
|
/>
|
|
192
209
|
);
|
|
193
210
|
}
|
|
@@ -199,6 +216,7 @@ function renderShape(shape: FrameShape, key: number) {
|
|
|
199
216
|
points={shape.points
|
|
200
217
|
.map(([x, y]) => `${round(x)},${round(y)}`)
|
|
201
218
|
.join(" ")}
|
|
219
|
+
{...strokeProps(shape)}
|
|
202
220
|
/>
|
|
203
221
|
);
|
|
204
222
|
}
|
|
@@ -209,11 +227,13 @@ function renderShape(shape: FrameShape, key: number) {
|
|
|
209
227
|
fill={shape.fill}
|
|
210
228
|
key={key}
|
|
211
229
|
{...(shape.fillRule === "evenodd" && { fillRule: "evenodd" })}
|
|
230
|
+
{...strokeProps(shape)}
|
|
212
231
|
/>
|
|
213
232
|
);
|
|
214
233
|
}
|
|
215
234
|
return (
|
|
216
235
|
<rect
|
|
236
|
+
{...strokeProps(shape)}
|
|
217
237
|
fill={shape.fill}
|
|
218
238
|
height={round(shape.height)}
|
|
219
239
|
key={key}
|
|
@@ -228,6 +248,11 @@ function renderShape(shape: FrameShape, key: number) {
|
|
|
228
248
|
);
|
|
229
249
|
}
|
|
230
250
|
|
|
251
|
+
/** A layout's shapes as SVG elements, in paint order (the frame's artwork). */
|
|
252
|
+
export function frameShapeElements(layout: FrameLayout): QRNode[] {
|
|
253
|
+
return layout.shapes.map((shape, index) => renderShape(shape, index));
|
|
254
|
+
}
|
|
255
|
+
|
|
231
256
|
/**
|
|
232
257
|
* Wraps a rendered QR `<svg>` (sized `size × size`) in a frame. The QR element
|
|
233
258
|
* is nested as-is at its offset, so its modules are untouched.
|
|
@@ -314,14 +339,34 @@ export function drawFrameOnCanvas(
|
|
|
314
339
|
ctx.closePath();
|
|
315
340
|
};
|
|
316
341
|
|
|
342
|
+
const strokeShape = (shape: FrameShape, path?: Path2D) => {
|
|
343
|
+
if (!(shape.stroke && shape.strokeWidth)) {
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
ctx.strokeStyle = shape.stroke;
|
|
347
|
+
ctx.lineWidth = shape.strokeWidth;
|
|
348
|
+
ctx.lineJoin = "miter";
|
|
349
|
+
ctx.miterLimit = 4;
|
|
350
|
+
if (path) {
|
|
351
|
+
ctx.stroke(path);
|
|
352
|
+
} else {
|
|
353
|
+
ctx.stroke();
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
|
|
317
357
|
for (const shape of layout.shapes) {
|
|
318
|
-
|
|
358
|
+
const filled = !(shape.fill === "transparent" || shape.fill === "none");
|
|
359
|
+
if (!(filled || shape.stroke)) {
|
|
319
360
|
continue;
|
|
320
361
|
}
|
|
321
362
|
ctx.fillStyle = shape.fill;
|
|
322
363
|
if (shape.type === "path") {
|
|
323
364
|
if (typeof Path2D !== "undefined") {
|
|
324
|
-
|
|
365
|
+
const path = new Path2D(shape.d);
|
|
366
|
+
if (filled) {
|
|
367
|
+
ctx.fill(path, shape.fillRule ?? "nonzero");
|
|
368
|
+
}
|
|
369
|
+
strokeShape(shape, path);
|
|
325
370
|
}
|
|
326
371
|
continue;
|
|
327
372
|
}
|
|
@@ -335,14 +380,19 @@ export function drawFrameOnCanvas(
|
|
|
335
380
|
}
|
|
336
381
|
});
|
|
337
382
|
ctx.closePath();
|
|
338
|
-
|
|
383
|
+
if (filled) {
|
|
384
|
+
ctx.fill();
|
|
385
|
+
}
|
|
339
386
|
} else {
|
|
340
387
|
traceBox(shape);
|
|
341
388
|
if (shape.hole) {
|
|
342
389
|
traceBox(shape.hole);
|
|
343
390
|
}
|
|
344
|
-
|
|
391
|
+
if (filled) {
|
|
392
|
+
ctx.fill("evenodd");
|
|
393
|
+
}
|
|
345
394
|
}
|
|
395
|
+
strokeShape(shape);
|
|
346
396
|
}
|
|
347
397
|
|
|
348
398
|
for (const label of frameLabels(layout)) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// The Arrow template: its artwork is a frame spec (./specs/arrow.json),
|
|
2
|
+
// drawn by the frame engine in the template's own box (./frame-template.tsx).
|
|
3
|
+
import type { TemplateDefinition } from "../../types";
|
|
4
|
+
import type { FrameSpec } from "../../types/frame-spec";
|
|
5
|
+
import { frameTemplate } from "./frame-template";
|
|
6
|
+
import arrow from "./specs/arrow.json";
|
|
7
|
+
|
|
8
|
+
export const Arrow: TemplateDefinition = frameTemplate({
|
|
9
|
+
id: "Arrow",
|
|
10
|
+
name: "Arrow",
|
|
11
|
+
description: "QR code with arrow",
|
|
12
|
+
spec: arrow as unknown as FrameSpec,
|
|
13
|
+
at: { x: 47, y: 95, scale: 1 },
|
|
14
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/** @jsxImportSource ../jsx */
|
|
2
|
+
// Built-in templates drawn from frame specs: each template's artwork is a
|
|
3
|
+
// frame spec (./specs), compiled by src/frame-spec.ts and drawn with the
|
|
4
|
+
// frame renderer, then placed where the template always drew it in its
|
|
5
|
+
// 300 × 300 box. A template keeps its own sizing (the whole artwork is the
|
|
6
|
+
// requested size, the code inside it smaller) and takes the code's dark
|
|
7
|
+
// color as its frame color, as the hand-written templates did up to qrdx
|
|
8
|
+
// 0.0.51; tests/template-spec-parity.test.ts proves they draw the same.
|
|
9
|
+
import type { TemplateDefinition } from "../../types";
|
|
10
|
+
import type { FrameSpec } from "../../types/frame-spec";
|
|
11
|
+
import { frameShapeElements } from "../frame";
|
|
12
|
+
import { frameSpecLayout, resolveFrameSpec } from "../frame-spec";
|
|
13
|
+
import { getSolidColor } from "../utils/color";
|
|
14
|
+
import { fmt } from "../utils/fmt";
|
|
15
|
+
|
|
16
|
+
/** The template box every template draws in (utils.tsx scales it to size). */
|
|
17
|
+
const TEMPLATE_BOX = 300;
|
|
18
|
+
|
|
19
|
+
export interface TemplateFrame {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
/** The template's artwork as a frame spec (cropped to the artwork) */
|
|
24
|
+
spec: FrameSpec;
|
|
25
|
+
/** Where the spec's artboard sits in the 300 × 300 template box */
|
|
26
|
+
at: { x: number; y: number; scale: number };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** A built-in template that draws `frame.spec` around the code. */
|
|
30
|
+
export function frameTemplate(frame: TemplateFrame): TemplateDefinition {
|
|
31
|
+
return {
|
|
32
|
+
id: frame.id,
|
|
33
|
+
name: frame.name,
|
|
34
|
+
description: frame.description,
|
|
35
|
+
spec: frame.spec,
|
|
36
|
+
wrapper: (children, props) => {
|
|
37
|
+
const spec = resolveFrameSpec(frame.spec);
|
|
38
|
+
// The artwork takes the code's dark color, as templates always have
|
|
39
|
+
const fg = props?.fgColor;
|
|
40
|
+
const color =
|
|
41
|
+
(typeof fg === "string" ? fg : getSolidColor(fg, "")) || "black";
|
|
42
|
+
const layout = frameSpecLayout(spec.qr.size, spec, { color });
|
|
43
|
+
const { x, y, scale } = frame.at;
|
|
44
|
+
return (
|
|
45
|
+
<svg
|
|
46
|
+
height={TEMPLATE_BOX}
|
|
47
|
+
id="svgQrWrapper"
|
|
48
|
+
style={{ width: "100%", height: "100%" }}
|
|
49
|
+
viewBox={`0 0 ${TEMPLATE_BOX} ${TEMPLATE_BOX}`}
|
|
50
|
+
width={TEMPLATE_BOX}
|
|
51
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
52
|
+
xmlnsXlink="http://www.w3.org/1999/xlink"
|
|
53
|
+
>
|
|
54
|
+
<g
|
|
55
|
+
data-qrdx-template={frame.id}
|
|
56
|
+
transform={`translate(${fmt(x)} ${fmt(y)})${scale === 1 ? "" : ` scale(${scale})`}`}
|
|
57
|
+
>
|
|
58
|
+
{frameShapeElements(layout)}
|
|
59
|
+
<g
|
|
60
|
+
fill="none"
|
|
61
|
+
transform={`translate(${fmt(layout.qrX)} ${fmt(layout.qrY)}) scale(${layout.qrSize / TEMPLATE_BOX})`}
|
|
62
|
+
>
|
|
63
|
+
{children}
|
|
64
|
+
</g>
|
|
65
|
+
</g>
|
|
66
|
+
</svg>
|
|
67
|
+
);
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// The Halloween template: its artwork is a frame spec (./specs/halloween.json),
|
|
2
|
+
// drawn by the frame engine in the template's own box (./frame-template.tsx).
|
|
3
|
+
import type { TemplateDefinition } from "../../types";
|
|
4
|
+
import type { FrameSpec } from "../../types/frame-spec";
|
|
5
|
+
import { frameTemplate } from "./frame-template";
|
|
6
|
+
import halloween from "./specs/halloween.json";
|
|
7
|
+
|
|
8
|
+
export const Halloween: TemplateDefinition = frameTemplate({
|
|
9
|
+
id: "Halloween",
|
|
10
|
+
name: "Halloween",
|
|
11
|
+
description: "QR code with Halloween theme",
|
|
12
|
+
spec: halloween as unknown as FrameSpec,
|
|
13
|
+
at: { x: 38, y: 10, scale: 1 },
|
|
14
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "qrdx.frame",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"artboard": {
|
|
5
|
+
"width": 185,
|
|
6
|
+
"height": 178
|
|
7
|
+
},
|
|
8
|
+
"qr": {
|
|
9
|
+
"x": 35,
|
|
10
|
+
"y": 0,
|
|
11
|
+
"size": 150,
|
|
12
|
+
"padding": 0,
|
|
13
|
+
"plate": "none"
|
|
14
|
+
},
|
|
15
|
+
"colors": {
|
|
16
|
+
"frame": "#000000"
|
|
17
|
+
},
|
|
18
|
+
"shapes": [
|
|
19
|
+
{
|
|
20
|
+
"type": "path",
|
|
21
|
+
"d": "M26.57 80.23h0c0.12 -2.06 0.31 -4.19 0.49 -6.25s0.48 -4.13 0.85 -6.13s0.79 -4 1.27 -5.95a30.21 30.21 0 0 1 1.94 -5.28h0c0.06 -0.18 0.13 -0.43 0.19 -0.67a3.55 3.55 0 0 0 -2.8 -4.19l-0.18 -0.06a1.85 1.85 0 0 0 -0.54 -0.06c-0.19 0 -0.31 -0.06 -0.49 -0.06s-0.61 -0.06 -0.91 -0.06c-0.61 0 -1.21 0.06 -1.82 0.06c-1.21 0.12 -2.37 0.25 -3.52 0.43a62.08 62.08 0 0 0 -6.8 1.45a58.45 58.45 0 0 0 -6.43 2.31c-1 0.42 -2.07 1 -3.1 1.4s-2 1.09 -3 1.57a0.76 0.76 0 0 0 0.54 1.4h0.07c1.09 -0.24 2.12 -0.55 3.15 -0.79s2.13 -0.48 3.16 -0.61A46 46 0 0 1 15 58c1.34 -0.06 2.73 -0.06 4.07 -0.06a62.58 62.58 0 0 0 -7.23 10.43a85.58 85.58 0 0 0 -6.55 15.36a107.86 107.86 0 0 0 -5 32.53a104.06 104.06 0 0 0 5 32.29a90.47 90.47 0 0 0 15.54 28.52a0.94 0.94 0 0 0 1.27 0.19a0.89 0.89 0 0 0 0.18 -1.28h0a87.24 87.24 0 0 1 -13.89 -28.28A102.85 102.85 0 0 1 11 85.87a82.15 82.15 0 0 1 6.68 -14a51.58 51.58 0 0 1 5.71 -7.76c0 1.21 0 2.36 0.06 3.58c0.12 2.18 0.24 4.31 0.48 6.43s0.49 4.25 0.85 6.37a1 1 0 0 0 0.91 0.85A1.37 1.37 0 0 0 26.57 80.23Z",
|
|
22
|
+
"fill": "frame"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"labels": []
|
|
26
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "qrdx.frame",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"artboard": {
|
|
5
|
+
"width": 220,
|
|
6
|
+
"height": 277
|
|
7
|
+
},
|
|
8
|
+
"qr": {
|
|
9
|
+
"x": 52,
|
|
10
|
+
"y": 122,
|
|
11
|
+
"size": 114,
|
|
12
|
+
"padding": 0,
|
|
13
|
+
"plate": "none"
|
|
14
|
+
},
|
|
15
|
+
"colors": {
|
|
16
|
+
"frame": "#000000"
|
|
17
|
+
},
|
|
18
|
+
"shapes": [
|
|
19
|
+
{
|
|
20
|
+
"type": "circle",
|
|
21
|
+
"cx": 110,
|
|
22
|
+
"cy": 167.682,
|
|
23
|
+
"r": 99.318,
|
|
24
|
+
"fill": "#FFFFFF",
|
|
25
|
+
"stroke": {
|
|
26
|
+
"color": "#F89941",
|
|
27
|
+
"width": 20
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"type": "ellipse",
|
|
32
|
+
"cx": 139.989,
|
|
33
|
+
"cy": 67.895,
|
|
34
|
+
"rx": 35.445,
|
|
35
|
+
"ry": 48.442,
|
|
36
|
+
"fill": "#F89941"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"type": "path",
|
|
40
|
+
"d": "M159.937 69.076C159.937 82.657 156.092 94.845 150.005 103.57C143.912 112.304 135.736 117.381 126.992 117.381C118.247 117.381 110.072 112.304 103.979 103.57C97.891 94.845 94.047 82.657 94.047 69.076C94.047 55.495 97.891 43.308 103.979 34.582C110.072 25.849 118.247 20.771 126.992 20.771C135.736 20.771 143.912 25.849 150.005 34.582C156.092 43.308 159.937 55.495 159.937 69.076Z",
|
|
41
|
+
"fill": "#F89941",
|
|
42
|
+
"stroke": {
|
|
43
|
+
"color": "#E78249",
|
|
44
|
+
"width": 5
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"type": "ellipse",
|
|
49
|
+
"cx": 126.072,
|
|
50
|
+
"cy": 69.487,
|
|
51
|
+
"rx": 34.051,
|
|
52
|
+
"ry": 50.662,
|
|
53
|
+
"fill": "#F89941"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"type": "path",
|
|
57
|
+
"d": "M143.396 69.667C143.396 82.739 139.562 94.472 133.488 102.874C127.412 111.279 119.235 116.2 110.451 116.2C101.666 116.2 93.489 111.279 87.413 102.874C81.34 94.472 77.506 82.739 77.506 69.667C77.506 56.595 81.34 44.862 87.413 36.46C93.489 28.055 101.666 23.134 110.451 23.134C119.235 23.134 127.412 28.055 133.488 36.46C139.562 44.862 143.396 56.595 143.396 69.667Z",
|
|
58
|
+
"fill": "#F89941",
|
|
59
|
+
"stroke": {
|
|
60
|
+
"color": "#E78249",
|
|
61
|
+
"width": 5
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"type": "ellipse",
|
|
66
|
+
"cx": 106.316,
|
|
67
|
+
"cy": 70.849,
|
|
68
|
+
"rx": 33.673,
|
|
69
|
+
"ry": 47.851,
|
|
70
|
+
"fill": "#F89941"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"type": "ellipse",
|
|
74
|
+
"cx": 78.743,
|
|
75
|
+
"cy": 68.448,
|
|
76
|
+
"rx": 35.445,
|
|
77
|
+
"ry": 48.442,
|
|
78
|
+
"fill": "#F89941"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"type": "path",
|
|
82
|
+
"d": "M58.794 69.63C58.794 83.211 62.639 95.399 68.726 104.124C74.819 112.858 82.995 117.935 91.739 117.935C100.484 117.935 108.659 112.858 114.753 104.124C120.84 95.399 124.685 83.211 124.685 69.63C124.685 56.049 120.84 43.861 114.753 35.136C108.659 26.402 100.484 21.325 91.739 21.325C82.995 21.325 74.819 26.402 68.726 35.136C62.639 43.861 58.794 56.049 58.794 69.63Z",
|
|
83
|
+
"fill": "#F89941",
|
|
84
|
+
"stroke": {
|
|
85
|
+
"color": "#E78249",
|
|
86
|
+
"width": 5
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"type": "ellipse",
|
|
91
|
+
"cx": 91.744,
|
|
92
|
+
"cy": 69.763,
|
|
93
|
+
"rx": 32.944,
|
|
94
|
+
"ry": 50.385,
|
|
95
|
+
"fill": "#F89941"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"type": "path",
|
|
99
|
+
"d": "M75.335 70.221C75.335 83.293 79.169 95.025 85.243 103.427C91.319 111.833 99.496 116.753 108.281 116.753C117.065 116.753 125.242 111.833 131.318 103.427C137.392 95.025 141.226 83.293 141.226 70.221C141.226 57.148 137.392 45.416 131.318 37.014C125.242 28.609 117.065 23.688 108.281 23.688C99.496 23.688 91.319 28.609 85.243 37.014C79.169 45.416 75.335 57.148 75.335 70.221Z",
|
|
100
|
+
"fill": "#F89941",
|
|
101
|
+
"stroke": {
|
|
102
|
+
"color": "#E78249",
|
|
103
|
+
"width": 5
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"type": "ellipse",
|
|
108
|
+
"cx": 111.677,
|
|
109
|
+
"cy": 70.871,
|
|
110
|
+
"rx": 32.39,
|
|
111
|
+
"ry": 47.616,
|
|
112
|
+
"fill": "#F89941"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"type": "ellipse",
|
|
116
|
+
"cx": 106.971,
|
|
117
|
+
"cy": 71.425,
|
|
118
|
+
"rx": 33.221,
|
|
119
|
+
"ry": 47.616,
|
|
120
|
+
"fill": "#F89941"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"type": "path",
|
|
124
|
+
"d": "M130.85 46.678C137.21 42.252 138.538 40.633 139.867 39.014C139.867 39.014 141.806 43.824 141.88 46.357C141.954 48.89 141.712 50.147 139.248 51.647C136.783 53.146 127.406 53.045 122.083 52.975C121.31 52.5 122.72 52.337 130.85 46.678Z",
|
|
125
|
+
"fill": "#000000"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"type": "path",
|
|
129
|
+
"d": "M87.765 46.512C81.392 42.141 80.058 40.548 78.724 38.954C78.724 38.954 76.783 45.836 76.758 46.822C76.733 47.808 76.657 50.805 80.247 52C83.837 53.194 91.234 52.772 96.551 52.727C97.322 52.265 95.912 52.099 87.765 46.512Z",
|
|
130
|
+
"fill": "#000000"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"type": "path",
|
|
134
|
+
"d": "M132 90.5C139.156 83.16 141.5 78.283 143.351 72.935C144.24 70.367 134.909 72.043 130 72.935C129.276 73.066 127.751 76.915 127 77C126.182 77.093 123.841 73.076 123 73.086C121.725 73.101 119.727 73.086 117.875 73.429C117.345 74.365 118.367 77.575 117.875 78.283C117.321 78.283 113.796 77.26 113.242 76.43C112.689 74.492 112.949 73.363 112.118 72.532C109.555 72.908 110.023 72.657 107.412 73.086C106.768 73.192 105.09 77.721 104.441 77.82C103.615 77.945 100.644 74.009 99.809 74.114C98.747 74.248 96.821 74.468 95.64 74.577C95.126 74.624 95.554 77.502 95.177 78.283C94.898 78.862 91.426 77.892 90.5 77.5C90.037 76.502 89.844 74.558 89 74.577C83 74.114 81.4 73.843 75.575 70.871C75.575 70.871 74.5 80 83 89C91.5 98 119.127 103.706 132 90.5Z",
|
|
135
|
+
"fill": "#000000"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"type": "path",
|
|
139
|
+
"d": "M107.238 7.252C109.192 1.731 114.678 0.363 117.935 0L120.377 1.816C121.158 2.397 121.842 2.409 122.331 3.257C122.331 4.225 118.337 5.42 114.429 6.582C109.545 8.035 111.482 17.053 114.429 19.281C115.401 20.015 115.524 19.964 117.966 19.964C120.029 19.964 122.387 18.247 123.566 17.353C123.566 17.353 123.861 20.257 121.798 21.478C119.735 22.698 115.578 21.858 115.608 21.966C116.493 23.918 118.89 22.489 120.029 23.336C119.346 23.336 118.556 24.289 116.198 24.533C114.672 24.58 114.135 24.533 112.956 23.918C111.777 23.304 111.482 22.87 110.893 22.14C108.83 23.36 110.893 25.431 110.893 25.431C110.893 25.431 106.472 25.851 105.587 23.918C105.264 23.212 105.882 22.14 105.587 21.966C103.819 22.454 102.935 23.481 99.373 22.87C96.312 22.344 97.102 18.321 96.451 17.353C99.381 18.079 97.131 20.039 101.327 19.964C112.838 19.758 104.796 14.153 107.238 7.252Z",
|
|
140
|
+
"fill": "#5D725F"
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"labels": []
|
|
144
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "qrdx.frame",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"artboard": {
|
|
5
|
+
"width": 316,
|
|
6
|
+
"height": 316
|
|
7
|
+
},
|
|
8
|
+
"qr": {
|
|
9
|
+
"x": 20,
|
|
10
|
+
"y": 20,
|
|
11
|
+
"size": 276,
|
|
12
|
+
"padding": 0,
|
|
13
|
+
"plate": "none"
|
|
14
|
+
},
|
|
15
|
+
"colors": {
|
|
16
|
+
"frame": "#000000"
|
|
17
|
+
},
|
|
18
|
+
"shapes": [
|
|
19
|
+
{
|
|
20
|
+
"type": "path",
|
|
21
|
+
"d": "M308 8H8v300h300V8ZM0 0v316h316V0H0Z",
|
|
22
|
+
"fill": "frame",
|
|
23
|
+
"fillRule": "evenodd"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"labels": []
|
|
27
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "qrdx.frame",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"artboard": {
|
|
5
|
+
"width": 208,
|
|
6
|
+
"height": 298
|
|
7
|
+
},
|
|
8
|
+
"qr": {
|
|
9
|
+
"x": 14,
|
|
10
|
+
"y": 14,
|
|
11
|
+
"size": 180,
|
|
12
|
+
"padding": 0,
|
|
13
|
+
"plate": "none"
|
|
14
|
+
},
|
|
15
|
+
"colors": {
|
|
16
|
+
"frame": "#000000"
|
|
17
|
+
},
|
|
18
|
+
"shapes": [
|
|
19
|
+
{
|
|
20
|
+
"type": "path",
|
|
21
|
+
"d": "M197 0.7h-186a10.25 10.25 0 0 0 -10.2 10.12v186A10.13 10.13 0 0 0 11 207H197a10.13 10.13 0 0 0 10.12 -10.12v-186A10.13 10.13 0 0 0 197 0.7Zm2.36 193.05a5.46 5.46 0 0 1 -5.47 5.47H14.16a5.46 5.46 0 0 1 -5.47 -5.47V13.93a5.46 5.46 0 0 1 5.47 -5.47H193.91a5.46 5.46 0 0 1 5.47 5.47Z",
|
|
22
|
+
"fill": "frame"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"type": "path",
|
|
26
|
+
"d": "M197.54 237.81H127.61a2.29 2.29 0 0 1 -1.62 -0.67l-20.55 -20.55a2.33 2.33 0 0 0 -3.25 0l-20.55 20.55a2.29 2.29 0 0 1 -1.62 0.67H10.09A9.15 9.15 0 0 0 0.93 247v41.17a9.16 9.16 0 0 0 9.16 9.16H197.61a9.09 9.09 0 0 0 9.09 -9.16V247A9.16 9.16 0 0 0 197.54 237.81Z",
|
|
27
|
+
"fill": "frame"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"labels": []
|
|
31
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "qrdx.frame",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"artboard": {
|
|
5
|
+
"width": 252,
|
|
6
|
+
"height": 300
|
|
7
|
+
},
|
|
8
|
+
"qr": {
|
|
9
|
+
"x": 40,
|
|
10
|
+
"y": 38,
|
|
11
|
+
"size": 174,
|
|
12
|
+
"padding": 0,
|
|
13
|
+
"plate": "none"
|
|
14
|
+
},
|
|
15
|
+
"colors": {
|
|
16
|
+
"frame": "#000000"
|
|
17
|
+
},
|
|
18
|
+
"shapes": [
|
|
19
|
+
{
|
|
20
|
+
"type": "path",
|
|
21
|
+
"d": "M171.11 290.77l-7.28 4.88a2.16 2.16 0 0 0 -0.57 3a2.21 2.21 0 0 0 1.77 0.92a2.4 2.4 0 0 0 1.2 -0.35l7.28 -4.88a2.14 2.14 0 0 0 -2.4 -3.54Z",
|
|
22
|
+
"fill": "#22071b"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"type": "path",
|
|
26
|
+
"d": "M242.85 227.52l-7.28 4.87a2.16 2.16 0 0 0 -0.57 3a2.21 2.21 0 0 0 1.77 0.92a1.86 1.86 0 0 0 1.2 -0.35l7.28 -4.88a2.13 2.13 0 1 0 -2.4 -3.53Z",
|
|
27
|
+
"fill": "#22071b"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"type": "path",
|
|
31
|
+
"d": "M17 176.34l-9.11 6.08a2.15 2.15 0 0 0 -0.57 3a2.19 2.19 0 0 0 1.77 0.92a2.14 2.14 0 0 0 1.2 -0.35l9.12 -6.08A2.14 2.14 0 0 0 17 176.34Z",
|
|
32
|
+
"fill": "#22071b"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"type": "path",
|
|
36
|
+
"d": "M17 269.08l-9.11 6.07a2.15 2.15 0 0 0 -0.57 3a2.19 2.19 0 0 0 1.77 0.92a2.92 2.92 0 0 0 1.2 -0.35l9.12 -6.08A2.14 2.14 0 0 0 17 269.08Z",
|
|
37
|
+
"fill": "#22071b"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"type": "path",
|
|
41
|
+
"d": "M123 10.1a2.4 2.4 0 0 0 1.14 -0.35l7.7 -5.16a2.13 2.13 0 0 0 -2.4 -3.53l-7.64 5.15a2.15 2.15 0 0 0 -0.56 3A2.19 2.19 0 0 0 123 10.1Z",
|
|
42
|
+
"fill": "#22071b"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"type": "path",
|
|
46
|
+
"d": "M251.54 54.77a2.14 2.14 0 0 0 -3 -0.56l-17.1 11.45V31.31a10.18 10.18 0 0 0 -10.18 -10.18H113.22l-10.39 7a2.4 2.4 0 0 1 -1.2 0.35a2.21 2.21 0 0 1 -1.77 -0.92a2.15 2.15 0 0 1 0.57 -3l1.41 -0.92l13.64 -8.76a2.1 2.1 0 1 0 -2.26 -3.54L98 21.2h-8.13l-10.39 7a2.37 2.37 0 0 1 -1.2 0.35a2.19 2.19 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3L100 9.25a2.13 2.13 0 1 0 -2.4 -3.53l-23 15.48H34.2A10.18 10.18 0 0 0 24 31.38v28L7.34 70.46a2.09 2.09 0 0 0 -0.57 3a2 2 0 0 0 1.77 0.92a2.58 2.58 0 0 0 1.2 -0.35l14.35 -9.54l3.18 -2.12a2.14 2.14 0 1 1 2.41 3.53l-5.52 3.67V76.9l-7 4.66a2.15 2.15 0 0 0 -0.56 3a2 2 0 0 0 1.77 0.92a2.34 2.34 0 0 0 1.2 -0.36l7.35 -4.94A2.13 2.13 0 0 1 28.69 84l-4.46 3v65.66L1.05 168.07a2.15 2.15 0 0 0 -0.57 3a2 2 0 0 0 1.77 0.92a2.37 2.37 0 0 0 1.2 -0.35l25 -16.75a2 2 0 0 1 2.62 0.77a2.16 2.16 0 0 1 -0.57 3l-6.36 4.24V275a10.09 10.09 0 0 0 9.83 10.11l-5.87 4a2.15 2.15 0 0 0 -0.57 3a2.06 2.06 0 0 0 1.77 0.92a2.38 2.38 0 0 0 1.2 -0.36l23 -15.41a2.14 2.14 0 0 1 2.41 3.54l-6.58 4.45h52l-5.58 3.75a2.14 2.14 0 0 0 -0.56 3a2 2 0 0 0 1.76 0.91a2.37 2.37 0 0 0 1.2 -0.35l30.54 -20.28a2.15 2.15 0 0 1 3 0.56a2.1 2.1 0 0 1 -0.57 3l-14.21 9.54H193l-4.6 3a2.16 2.16 0 0 0 -0.63 3a2.11 2.11 0 0 0 1.76 1a2 2 0 0 0 1.13 -0.36L213 277.35a2.14 2.14 0 1 1 2.33 3.6l-6.78 4.38h13a10.18 10.18 0 0 0 10.18 -10.18v-91.1l-4.38 3a2.43 2.43 0 0 1 -1.2 0.35a2.19 2.19 0 0 1 -1.77 -0.92a2.15 2.15 0 0 1 0.57 -3l24.38 -16.33a2.13 2.13 0 1 0 -2.4 -3.53l-15.48 10.25V91.53l-4.38 3a2.34 2.34 0 0 1 -1.21 0.36a2.22 2.22 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3l6.72 -4.52l13.71 -9.19a2.14 2.14 0 0 0 -2.4 -3.54l-11.24 7.57V75.84l-4.38 3a2.34 2.34 0 0 1 -1.21 0.36a2.22 2.22 0 0 1 -1.76 -0.92a2.15 2.15 0 0 1 0.56 -3l6.72 -4.52l19.43 -13.08A2.05 2.05 0 0 0 251.54 54.77ZM213 216.07h-172a5.23 5.23 0 0 1 -5.23 -5.24V38.94a5.22 5.22 0 0 1 5.23 -5.23H213a5.22 5.22 0 0 1 5.23 5.23V210.83h0.07A5.22 5.22 0 0 1 213 216.07Z",
|
|
47
|
+
"fill": "#22071b"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"type": "path",
|
|
51
|
+
"d": "M246.45 139.8l-7.28 4.88a2.15 2.15 0 0 0 -0.56 3a2.22 2.22 0 0 0 1.76 0.92a2.44 2.44 0 0 0 1.21 -0.36l7.28 -4.87a2.14 2.14 0 0 0 -2.41 -3.54Z",
|
|
52
|
+
"fill": "#22071b"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"labels": []
|
|
56
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// The Square Border template: its artwork is a frame spec (./specs/square-border.json),
|
|
2
|
+
// drawn by the frame engine in the template's own box (./frame-template.tsx).
|
|
3
|
+
import type { TemplateDefinition } from "../../types";
|
|
4
|
+
import type { FrameSpec } from "../../types/frame-spec";
|
|
5
|
+
import { frameTemplate } from "./frame-template";
|
|
6
|
+
import squareBorder from "./specs/square-border.json";
|
|
7
|
+
|
|
8
|
+
export const SquareBorder: TemplateDefinition = frameTemplate({
|
|
9
|
+
id: "SquareBorder",
|
|
10
|
+
name: "Square Border",
|
|
11
|
+
description: "QR code with square decorative border",
|
|
12
|
+
spec: squareBorder as unknown as FrameSpec,
|
|
13
|
+
at: { x: 0, y: 0, scale: 300 / 316 },
|
|
14
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// The Standard Box template: its artwork is a frame spec (./specs/standard-box.json),
|
|
2
|
+
// drawn by the frame engine in the template's own box (./frame-template.tsx).
|
|
3
|
+
import type { TemplateDefinition } from "../../types";
|
|
4
|
+
import type { FrameSpec } from "../../types/frame-spec";
|
|
5
|
+
import { frameTemplate } from "./frame-template";
|
|
6
|
+
import standardBox from "./specs/standard-box.json";
|
|
7
|
+
|
|
8
|
+
export const StandardBox: TemplateDefinition = frameTemplate({
|
|
9
|
+
id: "StandardBox",
|
|
10
|
+
name: "Standard Box",
|
|
11
|
+
description: "QR code with standard box",
|
|
12
|
+
spec: standardBox as unknown as FrameSpec,
|
|
13
|
+
at: { x: 46, y: 1, scale: 1 },
|
|
14
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// The Striked Box template: its artwork is a frame spec (./specs/striked-box.json),
|
|
2
|
+
// drawn by the frame engine in the template's own box (./frame-template.tsx).
|
|
3
|
+
import type { TemplateDefinition } from "../../types";
|
|
4
|
+
import type { FrameSpec } from "../../types/frame-spec";
|
|
5
|
+
import { frameTemplate } from "./frame-template";
|
|
6
|
+
import strikedBox from "./specs/striked-box.json";
|
|
7
|
+
|
|
8
|
+
export const StrikedBox: TemplateDefinition = frameTemplate({
|
|
9
|
+
id: "StrikedBox",
|
|
10
|
+
name: "Striked Box",
|
|
11
|
+
description: "QR code with striked box",
|
|
12
|
+
spec: strikedBox as unknown as FrameSpec,
|
|
13
|
+
at: { x: 24, y: 0, scale: 1 },
|
|
14
|
+
});
|