soccer-jersey-fork 1.0.65 → 1.0.67
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.
|
@@ -8,7 +8,7 @@ import { ShirtStyleDirection } from "../types";
|
|
|
8
8
|
export declare const drawStripedThick: (page: Svg, primaryColor: string, secondaryColor: string, direction: ShirtStyleDirection) => import("@svgdotjs/svg.js").Pattern;
|
|
9
9
|
export declare const drawStripedThin: (page: Svg, primaryColor: string, secondaryColor: string, direction: ShirtStyleDirection) => import("@svgdotjs/svg.js").Pattern;
|
|
10
10
|
export declare const drawStripedNormal: (page: Svg, primaryColor: string, secondaryColor: string, direction: ShirtStyleDirection) => import("@svgdotjs/svg.js").Pattern;
|
|
11
|
-
export declare const drawCheckered: (page: Svg, primaryColor: string, secondaryColor: string) => import("@svgdotjs/svg.js").Pattern;
|
|
11
|
+
export declare const drawCheckered: (page: Svg, primaryColor: string, secondaryColor: string, direction?: ShirtStyleDirection) => import("@svgdotjs/svg.js").Pattern;
|
|
12
12
|
export declare const drawDiamonds: (page: Svg, primaryColor: string, secondaryColor: string) => import("@svgdotjs/svg.js").Pattern;
|
|
13
13
|
export declare const drawTwoColors: (page: Svg, primaryColor: string, secondaryColor: string, bandStyle: ShirtStyleDirection) => import("@svgdotjs/svg.js").Pattern;
|
|
14
14
|
export declare const drawSingleBand: (page: Svg, primaryColor: string, secondaryColor: string, bandStyle: ShirtStyleDirection) => import("@svgdotjs/svg.js").Pattern;
|
package/lib/patterns/patterns.js
CHANGED
|
@@ -89,15 +89,25 @@ export const drawStripedNormal = (page, primaryColor, secondaryColor, direction)
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
|
-
export const drawCheckered = (page, primaryColor, secondaryColor) => {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
92
|
+
export const drawCheckered = (page, primaryColor, secondaryColor, direction) => {
|
|
93
|
+
const draw = () => {
|
|
94
|
+
return page.pattern(20, 20, function (add) {
|
|
95
|
+
add.rect(20, 20).fill(primaryColor);
|
|
96
|
+
add.rect(10, 10).fill(secondaryColor ? secondaryColor : "#eee");
|
|
97
|
+
add
|
|
98
|
+
.rect(10, 10)
|
|
99
|
+
.fill(secondaryColor ? secondaryColor : "#eee")
|
|
100
|
+
.move(10, 10);
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
switch (direction) {
|
|
104
|
+
case "diagonalLeft": {
|
|
105
|
+
return draw().rotate(45);
|
|
106
|
+
}
|
|
107
|
+
default: {
|
|
108
|
+
return draw();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
101
111
|
};
|
|
102
112
|
export const drawDiamonds = (page, primaryColor, secondaryColor) => page.pattern(5, 5, function (add) {
|
|
103
113
|
add.rect(5, 5).fill(primaryColor);
|
package/lib/types/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface DrawSoccerJerseyProps {
|
|
|
15
15
|
shirtWidth?: number;
|
|
16
16
|
collarColor?: string;
|
|
17
17
|
sleeveCuffColor?: string;
|
|
18
|
-
texts
|
|
18
|
+
texts: {
|
|
19
19
|
text: string;
|
|
20
20
|
size: number;
|
|
21
21
|
x: number;
|
|
@@ -24,7 +24,7 @@ export interface DrawSoccerJerseyProps {
|
|
|
24
24
|
outlineColor?: string;
|
|
25
25
|
backgroundColor?: string;
|
|
26
26
|
}[];
|
|
27
|
-
images
|
|
27
|
+
images: {
|
|
28
28
|
src: string;
|
|
29
29
|
x: number;
|
|
30
30
|
y: number;
|
|
@@ -57,7 +57,7 @@ export default function drawSoccerJersey({ shirtColor = "plain", sleeveColor, sh
|
|
|
57
57
|
shirtFill = drawDashes(page, optimizedShirtColor, shirtStyleColor ? shirtStyleColor : "#222", shirtStyleDirection ? shirtStyleDirection : "vertical");
|
|
58
58
|
break;
|
|
59
59
|
case "checkered":
|
|
60
|
-
shirtFill = drawCheckered(page, optimizedShirtColor, shirtStyleColor ? shirtStyleColor : "#222");
|
|
60
|
+
shirtFill = drawCheckered(page, optimizedShirtColor, shirtStyleColor ? shirtStyleColor : "#222", shirtStyleDirection);
|
|
61
61
|
break;
|
|
62
62
|
case "diamonds":
|
|
63
63
|
shirtFill = drawDiamonds(page, optimizedShirtColor, shirtStyleColor ? shirtStyleColor : "#222");
|