soccer-jersey-fork 1.0.26 → 1.0.28
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.
|
@@ -15,10 +15,8 @@ export const Default = {
|
|
|
15
15
|
textColor: "#fff",
|
|
16
16
|
collarColor: "red",
|
|
17
17
|
sleeveCuffColor: "yellow",
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
src: "https://resources.simcups.com/flags/w80/264.png",
|
|
21
|
-
},
|
|
18
|
+
shortsColor: "black",
|
|
19
|
+
image: "https://resources.simcups.com/flags/w80/264.png",
|
|
22
20
|
},
|
|
23
21
|
};
|
|
24
22
|
export const ARS = {
|
|
@@ -29,7 +27,7 @@ export const ARS = {
|
|
|
29
27
|
shirtStyle: "checkered",
|
|
30
28
|
shirtStyleColor: "#dc0001",
|
|
31
29
|
textColor: "#fff",
|
|
32
|
-
|
|
30
|
+
shortsColor: "black",
|
|
33
31
|
},
|
|
34
32
|
};
|
|
35
33
|
export const AVL = {
|
|
@@ -39,7 +37,7 @@ export const AVL = {
|
|
|
39
37
|
sleeveColor: "#94bee5",
|
|
40
38
|
shirtStyle: "plain",
|
|
41
39
|
textColor: "#fff",
|
|
42
|
-
|
|
40
|
+
shortsColor: "black",
|
|
43
41
|
},
|
|
44
42
|
};
|
|
45
43
|
export const BHA = {
|
|
@@ -50,7 +48,7 @@ export const BHA = {
|
|
|
50
48
|
shirtStyle: "striped-thin",
|
|
51
49
|
shirtStyleColor: "#fff",
|
|
52
50
|
textColor: "#fff",
|
|
53
|
-
|
|
51
|
+
shortsColor: "black",
|
|
54
52
|
},
|
|
55
53
|
};
|
|
56
54
|
export const BUR = {
|
|
@@ -59,7 +57,7 @@ export const BUR = {
|
|
|
59
57
|
shirtColor: "#81204c",
|
|
60
58
|
sleeveColor: "#8bd3f5",
|
|
61
59
|
textColor: "#fff",
|
|
62
|
-
|
|
60
|
+
shortsColor: "black",
|
|
63
61
|
},
|
|
64
62
|
};
|
|
65
63
|
export const CHE = {
|
|
@@ -69,7 +67,7 @@ export const CHE = {
|
|
|
69
67
|
sleeveColor: "#001489",
|
|
70
68
|
shirtStyle: "plain",
|
|
71
69
|
textColor: "#fff",
|
|
72
|
-
|
|
70
|
+
shortsColor: "black",
|
|
73
71
|
},
|
|
74
72
|
};
|
|
75
73
|
export const CRY = {
|
|
@@ -80,7 +78,7 @@ export const CRY = {
|
|
|
80
78
|
shirtStyle: "striped",
|
|
81
79
|
shirtStyleColor: "#ff362b",
|
|
82
80
|
textColor: "#fff",
|
|
83
|
-
|
|
81
|
+
shortsColor: "black",
|
|
84
82
|
},
|
|
85
83
|
};
|
|
86
84
|
export const FUL = {
|
|
@@ -90,7 +88,7 @@ export const FUL = {
|
|
|
90
88
|
sleeveColor: "#333",
|
|
91
89
|
shirtStyle: "plain",
|
|
92
90
|
textColor: "#222",
|
|
93
|
-
|
|
91
|
+
shortsColor: "black",
|
|
94
92
|
},
|
|
95
93
|
};
|
|
96
94
|
export const LEE = {
|
|
@@ -100,7 +98,7 @@ export const LEE = {
|
|
|
100
98
|
sleeveColor: "#ffffff",
|
|
101
99
|
shirtStyle: "plain",
|
|
102
100
|
textColor: "#1d4189",
|
|
103
|
-
|
|
101
|
+
shortsColor: "black",
|
|
104
102
|
},
|
|
105
103
|
};
|
|
106
104
|
export const LEI = {
|
|
@@ -110,7 +108,7 @@ export const LEI = {
|
|
|
110
108
|
sleeveColor: "#003090",
|
|
111
109
|
shirtStyle: "plain",
|
|
112
110
|
textColor: "#fefefe",
|
|
113
|
-
|
|
111
|
+
shortsColor: "black",
|
|
114
112
|
},
|
|
115
113
|
};
|
|
116
114
|
export const LIV = {
|
|
@@ -120,7 +118,7 @@ export const LIV = {
|
|
|
120
118
|
sleeveColor: "#e31b23",
|
|
121
119
|
shirtStyle: "plain",
|
|
122
120
|
textColor: "#fff",
|
|
123
|
-
|
|
121
|
+
shortsColor: "black",
|
|
124
122
|
},
|
|
125
123
|
};
|
|
126
124
|
export const MCI = {
|
|
@@ -139,7 +137,7 @@ export const MUN = {
|
|
|
139
137
|
sleeveColor: "#c70101",
|
|
140
138
|
shirtStyle: "plain",
|
|
141
139
|
textColor: "#fed500",
|
|
142
|
-
|
|
140
|
+
shortsColor: "black",
|
|
143
141
|
},
|
|
144
142
|
};
|
|
145
143
|
export const NEW = {
|
|
@@ -150,7 +148,7 @@ export const NEW = {
|
|
|
150
148
|
shirtStyle: "striped",
|
|
151
149
|
shirtStyleColor: "#111",
|
|
152
150
|
textColor: "#00bcf6",
|
|
153
|
-
|
|
151
|
+
shortsColor: "black",
|
|
154
152
|
},
|
|
155
153
|
};
|
|
156
154
|
export const SHE = {
|
|
@@ -172,7 +170,7 @@ export const SOU = {
|
|
|
172
170
|
shirtStyleColor: "#fff",
|
|
173
171
|
textColor: "#111",
|
|
174
172
|
shirtStyleDirection: "diagonal-left",
|
|
175
|
-
|
|
173
|
+
shortsColor: "black",
|
|
176
174
|
},
|
|
177
175
|
};
|
|
178
176
|
export const TOT = {
|
|
@@ -182,7 +180,7 @@ export const TOT = {
|
|
|
182
180
|
sleeveColor: "#0a225c",
|
|
183
181
|
shirtStyle: "plain",
|
|
184
182
|
textColor: "#d31145",
|
|
185
|
-
|
|
183
|
+
shortsColor: "black",
|
|
186
184
|
},
|
|
187
185
|
};
|
|
188
186
|
export const WIG = {
|
|
@@ -194,7 +192,7 @@ export const WIG = {
|
|
|
194
192
|
shirtStyleColor: "#002f68",
|
|
195
193
|
textColor: "#fff",
|
|
196
194
|
textBackgroundColor: "#002f68",
|
|
197
|
-
|
|
195
|
+
shortsColor: "black",
|
|
198
196
|
},
|
|
199
197
|
};
|
|
200
198
|
export const WHU = {
|
|
@@ -204,7 +202,7 @@ export const WHU = {
|
|
|
204
202
|
sleeveColor: "#59b3e4",
|
|
205
203
|
shirtStyle: "plain",
|
|
206
204
|
textColor: "#fff",
|
|
207
|
-
|
|
205
|
+
shortsColor: "black",
|
|
208
206
|
},
|
|
209
207
|
};
|
|
210
208
|
export const WOL = {
|
|
@@ -214,7 +212,7 @@ export const WOL = {
|
|
|
214
212
|
sleeveColor: "#333",
|
|
215
213
|
shirtStyle: "plain",
|
|
216
214
|
textColor: "#222",
|
|
217
|
-
|
|
215
|
+
shortsColor: "black",
|
|
218
216
|
},
|
|
219
217
|
};
|
|
220
218
|
export const PSG = {
|
|
@@ -226,7 +224,7 @@ export const PSG = {
|
|
|
226
224
|
shirtStyleColor: "#cc1339",
|
|
227
225
|
textColor: "#fff",
|
|
228
226
|
shirtStyleDirection: "vertical",
|
|
229
|
-
|
|
227
|
+
shortsColor: "black",
|
|
230
228
|
},
|
|
231
229
|
};
|
|
232
230
|
export const ACM = {
|
|
@@ -237,7 +235,7 @@ export const ACM = {
|
|
|
237
235
|
shirtStyle: "striped",
|
|
238
236
|
shirtStyleColor: "#222",
|
|
239
237
|
textColor: "#fff",
|
|
240
|
-
|
|
238
|
+
shortsColor: "black",
|
|
241
239
|
},
|
|
242
240
|
};
|
|
243
241
|
export const BAR = {
|
|
@@ -248,7 +246,7 @@ export const BAR = {
|
|
|
248
246
|
shirtStyle: "striped-thick",
|
|
249
247
|
shirtStyleColor: "#84112b",
|
|
250
248
|
textColor: "#fff",
|
|
251
|
-
|
|
249
|
+
shortsColor: "black",
|
|
252
250
|
},
|
|
253
251
|
};
|
|
254
252
|
export const FCB = {
|
|
@@ -258,7 +256,7 @@ export const FCB = {
|
|
|
258
256
|
sleeveColor: "#d1122e",
|
|
259
257
|
shirtStyle: "plain",
|
|
260
258
|
textColor: "#fff",
|
|
261
|
-
|
|
259
|
+
shortsColor: "black",
|
|
262
260
|
},
|
|
263
261
|
};
|
|
264
262
|
export const JUV = {
|
|
@@ -269,7 +267,7 @@ export const JUV = {
|
|
|
269
267
|
shirtStyle: "striped",
|
|
270
268
|
shirtStyleColor: "#222",
|
|
271
269
|
textColor: "#e1ceaf",
|
|
272
|
-
|
|
270
|
+
shortsColor: "black",
|
|
273
271
|
},
|
|
274
272
|
};
|
|
275
273
|
export const BVB = {
|
|
@@ -282,7 +280,7 @@ export const BVB = {
|
|
|
282
280
|
shirtStyleDirection: "diagonal-right",
|
|
283
281
|
textColor: "#fff",
|
|
284
282
|
textBackgroundColor: "#333",
|
|
285
|
-
|
|
283
|
+
shortsColor: "black",
|
|
286
284
|
},
|
|
287
285
|
};
|
|
288
286
|
export const CAG = {
|
|
@@ -293,7 +291,7 @@ export const CAG = {
|
|
|
293
291
|
shirtStyle: "two-color",
|
|
294
292
|
shirtStyleColor: "#1d2c47",
|
|
295
293
|
textColor: "#fff",
|
|
296
|
-
|
|
294
|
+
shortsColor: "black",
|
|
297
295
|
},
|
|
298
296
|
};
|
|
299
297
|
export const MON = {
|
|
@@ -305,7 +303,7 @@ export const MON = {
|
|
|
305
303
|
shirtStyleColor: "#e53236",
|
|
306
304
|
shirtStyleDirection: "diagonal-left",
|
|
307
305
|
textColor: "#fff",
|
|
308
|
-
|
|
306
|
+
shortsColor: "black",
|
|
309
307
|
},
|
|
310
308
|
};
|
|
311
309
|
export const INT = {
|
|
@@ -316,6 +314,6 @@ export const INT = {
|
|
|
316
314
|
shirtStyle: "waves",
|
|
317
315
|
shirtStyleColor: "#222",
|
|
318
316
|
textColor: "#fff",
|
|
319
|
-
|
|
317
|
+
shortsColor: "black",
|
|
320
318
|
},
|
|
321
319
|
};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -12,14 +12,12 @@ export interface DrawSoccerJerseyProps {
|
|
|
12
12
|
shirtWidth?: number;
|
|
13
13
|
collarColor?: string;
|
|
14
14
|
sleeveCuffColor?: string;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
shortColor: string;
|
|
15
|
+
image?: string;
|
|
16
|
+
imageWidth?: number;
|
|
17
|
+
imageHeight?: number;
|
|
18
|
+
imageX?: number;
|
|
19
|
+
imageY?: number;
|
|
20
|
+
shortsColor: string;
|
|
23
21
|
withDefaultBadge?: boolean;
|
|
24
22
|
withShorts?: boolean;
|
|
25
23
|
}
|
|
@@ -27,4 +27,4 @@ import { DrawSoccerJerseyProps } from "../types";
|
|
|
27
27
|
* @return {string} A data URL ready for direct use as src attribute
|
|
28
28
|
* on <img />
|
|
29
29
|
*/
|
|
30
|
-
export default function drawSoccerJersey({ shirtText, textColor, textOutlineColor, textBackgroundColor, shirtColor, sleeveColor, shirtStyle, shirtStyleColor, shirtStyleDirection, isBack, shirtWidth, collarColor, sleeveCuffColor,
|
|
30
|
+
export default function drawSoccerJersey({ shirtText, textColor, textOutlineColor, textBackgroundColor, shirtColor, sleeveColor, shirtStyle, shirtStyleColor, shirtStyleDirection, isBack, shirtWidth, collarColor, sleeveCuffColor, shortsColor, image, imageHeight, imageWidth, imageX, imageY, withDefaultBadge, withShorts, }: DrawSoccerJerseyProps): string;
|
|
@@ -30,7 +30,7 @@ import { drawHoops, drawSingleBand, drawStriped, drawCheckered, drawTwoColor, dr
|
|
|
30
30
|
* @return {string} A data URL ready for direct use as src attribute
|
|
31
31
|
* on <img />
|
|
32
32
|
*/
|
|
33
|
-
export default function drawSoccerJersey({ shirtText, textColor, textOutlineColor, textBackgroundColor, shirtColor = "plain", sleeveColor, shirtStyle, shirtStyleColor, shirtStyleDirection, isBack = false, shirtWidth = 200, collarColor, sleeveCuffColor,
|
|
33
|
+
export default function drawSoccerJersey({ shirtText, textColor, textOutlineColor, textBackgroundColor, shirtColor = "plain", sleeveColor, shirtStyle, shirtStyleColor, shirtStyleDirection, isBack = false, shirtWidth = 200, collarColor, sleeveCuffColor, shortsColor, image, imageHeight, imageWidth, imageX, imageY, withDefaultBadge = true, withShorts = true, }) {
|
|
34
34
|
// Colors and Color Optimizations
|
|
35
35
|
const optimizedSleeveColor = lightenDarkenColor(sleeveColor, -10);
|
|
36
36
|
const optimizedShirtColor = lightenDarkenColor(shirtColor, -10);
|
|
@@ -98,11 +98,11 @@ export default function drawSoccerJersey({ shirtText, textColor, textOutlineColo
|
|
|
98
98
|
.fill("none")
|
|
99
99
|
.stroke({ color: collarColor, width: 2 });
|
|
100
100
|
}
|
|
101
|
-
if (
|
|
101
|
+
if (image) {
|
|
102
102
|
page
|
|
103
|
-
.image(
|
|
104
|
-
.size(
|
|
105
|
-
.move(
|
|
103
|
+
.image(image)
|
|
104
|
+
.size(imageWidth || 20, imageHeight || 20)
|
|
105
|
+
.move(imageX || 40, imageY || 45);
|
|
106
106
|
}
|
|
107
107
|
if (withDefaultBadge) {
|
|
108
108
|
page
|
|
@@ -174,7 +174,7 @@ export default function drawSoccerJersey({ shirtText, textColor, textOutlineColo
|
|
|
174
174
|
if (withShorts) {
|
|
175
175
|
page.width(shirtWidth);
|
|
176
176
|
const pathShorts = `m 23 98 c 5 6, 50 6, 56 0 l 2 ${shortsHeight} c 0 5, -27 5, -27.5 0 l -2 -10, -2 10, c 0 5, -27 5, -27.5 0 l 1 -${shortsHeight}`;
|
|
177
|
-
page.path(pathShorts).fill(
|
|
177
|
+
page.path(pathShorts).fill(shortsColor);
|
|
178
178
|
}
|
|
179
179
|
// +10 is some extra room with the shorts height, so the total should be 150
|
|
180
180
|
page.viewbox(`0 0 102 ${100 + shortsHeight + 10}`);
|