@svg-gen/tech-svg-generator 1.0.0
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/LICENSE +21 -0
- package/README.md +320 -0
- package/dist/cartoon.d.ts +53 -0
- package/dist/cartoon.d.ts.map +1 -0
- package/dist/cartoon.js +233 -0
- package/dist/characters.d.ts +47 -0
- package/dist/characters.d.ts.map +1 -0
- package/dist/characters.js +422 -0
- package/dist/generator.d.ts +36 -0
- package/dist/generator.d.ts.map +1 -0
- package/dist/generator.js +103 -0
- package/dist/icons.d.ts +10 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.js +44 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/parser.d.ts +83 -0
- package/dist/parser.d.ts.map +1 -0
- package/dist/parser.js +204 -0
- package/dist/primitives.d.ts +42 -0
- package/dist/primitives.d.ts.map +1 -0
- package/dist/primitives.js +141 -0
- package/dist/scenes.d.ts +11 -0
- package/dist/scenes.d.ts.map +1 -0
- package/dist/scenes.js +257 -0
- package/dist/themes.d.ts +32 -0
- package/dist/themes.d.ts.map +1 -0
- package/dist/themes.js +106 -0
- package/dist/types.d.ts +51 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/package.json +65 -0
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Character definitions for cartoon strips
|
|
3
|
+
* Improved cartoon-style characters with better proportions and expressions
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Predefined character styles - diverse and visually distinct
|
|
7
|
+
*/
|
|
8
|
+
export const CHARACTER_PRESETS = {
|
|
9
|
+
alex: {
|
|
10
|
+
primary: '#4f46e5', // Indigo hair
|
|
11
|
+
secondary: '#3b82f6', // Blue hoodie
|
|
12
|
+
skin: '#fcd5b8',
|
|
13
|
+
hairStyle: 'short',
|
|
14
|
+
accessory: 'glasses',
|
|
15
|
+
eyeColor: '#1e40af',
|
|
16
|
+
shirtStyle: 'hoodie',
|
|
17
|
+
},
|
|
18
|
+
sam: {
|
|
19
|
+
primary: '#7c3aed', // Purple curly hair
|
|
20
|
+
secondary: '#10b981', // Green shirt
|
|
21
|
+
skin: '#d4a574',
|
|
22
|
+
hairStyle: 'curly',
|
|
23
|
+
accessory: 'none',
|
|
24
|
+
eyeColor: '#065f46',
|
|
25
|
+
shirtStyle: 'tshirt',
|
|
26
|
+
},
|
|
27
|
+
jordan: {
|
|
28
|
+
primary: '#f59e0b', // Blonde/orange long hair
|
|
29
|
+
secondary: '#ef4444', // Red shirt
|
|
30
|
+
skin: '#fce7d6',
|
|
31
|
+
hairStyle: 'long',
|
|
32
|
+
accessory: 'headphones',
|
|
33
|
+
eyeColor: '#92400e',
|
|
34
|
+
shirtStyle: 'tshirt',
|
|
35
|
+
},
|
|
36
|
+
casey: {
|
|
37
|
+
primary: '#1f2937', // Dark spiky hair
|
|
38
|
+
secondary: '#8b5cf6', // Purple hoodie
|
|
39
|
+
skin: '#8d6e4c',
|
|
40
|
+
hairStyle: 'spiky',
|
|
41
|
+
accessory: 'none',
|
|
42
|
+
eyeColor: '#1f2937',
|
|
43
|
+
shirtStyle: 'hoodie',
|
|
44
|
+
},
|
|
45
|
+
riley: {
|
|
46
|
+
primary: '#ec4899', // Pink hair
|
|
47
|
+
secondary: '#6366f1', // Indigo shirt
|
|
48
|
+
skin: '#fcd5b8',
|
|
49
|
+
hairStyle: 'ponytail',
|
|
50
|
+
accessory: 'none',
|
|
51
|
+
eyeColor: '#be185d',
|
|
52
|
+
shirtStyle: 'tshirt',
|
|
53
|
+
},
|
|
54
|
+
morgan: {
|
|
55
|
+
primary: '#059669', // Teal/green hair
|
|
56
|
+
secondary: '#f97316', // Orange hoodie
|
|
57
|
+
skin: '#e0c8a8',
|
|
58
|
+
hairStyle: 'mohawk',
|
|
59
|
+
accessory: 'sunglasses',
|
|
60
|
+
eyeColor: '#047857',
|
|
61
|
+
shirtStyle: 'hoodie',
|
|
62
|
+
},
|
|
63
|
+
taylor: {
|
|
64
|
+
primary: '#dc2626', // Red hair
|
|
65
|
+
secondary: '#1f2937', // Dark formal
|
|
66
|
+
skin: '#fce7d6',
|
|
67
|
+
hairStyle: 'short',
|
|
68
|
+
accessory: 'none',
|
|
69
|
+
eyeColor: '#166534',
|
|
70
|
+
shirtStyle: 'formal',
|
|
71
|
+
},
|
|
72
|
+
robot: {
|
|
73
|
+
primary: '#6b7280', // Gray metallic
|
|
74
|
+
secondary: '#3b82f6', // Blue accents
|
|
75
|
+
skin: '#d1d5db',
|
|
76
|
+
hairStyle: 'bald',
|
|
77
|
+
accessory: 'none',
|
|
78
|
+
eyeColor: '#3b82f6',
|
|
79
|
+
shirtStyle: 'tshirt',
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
// Legacy aliases for backward compatibility
|
|
83
|
+
CHARACTER_PRESETS.dev1 = CHARACTER_PRESETS.alex;
|
|
84
|
+
CHARACTER_PRESETS.dev2 = CHARACTER_PRESETS.sam;
|
|
85
|
+
CHARACTER_PRESETS.dev3 = CHARACTER_PRESETS.jordan;
|
|
86
|
+
CHARACTER_PRESETS.dev4 = CHARACTER_PRESETS.casey;
|
|
87
|
+
CHARACTER_PRESETS.dev5 = CHARACTER_PRESETS.riley;
|
|
88
|
+
/**
|
|
89
|
+
* Get facial features based on emotion
|
|
90
|
+
*/
|
|
91
|
+
function getFace(emotion, eyeColor) {
|
|
92
|
+
const pupil = eyeColor;
|
|
93
|
+
const faces = {
|
|
94
|
+
neutral: {
|
|
95
|
+
leftEye: `<ellipse cx="-8" cy="-2" rx="5" ry="6" fill="white" stroke="#374151" stroke-width="1.5"/>
|
|
96
|
+
<circle cx="-8" cy="-1" r="3" fill="${pupil}"/>
|
|
97
|
+
<circle cx="-7" cy="-2" r="1" fill="white"/>`,
|
|
98
|
+
rightEye: `<ellipse cx="8" cy="-2" rx="5" ry="6" fill="white" stroke="#374151" stroke-width="1.5"/>
|
|
99
|
+
<circle cx="8" cy="-1" r="3" fill="${pupil}"/>
|
|
100
|
+
<circle cx="9" cy="-2" r="1" fill="white"/>`,
|
|
101
|
+
mouth: `<path d="M-6,10 Q0,14 6,10" fill="none" stroke="#374151" stroke-width="2" stroke-linecap="round"/>`,
|
|
102
|
+
extras: '',
|
|
103
|
+
},
|
|
104
|
+
happy: {
|
|
105
|
+
leftEye: `<path d="M-13,-2 Q-8,-6 -3,-2" fill="none" stroke="#374151" stroke-width="2.5" stroke-linecap="round"/>`,
|
|
106
|
+
rightEye: `<path d="M3,-2 Q8,-6 13,-2" fill="none" stroke="#374151" stroke-width="2.5" stroke-linecap="round"/>`,
|
|
107
|
+
mouth: `<path d="M-8,8 Q0,18 8,8" fill="#374151" stroke="#374151" stroke-width="2"/>
|
|
108
|
+
<path d="M-6,10 Q0,8 6,10" fill="#fca5a5" stroke="none"/>`,
|
|
109
|
+
extras: `<path d="M-18,2 L-14,0 M-18,-2 L-14,0" stroke="#f472b6" stroke-width="1.5" stroke-linecap="round"/>
|
|
110
|
+
<path d="M18,2 L14,0 M18,-2 L14,0" stroke="#f472b6" stroke-width="1.5" stroke-linecap="round"/>`,
|
|
111
|
+
},
|
|
112
|
+
sad: {
|
|
113
|
+
leftEye: `<ellipse cx="-8" cy="0" rx="5" ry="5" fill="white" stroke="#374151" stroke-width="1.5"/>
|
|
114
|
+
<circle cx="-8" cy="1" r="3" fill="${pupil}"/>
|
|
115
|
+
<ellipse cx="-8" cy="-4" rx="6" ry="2" fill="none" stroke="#374151" stroke-width="1.5"/>`,
|
|
116
|
+
rightEye: `<ellipse cx="8" cy="0" rx="5" ry="5" fill="white" stroke="#374151" stroke-width="1.5"/>
|
|
117
|
+
<circle cx="8" cy="1" r="3" fill="${pupil}"/>
|
|
118
|
+
<ellipse cx="8" cy="-4" rx="6" ry="2" fill="none" stroke="#374151" stroke-width="1.5"/>`,
|
|
119
|
+
mouth: `<path d="M-6,14 Q0,10 6,14" fill="none" stroke="#374151" stroke-width="2" stroke-linecap="round"/>`,
|
|
120
|
+
extras: `<path d="M-5,6 Q-6,12 -8,16" fill="none" stroke="#60a5fa" stroke-width="2" stroke-linecap="round"/>`,
|
|
121
|
+
},
|
|
122
|
+
angry: {
|
|
123
|
+
leftEye: `<ellipse cx="-8" cy="0" rx="4" ry="5" fill="white" stroke="#374151" stroke-width="1.5"/>
|
|
124
|
+
<circle cx="-8" cy="1" r="2.5" fill="${pupil}"/>
|
|
125
|
+
<path d="M-14,-6 L-3,-3" fill="none" stroke="#374151" stroke-width="2.5" stroke-linecap="round"/>`,
|
|
126
|
+
rightEye: `<ellipse cx="8" cy="0" rx="4" ry="5" fill="white" stroke="#374151" stroke-width="1.5"/>
|
|
127
|
+
<circle cx="8" cy="1" r="2.5" fill="${pupil}"/>
|
|
128
|
+
<path d="M3,-3 L14,-6" fill="none" stroke="#374151" stroke-width="2.5" stroke-linecap="round"/>`,
|
|
129
|
+
mouth: `<path d="M-8,12 L0,10 L8,12" fill="none" stroke="#374151" stroke-width="2.5" stroke-linecap="round"/>`,
|
|
130
|
+
extras: `<path d="M-2,-18 L0,-22 L2,-18" fill="none" stroke="#ef4444" stroke-width="2" stroke-linecap="round"/>
|
|
131
|
+
<path d="M-6,-16 L-7,-20" fill="none" stroke="#ef4444" stroke-width="1.5" stroke-linecap="round"/>
|
|
132
|
+
<path d="M6,-16 L7,-20" fill="none" stroke="#ef4444" stroke-width="1.5" stroke-linecap="round"/>`,
|
|
133
|
+
},
|
|
134
|
+
surprised: {
|
|
135
|
+
leftEye: `<ellipse cx="-8" cy="-1" rx="6" ry="8" fill="white" stroke="#374151" stroke-width="1.5"/>
|
|
136
|
+
<circle cx="-8" cy="0" r="4" fill="${pupil}"/>
|
|
137
|
+
<circle cx="-6" cy="-2" r="1.5" fill="white"/>`,
|
|
138
|
+
rightEye: `<ellipse cx="8" cy="-1" rx="6" ry="8" fill="white" stroke="#374151" stroke-width="1.5"/>
|
|
139
|
+
<circle cx="8" cy="0" r="4" fill="${pupil}"/>
|
|
140
|
+
<circle cx="10" cy="-2" r="1.5" fill="white"/>`,
|
|
141
|
+
mouth: `<ellipse cx="0" cy="13" rx="5" ry="6" fill="#374151"/>
|
|
142
|
+
<ellipse cx="0" cy="12" rx="3" ry="4" fill="#fca5a5"/>`,
|
|
143
|
+
extras: `<path d="M-14,-10 L-14,-14" stroke="#374151" stroke-width="2" stroke-linecap="round"/>
|
|
144
|
+
<path d="M14,-10 L14,-14" stroke="#374151" stroke-width="2" stroke-linecap="round"/>`,
|
|
145
|
+
},
|
|
146
|
+
thinking: {
|
|
147
|
+
leftEye: `<ellipse cx="-8" cy="-2" rx="5" ry="6" fill="white" stroke="#374151" stroke-width="1.5"/>
|
|
148
|
+
<circle cx="-6" cy="-1" r="3" fill="${pupil}"/>
|
|
149
|
+
<circle cx="-5" cy="-2" r="1" fill="white"/>`,
|
|
150
|
+
rightEye: `<ellipse cx="8" cy="-2" rx="5" ry="6" fill="white" stroke="#374151" stroke-width="1.5"/>
|
|
151
|
+
<circle cx="10" cy="-3" r="3" fill="${pupil}"/>
|
|
152
|
+
<circle cx="11" cy="-4" r="1" fill="white"/>`,
|
|
153
|
+
mouth: `<path d="M-4,12 Q2,12 5,10" fill="none" stroke="#374151" stroke-width="2" stroke-linecap="round"/>`,
|
|
154
|
+
extras: `<circle cx="20" cy="-15" r="3" fill="none" stroke="#9ca3af" stroke-width="1.5"/>
|
|
155
|
+
<circle cx="25" cy="-20" r="4" fill="none" stroke="#9ca3af" stroke-width="1.5"/>
|
|
156
|
+
<circle cx="32" cy="-24" r="5" fill="none" stroke="#9ca3af" stroke-width="1.5"/>`,
|
|
157
|
+
},
|
|
158
|
+
confused: {
|
|
159
|
+
leftEye: `<ellipse cx="-8" cy="-2" rx="5" ry="6" fill="white" stroke="#374151" stroke-width="1.5"/>
|
|
160
|
+
<circle cx="-8" cy="-1" r="3" fill="${pupil}"/>
|
|
161
|
+
<path d="M-13,-7 L-3,-5" fill="none" stroke="#374151" stroke-width="2" stroke-linecap="round"/>`,
|
|
162
|
+
rightEye: `<ellipse cx="8" cy="0" rx="5" ry="6" fill="white" stroke="#374151" stroke-width="1.5"/>
|
|
163
|
+
<circle cx="8" cy="1" r="3" fill="${pupil}"/>
|
|
164
|
+
<path d="M3,-3 L13,-5" fill="none" stroke="#374151" stroke-width="2" stroke-linecap="round"/>`,
|
|
165
|
+
mouth: `<path d="M-5,12 Q-2,10 0,12 Q2,14 5,12" fill="none" stroke="#374151" stroke-width="2" stroke-linecap="round"/>`,
|
|
166
|
+
extras: `<text x="18" y="-12" font-size="16" fill="#9ca3af" font-family="sans-serif">?</text>`,
|
|
167
|
+
},
|
|
168
|
+
excited: {
|
|
169
|
+
leftEye: `<path d="M-12,-2 L-8,2 L-4,-2" fill="none" stroke="#374151" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>`,
|
|
170
|
+
rightEye: `<path d="M4,-2 L8,2 L12,-2" fill="none" stroke="#374151" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>`,
|
|
171
|
+
mouth: `<path d="M-10,8 Q0,22 10,8" fill="#374151"/>
|
|
172
|
+
<path d="M-7,12 Q0,10 7,12" fill="#fca5a5"/>`,
|
|
173
|
+
extras: `<path d="M-20,-5 L-16,-3 M-20,-8 L-15,-7" stroke="#fbbf24" stroke-width="2" stroke-linecap="round"/>
|
|
174
|
+
<path d="M20,-5 L16,-3 M20,-8 L15,-7" stroke="#fbbf24" stroke-width="2" stroke-linecap="round"/>
|
|
175
|
+
<circle cx="-15" cy="5" r="4" fill="#fca5a5" opacity="0.5"/>
|
|
176
|
+
<circle cx="15" cy="5" r="4" fill="#fca5a5" opacity="0.5"/>`,
|
|
177
|
+
},
|
|
178
|
+
worried: {
|
|
179
|
+
leftEye: `<ellipse cx="-8" cy="0" rx="5" ry="6" fill="white" stroke="#374151" stroke-width="1.5"/>
|
|
180
|
+
<circle cx="-8" cy="2" r="3" fill="${pupil}"/>
|
|
181
|
+
<path d="M-13,-5 Q-8,-8 -3,-5" fill="none" stroke="#374151" stroke-width="2" stroke-linecap="round"/>`,
|
|
182
|
+
rightEye: `<ellipse cx="8" cy="0" rx="5" ry="6" fill="white" stroke="#374151" stroke-width="1.5"/>
|
|
183
|
+
<circle cx="8" cy="2" r="3" fill="${pupil}"/>
|
|
184
|
+
<path d="M3,-5 Q8,-8 13,-5" fill="none" stroke="#374151" stroke-width="2" stroke-linecap="round"/>`,
|
|
185
|
+
mouth: `<path d="M-6,13 Q0,11 6,13" fill="none" stroke="#374151" stroke-width="2" stroke-linecap="round"/>`,
|
|
186
|
+
extras: `<path d="M-12,6 L-10,4 L-8,6" stroke="#60a5fa" stroke-width="1.5" fill="none"/>
|
|
187
|
+
<path d="M12,6 L10,4 L8,6" stroke="#60a5fa" stroke-width="1.5" fill="none"/>`,
|
|
188
|
+
},
|
|
189
|
+
};
|
|
190
|
+
return faces[emotion] || faces.neutral;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Render hair based on style - improved designs
|
|
194
|
+
*/
|
|
195
|
+
function renderHair(style, skinColor) {
|
|
196
|
+
const c = style.primary;
|
|
197
|
+
switch (style.hairStyle) {
|
|
198
|
+
case 'short':
|
|
199
|
+
return `
|
|
200
|
+
<ellipse cx="0" cy="-22" rx="22" ry="14" fill="${c}"/>
|
|
201
|
+
<path d="M-20,-10 Q-22,-20 -18,-28 Q-10,-35 0,-36 Q10,-35 18,-28 Q22,-20 20,-10" fill="${c}"/>
|
|
202
|
+
<path d="M-15,-30 Q-10,-34 0,-35 Q10,-34 15,-30" fill="${c}" stroke="${c}" stroke-width="3"/>
|
|
203
|
+
`;
|
|
204
|
+
case 'long':
|
|
205
|
+
return `
|
|
206
|
+
<ellipse cx="0" cy="-22" rx="22" ry="14" fill="${c}"/>
|
|
207
|
+
<path d="M-22,-8 Q-26,15 -20,40 Q-18,45 -15,40 Q-18,20 -20,-5" fill="${c}"/>
|
|
208
|
+
<path d="M22,-8 Q26,15 20,40 Q18,45 15,40 Q18,20 20,-5" fill="${c}"/>
|
|
209
|
+
<path d="M-18,-28 Q0,-38 18,-28" fill="${c}"/>
|
|
210
|
+
<path d="M-8,-32 Q0,-36 8,-32" fill="${c}" stroke="${c}" stroke-width="4"/>
|
|
211
|
+
`;
|
|
212
|
+
case 'bald':
|
|
213
|
+
return `<ellipse cx="0" cy="-24" rx="20" ry="12" fill="${skinColor}" opacity="0.3"/>`;
|
|
214
|
+
case 'spiky':
|
|
215
|
+
return `
|
|
216
|
+
<path d="M-18,-20 L-22,-38 L-12,-28 L-8,-42 L-2,-28 L4,-45 L8,-28 L14,-40 L18,-28 L22,-36 L20,-20" fill="${c}"/>
|
|
217
|
+
<ellipse cx="0" cy="-20" rx="20" ry="10" fill="${c}"/>
|
|
218
|
+
`;
|
|
219
|
+
case 'curly':
|
|
220
|
+
return `
|
|
221
|
+
<circle cx="-14" cy="-28" r="8" fill="${c}"/>
|
|
222
|
+
<circle cx="-4" cy="-32" r="9" fill="${c}"/>
|
|
223
|
+
<circle cx="8" cy="-30" r="8" fill="${c}"/>
|
|
224
|
+
<circle cx="16" cy="-24" r="7" fill="${c}"/>
|
|
225
|
+
<circle cx="-18" cy="-20" r="7" fill="${c}"/>
|
|
226
|
+
<circle cx="0" cy="-26" r="10" fill="${c}"/>
|
|
227
|
+
<circle cx="-20" cy="-12" r="6" fill="${c}"/>
|
|
228
|
+
<circle cx="20" cy="-14" r="6" fill="${c}"/>
|
|
229
|
+
`;
|
|
230
|
+
case 'ponytail':
|
|
231
|
+
return `
|
|
232
|
+
<ellipse cx="0" cy="-22" rx="21" ry="13" fill="${c}"/>
|
|
233
|
+
<path d="M-18,-28 Q0,-38 18,-28" fill="${c}"/>
|
|
234
|
+
<ellipse cx="0" cy="-32" rx="8" ry="5" fill="${c}"/>
|
|
235
|
+
<path d="M0,-36 Q15,-38 20,-30 Q28,-25 25,-10 Q24,0 20,10" fill="${c}" stroke="${c}" stroke-width="8" stroke-linecap="round"/>
|
|
236
|
+
<circle cx="0" cy="-38" r="5" fill="${style.secondary}"/>
|
|
237
|
+
`;
|
|
238
|
+
case 'mohawk':
|
|
239
|
+
return `
|
|
240
|
+
<path d="M-6,-25 L-4,-50 L0,-42 L4,-52 L6,-25" fill="${c}"/>
|
|
241
|
+
<ellipse cx="0" cy="-22" rx="18" ry="8" fill="${skinColor}"/>
|
|
242
|
+
<path d="M-16,-18 Q-18,-22 -14,-26 Q-8,-30 0,-30 Q8,-30 14,-26 Q18,-22 16,-18" fill="${skinColor}"/>
|
|
243
|
+
`;
|
|
244
|
+
default:
|
|
245
|
+
return `<ellipse cx="0" cy="-22" rx="22" ry="14" fill="${c}"/>`;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Render accessory - improved designs
|
|
250
|
+
*/
|
|
251
|
+
function renderAccessory(style) {
|
|
252
|
+
switch (style.accessory) {
|
|
253
|
+
case 'glasses':
|
|
254
|
+
return `
|
|
255
|
+
<rect x="-14" y="-6" width="12" height="10" rx="2" fill="none" stroke="#374151" stroke-width="2"/>
|
|
256
|
+
<rect x="2" y="-6" width="12" height="10" rx="2" fill="none" stroke="#374151" stroke-width="2"/>
|
|
257
|
+
<path d="M-2,-1 L2,-1" stroke="#374151" stroke-width="2"/>
|
|
258
|
+
<path d="M-14,-1 L-18,-3" stroke="#374151" stroke-width="2"/>
|
|
259
|
+
<path d="M14,-1 L18,-3" stroke="#374151" stroke-width="2"/>
|
|
260
|
+
`;
|
|
261
|
+
case 'sunglasses':
|
|
262
|
+
return `
|
|
263
|
+
<path d="M-16,-4 L-14,-6 L-2,-6 L-2,4 L-14,4 L-16,-4" fill="#1f2937" stroke="#374151" stroke-width="1.5"/>
|
|
264
|
+
<path d="M16,-4 L14,-6 L2,-6 L2,4 L14,4 L16,-4" fill="#1f2937" stroke="#374151" stroke-width="1.5"/>
|
|
265
|
+
<path d="M-2,-2 L2,-2" stroke="#374151" stroke-width="2"/>
|
|
266
|
+
<path d="M-16,-2 L-20,-4" stroke="#374151" stroke-width="2"/>
|
|
267
|
+
<path d="M16,-2 L20,-4" stroke="#374151" stroke-width="2"/>
|
|
268
|
+
<path d="M-12,-4 L-6,-2" stroke="#60a5fa" stroke-width="1" opacity="0.5"/>
|
|
269
|
+
<path d="M4,-4 L10,-2" stroke="#60a5fa" stroke-width="1" opacity="0.5"/>
|
|
270
|
+
`;
|
|
271
|
+
case 'hat':
|
|
272
|
+
return `
|
|
273
|
+
<ellipse cx="0" cy="-32" rx="26" ry="6" fill="${style.primary}"/>
|
|
274
|
+
<path d="M-18,-32 L-18,-48 Q-18,-56 0,-56 Q18,-56 18,-48 L18,-32" fill="${style.primary}"/>
|
|
275
|
+
<rect x="-18" y="-38" width="36" height="4" fill="${style.secondary}"/>
|
|
276
|
+
`;
|
|
277
|
+
case 'headphones':
|
|
278
|
+
return `
|
|
279
|
+
<path d="M-22,-8 Q-26,-30 0,-34 Q26,-30 22,-8" stroke="#374151" stroke-width="4" fill="none"/>
|
|
280
|
+
<rect x="-28" y="-14" width="10" height="16" rx="3" fill="#374151"/>
|
|
281
|
+
<rect x="18" y="-14" width="10" height="16" rx="3" fill="#374151"/>
|
|
282
|
+
<rect x="-26" y="-12" width="6" height="12" rx="2" fill="#1f2937"/>
|
|
283
|
+
<rect x="20" y="-12" width="6" height="12" rx="2" fill="#1f2937"/>
|
|
284
|
+
`;
|
|
285
|
+
case 'beanie':
|
|
286
|
+
return `
|
|
287
|
+
<path d="M-20,-18 Q-22,-32 0,-36 Q22,-32 20,-18" fill="${style.secondary}"/>
|
|
288
|
+
<path d="M-20,-18 L20,-18" stroke="${style.secondary}" stroke-width="6"/>
|
|
289
|
+
<circle cx="0" cy="-38" r="5" fill="${style.secondary}"/>
|
|
290
|
+
<path d="M-18,-22 L18,-22" stroke="${style.primary}" stroke-width="2" opacity="0.5"/>
|
|
291
|
+
<path d="M-16,-26 L16,-26" stroke="${style.primary}" stroke-width="2" opacity="0.5"/>
|
|
292
|
+
`;
|
|
293
|
+
default:
|
|
294
|
+
return '';
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Render body/clothing - improved designs
|
|
299
|
+
*/
|
|
300
|
+
function renderBody(style) {
|
|
301
|
+
const c = style.secondary;
|
|
302
|
+
switch (style.shirtStyle) {
|
|
303
|
+
case 'hoodie':
|
|
304
|
+
return `
|
|
305
|
+
<path d="M-24,25 Q-28,30 -30,50 L-30,70 L30,70 L30,50 Q28,30 24,25" fill="${c}"/>
|
|
306
|
+
<path d="M-24,25 Q-20,35 0,38 Q20,35 24,25" fill="${c}" stroke="${c}" stroke-width="2"/>
|
|
307
|
+
<path d="M-8,28 Q0,32 8,28" fill="none" stroke="${style.skin}" stroke-width="3"/>
|
|
308
|
+
<ellipse cx="0" cy="50" rx="12" ry="8" fill="${c}" stroke="${darken(c, 20)}" stroke-width="1"/>
|
|
309
|
+
<path d="M-6,46 L-6,54 M6,46 L6,54" stroke="${darken(c, 20)}" stroke-width="1"/>
|
|
310
|
+
`;
|
|
311
|
+
case 'formal':
|
|
312
|
+
return `
|
|
313
|
+
<path d="M-24,25 L-28,70 L28,70 L24,25" fill="${c}"/>
|
|
314
|
+
<path d="M-24,25 Q-15,30 0,32 Q15,30 24,25" fill="white"/>
|
|
315
|
+
<path d="M0,32 L0,70" stroke="${darken(c, 30)}" stroke-width="1"/>
|
|
316
|
+
<path d="M-3,35 L0,32 L3,35" fill="${style.primary}"/>
|
|
317
|
+
<circle cx="-2" cy="45" r="2" fill="${darken(c, 30)}"/>
|
|
318
|
+
<circle cx="-2" cy="55" r="2" fill="${darken(c, 30)}"/>
|
|
319
|
+
<path d="M-24,25 L-20,28 L-16,25" fill="${c}"/>
|
|
320
|
+
<path d="M24,25 L20,28 L16,25" fill="${c}"/>
|
|
321
|
+
`;
|
|
322
|
+
case 'tank':
|
|
323
|
+
return `
|
|
324
|
+
<path d="M-16,25 L-18,70 L18,70 L16,25" fill="${c}"/>
|
|
325
|
+
<path d="M-16,25 Q0,30 16,25" fill="${c}"/>
|
|
326
|
+
<ellipse cx="0" cy="28" rx="10" ry="4" fill="${style.skin}"/>
|
|
327
|
+
`;
|
|
328
|
+
case 'tshirt':
|
|
329
|
+
default:
|
|
330
|
+
return `
|
|
331
|
+
<path d="M-22,25 Q-26,35 -28,50 L-28,70 L28,70 L28,50 Q26,35 22,25" fill="${c}"/>
|
|
332
|
+
<path d="M-22,25 Q-12,32 0,34 Q12,32 22,25" fill="${c}"/>
|
|
333
|
+
<ellipse cx="0" cy="30" rx="8" ry="4" fill="${style.skin}"/>
|
|
334
|
+
`;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Darken a hex color
|
|
339
|
+
*/
|
|
340
|
+
function darken(hex, percent) {
|
|
341
|
+
const num = parseInt(hex.replace('#', ''), 16);
|
|
342
|
+
const amt = Math.round(2.55 * percent);
|
|
343
|
+
const R = Math.max((num >> 16) - amt, 0);
|
|
344
|
+
const G = Math.max((num >> 8 & 0x00FF) - amt, 0);
|
|
345
|
+
const B = Math.max((num & 0x0000FF) - amt, 0);
|
|
346
|
+
return '#' + (0x1000000 + R * 0x10000 + G * 0x100 + B).toString(16).slice(1);
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Render a character at position with emotion - completely redesigned
|
|
350
|
+
*/
|
|
351
|
+
export function renderCharacter(x, y, character, emotion = 'neutral', scale = 1, facing = 'right') {
|
|
352
|
+
const style = character.style;
|
|
353
|
+
const face = getFace(emotion, style.eyeColor);
|
|
354
|
+
const flip = facing === 'left' ? -1 : 1;
|
|
355
|
+
return `
|
|
356
|
+
<g transform="translate(${x}, ${y}) scale(${flip * scale}, ${scale})">
|
|
357
|
+
<!-- Shadow -->
|
|
358
|
+
<ellipse cx="0" cy="72" rx="20" ry="5" fill="#000" opacity="0.1"/>
|
|
359
|
+
|
|
360
|
+
<!-- Body -->
|
|
361
|
+
${renderBody(style)}
|
|
362
|
+
|
|
363
|
+
<!-- Neck -->
|
|
364
|
+
<rect x="-8" y="18" width="16" height="12" fill="${style.skin}"/>
|
|
365
|
+
|
|
366
|
+
<!-- Head shape -->
|
|
367
|
+
<ellipse cx="0" cy="0" rx="24" ry="26" fill="${style.skin}"/>
|
|
368
|
+
|
|
369
|
+
<!-- Ears -->
|
|
370
|
+
<ellipse cx="-23" cy="0" rx="5" ry="7" fill="${style.skin}"/>
|
|
371
|
+
<ellipse cx="23" cy="0" rx="5" ry="7" fill="${style.skin}"/>
|
|
372
|
+
<ellipse cx="-23" cy="0" rx="3" ry="4" fill="${darken(style.skin, 10)}"/>
|
|
373
|
+
<ellipse cx="23" cy="0" rx="3" ry="4" fill="${darken(style.skin, 10)}"/>
|
|
374
|
+
|
|
375
|
+
<!-- Hair (back layer for some styles) -->
|
|
376
|
+
${style.hairStyle === 'long' || style.hairStyle === 'ponytail' ? `<path d="M-22,0 Q-24,20 -20,35" fill="${style.primary}" stroke="${style.primary}" stroke-width="6"/>
|
|
377
|
+
<path d="M22,0 Q24,20 20,35" fill="${style.primary}" stroke="${style.primary}" stroke-width="6"/>` : ''}
|
|
378
|
+
|
|
379
|
+
<!-- Hair -->
|
|
380
|
+
${renderHair(style, style.skin)}
|
|
381
|
+
|
|
382
|
+
<!-- Face -->
|
|
383
|
+
<g class="face">
|
|
384
|
+
${face.leftEye}
|
|
385
|
+
${face.rightEye}
|
|
386
|
+
|
|
387
|
+
<!-- Nose -->
|
|
388
|
+
<path d="M0,2 Q2,6 0,8" fill="none" stroke="${darken(style.skin, 15)}" stroke-width="1.5" stroke-linecap="round"/>
|
|
389
|
+
|
|
390
|
+
${face.mouth}
|
|
391
|
+
${face.extras}
|
|
392
|
+
</g>
|
|
393
|
+
|
|
394
|
+
<!-- Accessory -->
|
|
395
|
+
${renderAccessory(style)}
|
|
396
|
+
|
|
397
|
+
<!-- Name tag -->
|
|
398
|
+
<text x="0" y="85" text-anchor="middle" fill="#9ca3af" font-size="11" font-family="'SF Mono', Menlo, monospace" font-weight="500">${character.name}</text>
|
|
399
|
+
</g>`;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Create a character from preset or custom style
|
|
403
|
+
*/
|
|
404
|
+
export function createCharacter(id, name, presetOrStyle = 'alex') {
|
|
405
|
+
const style = typeof presetOrStyle === 'string'
|
|
406
|
+
? CHARACTER_PRESETS[presetOrStyle] || CHARACTER_PRESETS.alex
|
|
407
|
+
: presetOrStyle;
|
|
408
|
+
return { id, name, style };
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Get available character presets
|
|
412
|
+
*/
|
|
413
|
+
export function getCharacterPresets() {
|
|
414
|
+
return Object.keys(CHARACTER_PRESETS);
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Get available emotions
|
|
418
|
+
*/
|
|
419
|
+
export function getEmotions() {
|
|
420
|
+
return ['neutral', 'happy', 'sad', 'angry', 'surprised', 'thinking', 'confused', 'excited', 'worried'];
|
|
421
|
+
}
|
|
422
|
+
//# sourceMappingURL=characters.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Main SVG generator
|
|
3
|
+
*/
|
|
4
|
+
import type { SceneType, GenerateOptions, GenerateResult } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Detect the best scene type based on title and content keywords
|
|
7
|
+
*/
|
|
8
|
+
export declare function detectScene(title: string, content?: string): SceneType;
|
|
9
|
+
/**
|
|
10
|
+
* Get list of available scene types
|
|
11
|
+
*/
|
|
12
|
+
export declare function getAvailableScenes(): SceneType[];
|
|
13
|
+
/**
|
|
14
|
+
* Generate an SVG illustration
|
|
15
|
+
*
|
|
16
|
+
* @param title - The title/topic for the illustration
|
|
17
|
+
* @param content - Optional additional content for better scene detection
|
|
18
|
+
* @param options - Generation options
|
|
19
|
+
* @returns Generated SVG result
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { generateSVG } from 'tech-svg-generator';
|
|
24
|
+
*
|
|
25
|
+
* const result = generateSVG('Database Replication Strategies');
|
|
26
|
+
* console.log(result.svg); // SVG string
|
|
27
|
+
* console.log(result.scene); // 'database'
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function generateSVG(title: string, content?: string, options?: GenerateOptions): GenerateResult;
|
|
31
|
+
/**
|
|
32
|
+
* Generate an illustration and return as a complete result object
|
|
33
|
+
* Alias for generateSVG with a more descriptive name
|
|
34
|
+
*/
|
|
35
|
+
export declare function generateIllustration(title: string, content?: string, options?: GenerateOptions): GenerateResult;
|
|
36
|
+
//# sourceMappingURL=generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAsB7E;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,MAAW,GAAG,SAAS,CAqB1E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,SAAS,EAAE,CAEhD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,MAAW,EACpB,OAAO,GAAE,eAAoB,GAC5B,cAAc,CAgChB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,MAAW,EACpB,OAAO,GAAE,eAAoB,GAC5B,cAAc,CAEhB"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Main SVG generator
|
|
3
|
+
*/
|
|
4
|
+
import { SCENES } from './scenes.js';
|
|
5
|
+
import { getTheme } from './themes.js';
|
|
6
|
+
/**
|
|
7
|
+
* Keywords for automatic scene detection
|
|
8
|
+
*/
|
|
9
|
+
const KEYWORDS = {
|
|
10
|
+
architecture: ['architecture', 'design', 'pattern', 'system', 'infrastructure', 'microservice', 'distributed'],
|
|
11
|
+
scaling: ['scale', 'load', 'traffic', 'kubernetes', 'k8s', 'container', 'docker', 'cluster', 'replicas', 'horizontal', 'auto-scaling'],
|
|
12
|
+
database: ['database', 'sql', 'postgres', 'mysql', 'mongo', 'query', 'migration', 'schema', 'orm', 'redis', 'cache', 'replication'],
|
|
13
|
+
deployment: ['deploy', 'ci', 'cd', 'pipeline', 'release', 'ship', 'production', 'staging', 'github actions', 'jenkins', 'devops'],
|
|
14
|
+
security: ['security', 'auth', 'authentication', 'jwt', 'oauth', 'encrypt', 'ssl', 'tls', 'firewall', 'vulnerability', 'zero trust'],
|
|
15
|
+
debugging: ['debug', 'bug', 'error', 'fix', 'issue', 'trace', 'breakpoint', 'crash', 'exception', 'troubleshoot', 'root cause'],
|
|
16
|
+
testing: ['test', 'jest', 'vitest', 'playwright', 'cypress', 'coverage', 'unit', 'integration', 'e2e', 'tdd', 'mock'],
|
|
17
|
+
performance: ['performance', 'optimize', 'speed', 'latency', 'cache', 'profil', 'benchmark', 'bottleneck', 'memory', 'cpu'],
|
|
18
|
+
api: ['api', 'rest', 'graphql', 'endpoint', 'gateway', 'grpc', 'webhook', 'http', 'request', 'response'],
|
|
19
|
+
monitoring: ['monitor', 'observ', 'metric', 'log', 'alert', 'grafana', 'datadog', 'prometheus', 'dashboard', 'trace'],
|
|
20
|
+
frontend: ['frontend', 'react', 'vue', 'angular', 'svelte', 'css', 'tailwind', 'component', 'ui', 'web vitals', 'lcp', 'fid'],
|
|
21
|
+
success: ['success', 'complete', 'done', 'achieve', 'launch', 'milestone', 'shipped', 'celebrate', 'win'],
|
|
22
|
+
error: ['fail', 'crash', 'down', 'outage', 'incident', '500', '503', 'timeout', 'oom', 'killed', 'alert'],
|
|
23
|
+
default: [],
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Detect the best scene type based on title and content keywords
|
|
27
|
+
*/
|
|
28
|
+
export function detectScene(title, content = '') {
|
|
29
|
+
const text = `${title} ${content}`.toLowerCase();
|
|
30
|
+
let best = 'default';
|
|
31
|
+
let score = 0;
|
|
32
|
+
for (const [scene, keywords] of Object.entries(KEYWORDS)) {
|
|
33
|
+
if (scene === 'default')
|
|
34
|
+
continue;
|
|
35
|
+
let s = 0;
|
|
36
|
+
for (const kw of keywords) {
|
|
37
|
+
if (text.includes(kw)) {
|
|
38
|
+
s += title.toLowerCase().includes(kw) ? 3 : 1;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (s > score) {
|
|
42
|
+
score = s;
|
|
43
|
+
best = scene;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return best;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Get list of available scene types
|
|
50
|
+
*/
|
|
51
|
+
export function getAvailableScenes() {
|
|
52
|
+
return Object.keys(SCENES);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Generate an SVG illustration
|
|
56
|
+
*
|
|
57
|
+
* @param title - The title/topic for the illustration
|
|
58
|
+
* @param content - Optional additional content for better scene detection
|
|
59
|
+
* @param options - Generation options
|
|
60
|
+
* @returns Generated SVG result
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* import { generateSVG } from 'tech-svg-generator';
|
|
65
|
+
*
|
|
66
|
+
* const result = generateSVG('Database Replication Strategies');
|
|
67
|
+
* console.log(result.svg); // SVG string
|
|
68
|
+
* console.log(result.scene); // 'database'
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export function generateSVG(title, content = '', options = {}) {
|
|
72
|
+
const { width = 700, height = 420, theme: themeName, scene: forcedScene, } = options;
|
|
73
|
+
const theme = getTheme(themeName);
|
|
74
|
+
const colors = theme.colors;
|
|
75
|
+
const sceneType = forcedScene || detectScene(title, content);
|
|
76
|
+
const sceneRenderer = SCENES[sceneType] || SCENES.default;
|
|
77
|
+
const sceneContent = sceneRenderer(title, colors, width, height);
|
|
78
|
+
const svg = `<?xml version="1.0" encoding="UTF-8"?>
|
|
79
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${width} ${height}" width="${width}" height="${height}">
|
|
80
|
+
<defs>
|
|
81
|
+
<linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
82
|
+
<stop offset="0%" stop-color="${colors.bg}"/>
|
|
83
|
+
<stop offset="100%" stop-color="${colors.card}"/>
|
|
84
|
+
</linearGradient>
|
|
85
|
+
</defs>
|
|
86
|
+
<rect width="${width}" height="${height}" fill="url(#bg)"/>
|
|
87
|
+
${sceneContent}
|
|
88
|
+
</svg>`;
|
|
89
|
+
return {
|
|
90
|
+
svg,
|
|
91
|
+
scene: sceneType,
|
|
92
|
+
width,
|
|
93
|
+
height,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Generate an illustration and return as a complete result object
|
|
98
|
+
* Alias for generateSVG with a more descriptive name
|
|
99
|
+
*/
|
|
100
|
+
export function generateIllustration(title, content = '', options = {}) {
|
|
101
|
+
return generateSVG(title, content, options);
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=generator.js.map
|
package/dist/icons.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SVG icon paths (24x24 viewBox)
|
|
3
|
+
* Lucide-style icons for technical illustrations
|
|
4
|
+
*/
|
|
5
|
+
export declare const ICONS: Record<string, string>;
|
|
6
|
+
/**
|
|
7
|
+
* Get icon names
|
|
8
|
+
*/
|
|
9
|
+
export declare function getIconNames(): string[];
|
|
10
|
+
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/icons.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAgCxC,CAAC;AAEF;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,EAAE,CAEvC"}
|
package/dist/icons.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SVG icon paths (24x24 viewBox)
|
|
3
|
+
* Lucide-style icons for technical illustrations
|
|
4
|
+
*/
|
|
5
|
+
export const ICONS = {
|
|
6
|
+
server: 'M4 6h16M4 12h16M4 18h16M8 6v12M16 6v12',
|
|
7
|
+
database: 'M12 3c4.97 0 9 1.34 9 3s-4.03 3-9 3-9-1.34-9-3 4.03-3 9-3m9 3v12c0 1.66-4.03 3-9 3s-9-1.34-9-3V6m18 6c0 1.66-4.03 3-9 3s-9-1.34-9-3',
|
|
8
|
+
cloud: 'M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z',
|
|
9
|
+
code: 'M16 18l6-6-6-6M8 6l-6 6 6 6',
|
|
10
|
+
terminal: 'M4 17l6-6-6-6M12 19h8',
|
|
11
|
+
shield: 'M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z',
|
|
12
|
+
zap: 'M13 2L3 14h9l-1 8 10-12h-9l1-8z',
|
|
13
|
+
check: 'M20 6L9 17l-5-5',
|
|
14
|
+
x: 'M18 6L6 18M6 6l12 12',
|
|
15
|
+
alert: 'M12 9v4m0 4h.01M12 2L2 22h20L12 2z',
|
|
16
|
+
globe: 'M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM2 12h20M12 2a15 15 0 0 1 4 10 15 15 0 0 1-4 10 15 15 0 0 1-4-10 15 15 0 0 1 4-10z',
|
|
17
|
+
layers: 'M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5',
|
|
18
|
+
rocket: 'M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09zM12 15l-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z',
|
|
19
|
+
users: 'M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75',
|
|
20
|
+
target: 'M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM12 18a6 6 0 1 0 0-12 6 6 0 0 0 0 12zM12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4z',
|
|
21
|
+
cpu: 'M9 9h6v6H9zM9 1v3M15 1v3M9 20v3M15 20v3M1 9h3M1 15h3M20 9h3M20 15h3',
|
|
22
|
+
activity: 'M22 12h-4l-3 9L9 3l-3 9H2',
|
|
23
|
+
lock: 'M19 11H5a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7a2 2 0 0 0-2-2zM7 11V7a5 5 0 0 1 10 0v4',
|
|
24
|
+
eye: 'M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z',
|
|
25
|
+
git: 'M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22',
|
|
26
|
+
package: 'M16.5 9.4l-9-5.19M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z',
|
|
27
|
+
settings: 'M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z',
|
|
28
|
+
wifi: 'M5 12.55a11 11 0 0 1 14.08 0M1.42 9a16 16 0 0 1 21.16 0M8.53 16.11a6 6 0 0 1 6.95 0M12 20h.01',
|
|
29
|
+
download: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3',
|
|
30
|
+
upload: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12',
|
|
31
|
+
refresh: 'M23 4v6h-6M1 20v-6h6M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15',
|
|
32
|
+
search: 'M11 17a6 6 0 1 0 0-12 6 6 0 0 0 0 12zM21 21l-4.35-4.35',
|
|
33
|
+
file: 'M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z',
|
|
34
|
+
folder: 'M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z',
|
|
35
|
+
clock: 'M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM12 6v6l4 2',
|
|
36
|
+
bell: 'M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9M13.73 21a2 2 0 0 1-3.46 0',
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Get icon names
|
|
40
|
+
*/
|
|
41
|
+
export function getIconNames() {
|
|
42
|
+
return Object.keys(ICONS);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=icons.js.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tech SVG Generator
|
|
3
|
+
* Generate clean, professional SVG illustrations for technical content
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
export { generateSVG, generateIllustration, detectScene, getAvailableScenes } from './generator.js';
|
|
8
|
+
export { SCENES } from './scenes.js';
|
|
9
|
+
export { THEMES, getTheme, type Theme, type ThemeColors } from './themes.js';
|
|
10
|
+
export { ICONS } from './icons.js';
|
|
11
|
+
export type { GenerateOptions, GenerateResult, SceneType } from './types.js';
|
|
12
|
+
export { generateCartoonStrip, type CartoonStripConfig, type CartoonPanel, type DialogLine } from './cartoon.js';
|
|
13
|
+
export { renderCharacter, createCharacter, getCharacterPresets, getEmotions, CHARACTER_PRESETS, type Character, type CharacterStyle, type Emotion } from './characters.js';
|
|
14
|
+
export { parseYAML, parseJSON, generateFromYAML, generateFromJSON, generateFromDescription, SCENE_YAML_EXAMPLE, CARTOON_YAML_EXAMPLE, CARTOON_JSON_EXAMPLE, type SceneDescription, type CartoonDescription, type Description, } from './parser.js';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|