cortico-world-fun 0.2.0 → 0.3.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/CHANGELOG.md +29 -0
- package/PUBLISHING.md +59 -195
- package/README.md +66 -4
- package/describe.json +171 -10
- package/dist/artwork.js +64 -0
- package/dist/stories.js +395 -0
- package/dist/webui.js +523 -116
- package/package.json +5 -5
- package/src/ENV_PROMPT.md +2 -1
- package/src/branches.js +62 -0
- package/src/definition.js +16 -4
- package/src/exploration.js +268 -0
- package/src/journeys.js +65 -0
- package/src/keepsakes.js +28 -6
- package/src/recommendations.js +109 -0
- package/src/state.js +71 -39
- package/src/story-examples.js +111 -0
- package/src/story-library.js +149 -0
- package/src/story-packs.js +428 -0
- package/src/world.js +425 -124
package/describe.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"tools": [
|
|
3
3
|
{
|
|
4
4
|
"name": "fun_places",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "查询地点、当前可逛项目及心愿的合适时段。",
|
|
6
6
|
"parameters": {
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
"name": "fun_choice",
|
|
102
|
-
"description": "
|
|
102
|
+
"description": "按待选回执的选项处理当前事件,也可略过。",
|
|
103
103
|
"parameters": {
|
|
104
104
|
"type": "object",
|
|
105
105
|
"properties": {
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
},
|
|
110
110
|
"optionId": {
|
|
111
111
|
"type": "string",
|
|
112
|
-
"description": "
|
|
112
|
+
"description": "使用回执中的 optionId,或填 skip 略过。"
|
|
113
113
|
}
|
|
114
114
|
},
|
|
115
115
|
"required": [
|
|
@@ -122,19 +122,47 @@
|
|
|
122
122
|
"write"
|
|
123
123
|
],
|
|
124
124
|
"summary": {
|
|
125
|
-
"zh": "
|
|
126
|
-
"en": "Resolve a
|
|
125
|
+
"zh": "处理待选择事件,可按回执选择或略过。",
|
|
126
|
+
"en": "Resolve or skip a pending event choice."
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "fun_resume",
|
|
131
|
+
"description": "继续未逛完的行程,返回进度和待选事件。",
|
|
132
|
+
"parameters": {
|
|
133
|
+
"type": "object",
|
|
134
|
+
"properties": {
|
|
135
|
+
"id": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"description": "fun_view 提供的未完行程 ID。"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"required": [
|
|
141
|
+
"id"
|
|
142
|
+
],
|
|
143
|
+
"additionalProperties": false
|
|
144
|
+
},
|
|
145
|
+
"tags": [
|
|
146
|
+
"write"
|
|
147
|
+
],
|
|
148
|
+
"summary": {
|
|
149
|
+
"zh": "继续一趟未逛完的行程。",
|
|
150
|
+
"en": "Resume an unfinished outing."
|
|
127
151
|
}
|
|
128
152
|
},
|
|
129
153
|
{
|
|
130
154
|
"name": "fun_home",
|
|
131
|
-
"description": "
|
|
155
|
+
"description": "收摊并把已发生的经历记入纪念册。",
|
|
132
156
|
"parameters": {
|
|
133
157
|
"type": "object",
|
|
134
158
|
"properties": {
|
|
135
159
|
"note": {
|
|
136
160
|
"type": "string",
|
|
137
161
|
"description": "这一趟怎么样,一句话,可选。"
|
|
162
|
+
},
|
|
163
|
+
"draftId": {
|
|
164
|
+
"type": "string",
|
|
165
|
+
"description": "要按已有记录结束未完行程时,填 fun_view 提供的 ID。结束正在逛的行程时不填。"
|
|
138
166
|
}
|
|
139
167
|
},
|
|
140
168
|
"additionalProperties": false
|
|
@@ -162,9 +190,60 @@
|
|
|
162
190
|
"en": "Show current place recommendations; use fun_places for filters."
|
|
163
191
|
}
|
|
164
192
|
},
|
|
193
|
+
{
|
|
194
|
+
"name": "fun_route",
|
|
195
|
+
"description": "规划两站出门、前往下一站、改下一站或取消后续;不自动移动。",
|
|
196
|
+
"parameters": {
|
|
197
|
+
"type": "object",
|
|
198
|
+
"properties": {
|
|
199
|
+
"action": {
|
|
200
|
+
"type": "string",
|
|
201
|
+
"enum": [
|
|
202
|
+
"plan",
|
|
203
|
+
"status",
|
|
204
|
+
"next",
|
|
205
|
+
"change",
|
|
206
|
+
"cancel"
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
"places": {
|
|
210
|
+
"type": "array",
|
|
211
|
+
"items": {
|
|
212
|
+
"type": "string"
|
|
213
|
+
},
|
|
214
|
+
"minItems": 2,
|
|
215
|
+
"maxItems": 2,
|
|
216
|
+
"description": "plan 时填两个不同地点正名或 ID。"
|
|
217
|
+
},
|
|
218
|
+
"id": {
|
|
219
|
+
"type": "string",
|
|
220
|
+
"description": "next/change/cancel 时填回执中的路线 ID。"
|
|
221
|
+
},
|
|
222
|
+
"place": {
|
|
223
|
+
"type": "string",
|
|
224
|
+
"description": "change 时的新下一站;只改尚未去的站。"
|
|
225
|
+
},
|
|
226
|
+
"company": {
|
|
227
|
+
"type": "string",
|
|
228
|
+
"description": "plan 时的同行人,可选。"
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"required": [
|
|
232
|
+
"action"
|
|
233
|
+
],
|
|
234
|
+
"additionalProperties": false
|
|
235
|
+
},
|
|
236
|
+
"tags": [
|
|
237
|
+
"write"
|
|
238
|
+
],
|
|
239
|
+
"summary": {
|
|
240
|
+
"zh": "规划和管理最多两站的出门路线,明确前往下一站或提前结束。",
|
|
241
|
+
"en": "Plan and manage a two-stop outing, explicitly move on or end early."
|
|
242
|
+
}
|
|
243
|
+
},
|
|
165
244
|
{
|
|
166
245
|
"name": "fun_view",
|
|
167
|
-
"description": "
|
|
246
|
+
"description": "查询行程,可按地点、同行人、日期或关键词检索。",
|
|
168
247
|
"parameters": {
|
|
169
248
|
"type": "object",
|
|
170
249
|
"properties": {
|
|
@@ -173,6 +252,30 @@
|
|
|
173
252
|
"description": "看最近几趟,默认 5。",
|
|
174
253
|
"minimum": 1,
|
|
175
254
|
"maximum": 20
|
|
255
|
+
},
|
|
256
|
+
"query": {
|
|
257
|
+
"type": "string",
|
|
258
|
+
"description": "搜索地点、项目、备注、小事或纪念品。"
|
|
259
|
+
},
|
|
260
|
+
"place": {
|
|
261
|
+
"type": "string",
|
|
262
|
+
"description": "只看这个地点的行程,正名或别名。"
|
|
263
|
+
},
|
|
264
|
+
"company": {
|
|
265
|
+
"type": "string",
|
|
266
|
+
"description": "只看与这位同行人的行程。"
|
|
267
|
+
},
|
|
268
|
+
"from": {
|
|
269
|
+
"type": "string",
|
|
270
|
+
"description": "开始日期 YYYY-MM-DD,包含当天。"
|
|
271
|
+
},
|
|
272
|
+
"to": {
|
|
273
|
+
"type": "string",
|
|
274
|
+
"description": "结束日期 YYYY-MM-DD,包含当天。"
|
|
275
|
+
},
|
|
276
|
+
"id": {
|
|
277
|
+
"type": "string",
|
|
278
|
+
"description": "精确查看一个已有行程 ID。"
|
|
176
279
|
}
|
|
177
280
|
},
|
|
178
281
|
"additionalProperties": false
|
|
@@ -182,8 +285,8 @@
|
|
|
182
285
|
"snapshot"
|
|
183
286
|
],
|
|
184
287
|
"summary": {
|
|
185
|
-
"zh": "
|
|
186
|
-
"en": "
|
|
288
|
+
"zh": "查看正在逛、未逛完或已收摊的行程。",
|
|
289
|
+
"en": "View active, unfinished, or finished outings."
|
|
187
290
|
}
|
|
188
291
|
},
|
|
189
292
|
{
|
|
@@ -285,6 +388,64 @@
|
|
|
285
388
|
"en": "Keep or unkeep a trip without changing the recent trip book or permanent collection."
|
|
286
389
|
}
|
|
287
390
|
},
|
|
391
|
+
{
|
|
392
|
+
"name": "fun_story",
|
|
393
|
+
"description": "管理本地地点剧情包,校验和预览只读,导入或启停须指定操作。",
|
|
394
|
+
"parameters": {
|
|
395
|
+
"type": "object",
|
|
396
|
+
"properties": {
|
|
397
|
+
"action": {
|
|
398
|
+
"type": "string",
|
|
399
|
+
"enum": [
|
|
400
|
+
"list",
|
|
401
|
+
"template",
|
|
402
|
+
"validate",
|
|
403
|
+
"preview",
|
|
404
|
+
"export",
|
|
405
|
+
"import",
|
|
406
|
+
"enable",
|
|
407
|
+
"disable",
|
|
408
|
+
"remove"
|
|
409
|
+
]
|
|
410
|
+
},
|
|
411
|
+
"id": {
|
|
412
|
+
"type": "string",
|
|
413
|
+
"description": "已有剧情包 ID,来自 list。"
|
|
414
|
+
},
|
|
415
|
+
"json": {
|
|
416
|
+
"type": "string",
|
|
417
|
+
"description": "完整剧情包 JSON,最多 32 KB;validate/preview 不保存。"
|
|
418
|
+
},
|
|
419
|
+
"placeId": {
|
|
420
|
+
"type": "string",
|
|
421
|
+
"description": "template 绑定的真实地点 ID,可来自自填地点;list 提供可用 ID。"
|
|
422
|
+
},
|
|
423
|
+
"area": {
|
|
424
|
+
"type": "string",
|
|
425
|
+
"description": "preview 的项目,默认使用起始节点项目。"
|
|
426
|
+
},
|
|
427
|
+
"time": {
|
|
428
|
+
"type": "string",
|
|
429
|
+
"description": "preview 的测试时刻 HH:MM,默认当前本地时刻。"
|
|
430
|
+
},
|
|
431
|
+
"replace": {
|
|
432
|
+
"type": "boolean",
|
|
433
|
+
"description": "import 覆盖已有同 ID 自定义包时才设 true。"
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
"required": [
|
|
437
|
+
"action"
|
|
438
|
+
],
|
|
439
|
+
"additionalProperties": false
|
|
440
|
+
},
|
|
441
|
+
"tags": [
|
|
442
|
+
"write"
|
|
443
|
+
],
|
|
444
|
+
"summary": {
|
|
445
|
+
"zh": "管理、校验与预览本地地点剧情包,支持自填地点。",
|
|
446
|
+
"en": "Manage, validate, and preview local story packs, including custom places."
|
|
447
|
+
}
|
|
448
|
+
},
|
|
288
449
|
{
|
|
289
450
|
"name": "fun_shelf",
|
|
290
451
|
"description": "按地点查询长期纪念品收藏和收集进度。",
|
|
@@ -314,7 +475,7 @@
|
|
|
314
475
|
"key": "worlds.fun.env",
|
|
315
476
|
"title": "娱乐时间",
|
|
316
477
|
"role": "envPrompt",
|
|
317
|
-
"content": "## 娱乐时间\n\n出游流程:`fun_places` 查询地点 → `fun_go` 进门 → `fun_wander` 逐处游逛 → `fun_home` 收摊;现在出门可用 `fun_start`。地点、项目、纪念品和拍照点名称以工具回执为准;吃喝只填当前地点真实提供的品类。历史与收藏按需用 `fun_view`、`fun_shelf` 查询。\n\n-
|
|
478
|
+
"content": "## 娱乐时间\n\n出游流程:`fun_places` 查询地点 → `fun_go` 进门 → `fun_wander` 逐处游逛 → `fun_home` 收摊;现在出门可用 `fun_start`。地点、项目、纪念品和拍照点名称以工具回执为准;吃喝只填当前地点真实提供的品类。历史与收藏按需用 `fun_view`、`fun_shelf` 查询。\n\n- 连逛两处可用 `fun_route` 规划;每站自己进门、收摊,再决定下一站、换一站或提前结束,不自动移动。\n- 中断后用 `fun_view` 找未完行程,再决定续逛或按已有记录收摊。待选事件按回执的选项处理。\n- 明确表达想去或想做时用 `fun_wish` 记录、`fun_wishes` 查询;不催促、不从旧行程推断完成。\n- 发图用 `imggen_draw`:按 `fun_home` 回执填写 `scene` / `outfits` 正名,不编场景或衣服名字;库里没找到的不要填。\n- 食物只记品类。开关联动允许且实际用「鱼的每一天」的 `feast_menu` → `feast_eat` 后才能描述口感;否则只说吃喝了什么,别形容味道。本插件不会探测别的扩展装没装,不依赖其他 World。\n- 时段可能改变氛围和可逛项目;重复到访有效。历史只按需查询,不编造未发生的经历。\n- 用户自填地点通常没有素材库场景;以回执为准。地点清单和动态详情通过 `fun_places` 查询。预设删不掉,只能恢复。\n- 出门前可用 `feast_life_now` 对齐日程;收摊后按回执用 `feast_life_play` 记录实际经历。\n\n{{fun_places_block}}\n"
|
|
318
479
|
}
|
|
319
480
|
]
|
|
320
481
|
}
|
package/dist/artwork.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** Original miniature line scenes drawn for fun-world. No external assets or requests.
|
|
2
|
+
* Shared geometry/palette keeps the twenty places one little illustrated world.
|
|
3
|
+
* These are decorative illustrations, never photographs or records of a visit.
|
|
4
|
+
*/
|
|
5
|
+
const line = (d, extra = '') => `<path d="${d}" ${extra}/>`;
|
|
6
|
+
const rect = (x, y, w, h, r = 3, extra = '') => `<rect x="${x}" y="${y}" width="${w}" height="${h}" rx="${r}" ${extra}/>`;
|
|
7
|
+
const circle = (x, y, r, extra = '') => `<circle cx="${x}" cy="${y}" r="${r}" ${extra}/>`;
|
|
8
|
+
const warm = 'fill="var(--f-art-warm,#e9b97e)"';
|
|
9
|
+
const mint = 'fill="var(--f-art-mint,#99c7b9)"';
|
|
10
|
+
const blue = 'fill="var(--f-art-blue,#9abfd0)"';
|
|
11
|
+
const pink = 'fill="var(--f-art-pink,#d9abc1)"';
|
|
12
|
+
const paper = 'fill="var(--f-card,#fbfbfb)"';
|
|
13
|
+
const scenes = {
|
|
14
|
+
amusement: circle(139, 48, 34, blue) + line('M139 14V82M105 48H173M115 24L163 72M115 72L163 24M139 48L113 108H165Z') + [ [139,14],[173,48],[139,82],[105,48] ].map(([x,y]) => rect(x-6,y-4,12,10,3,warm)).join('') + line('M202 104V64H267V104M196 64L235 38L274 64Z', warm) + rect(220,77,25,27,5,pink) + line('M39 91V45M39 45L69 53L39 63Z',mint),
|
|
15
|
+
aquarium: line('M68 108V57C68 8 249 8 249 57V108',blue) + line('M88 108V58C88 31 229 31 229 58V108',paper) + line('M132 56C154 39 180 41 192 52L210 45V67L192 60C170 73 144 68 132 56Z',mint) + circle(181,52,1.5,'fill="currentColor"') + line('M105 108L108 87L117 100L121 78L128 108M208 108L215 82L219 99L228 89L231 108') + circle(111,57,3) + circle(118,43,2),
|
|
16
|
+
templefair: line('M67 108V38M91 108V38M225 108V38M249 108V38M52 31Q157 47 264 31L260 44H56ZM58 56H258',warm) + line('M102 80H215M109 80V107M207 80V107M99 79L158 54L218 79Z',mint) + [111,157,203].map(x=>circle(x,60,9,pink)+line(`M${x} 47V51M${x} 69V74`)).join(''),
|
|
17
|
+
con: rect(77,35,164,72,5,paper) + rect(91,48,63,47,3,pink) + line('M107 83L116 65L124 76L137 57L146 83Z') + rect(169,49,56,13,2,warm) + line('M169 73H225M169 83H209M91 107V114M227 107V114') + line('M47 57L53 43L59 57L73 63L59 69L53 83L47 69L33 63Z',blue),
|
|
18
|
+
cinema: rect(75,23,174,79,5,blue) + rect(89,35,146,53,2,paper) + line('M149 46L149 76L175 61Z',warm) + [98,131,164,197,230].map(x=>rect(x-9,96,21,16,4,pink)).join('') + line('M42 96L38 68H62L58 96Z',warm) + line('M40 68Q39 54 48 59Q58 48 62 62'),
|
|
19
|
+
zoo: rect(73,36,177,71,10,mint) + line('M82 42L100 22H224L243 42',warm) + line('M117 107V72Q117 46 142 46Q167 46 167 72V107',paper) + circle(137,62,3) + circle(153,62,3) + line('M140 78Q146 84 152 78M201 107V67M195 67Q177 42 193 43Q200 24 207 43Q226 38 219 57Z',blue) + circle(53,61,18,mint) + line('M53 79V107'),
|
|
20
|
+
park: line('M119 114Q125 89 154 78Q176 67 178 49',warm) + circle(76,54,27,mint) + circle(236,49,33,mint) + line('M76 65V109M236 62V109') + rect(104,75,63,10,3,paper) + line('M110 86V102M160 86V102M105 67H166M113 67V76M157 67V76') + circle(157,25,13,warm),
|
|
21
|
+
arcade: rect(105,25,85,82,7,pink) + rect(116,35,63,39,3,blue) + line('M129 58L139 45L150 60L159 49L169 65') + line('M105 81L94 94H199L190 81Z',warm) + circle(126,88,3) + circle(168,88,3) + line('M122 85V78') + rect(128,98,37,4,1,paper) + line('M224 45L235 34M233 62H251M215 32V19'),
|
|
22
|
+
ktv: rect(62,29,126,69,6,blue) + line('M78 47H161M78 62H134M78 77H151') + line('M220 53L190 95Q187 103 195 106Q201 108 205 103L234 64',warm) + circle(231,48,17,pink) + line('M220 35L242 60M214 43L235 65M206 106Q236 121 255 99M272 31V61Q258 55 257 65Q260 77 273 69V40L290 35V55'),
|
|
23
|
+
museum: line('M64 47L159 15L253 47Z',warm) + rect(65,47,188,10,1,paper) + [86,125,164,203].map(x=>rect(x,57,16,43,2,blue)).join('') + rect(61,101,195,10,1,paper) + circle(159,36,8,mint) + line('M41 110H278'),
|
|
24
|
+
catcafe: rect(66,30,123,71,5,warm) + line('M76 43H178M128 43V101M76 77H178') + line('M201 97C177 89 185 72 199 73L198 58L211 67L225 59L228 78C242 102 217 110 201 97Z',pink) + circle(207,81,1.5,'fill="currentColor"') + circle(220,81,1.5,'fill="currentColor"') + line('M206 91Q215 96 221 88M237 98Q263 100 253 83') + rect(89,87,18,15,3,paper) + line('M107 90Q119 90 112 98'),
|
|
25
|
+
hiking: line('M45 108L128 21L197 108Z',mint) + line('M127 21L104 47L128 43L145 47Z',paper) + line('M143 108L219 42L278 108Z',blue) + line('M150 108L145 94L164 79L164 70M219 42L205 56H232',paper) + circle(241,24,12,warm) + line('M83 109V85M75 93L83 79L91 93ZM248 109V86M239 96L248 78L257 96Z'),
|
|
26
|
+
cafe: rect(77,30,159,77,4,warm) + line('M69 48H243L232 25H81Z',pink) + rect(89,61,61,46,3,blue) + rect(167,61,55,34,3,paper) + line('M177 73H204V85H177ZM204 75Q216 74 211 82M183 64Q178 59 184 55M195 64Q190 59 196 55M119 62V106M89 82H150'),
|
|
27
|
+
milktea: rect(77,29,164,78,5,pink) + rect(88,38,141,15,2,paper) + line('M107 64L113 105H145L151 64Z',warm) + line('M102 64H156M127 64L135 40',paper) + [119,129,139].map(x=>circle(x,94,2.5,'fill="currentColor"')).join('') + rect(174,67,40,40,3,blue) + line('M179 80H209M179 89H201'),
|
|
28
|
+
diner: rect(67,29,183,78,6,warm) + rect(80,40,69,48,3,blue) + line('M114 41V87M80 64H149') + line('M171 80H225M177 81V105M220 81V105') + line('M184 69H216Q217 56 201 56Q184 56 184 69ZM201 56V51',paper) + line('M183 36V47M196 32V43M209 36V47') + rect(88,95,51,11,3,pink),
|
|
29
|
+
library: rect(71,29,177,78,4,warm) + line('M87 35V99M155 35V99M231 35V99M87 65H231M87 99H231') + [95,110,126,164,179,211].map((x,i)=>rect(x, i%2?45:41,10,i%2?19:23,1,i%2?mint:blue)).join('') + line('M106 83Q133 75 159 85Q183 75 208 83V111Q183 102 159 111Q134 102 106 111ZM159 85V111',paper),
|
|
30
|
+
market: line('M51 31Q156 58 269 30') + [75,116,158,200,242].map(x=>circle(x,x===158?52:45,7,warm)).join('') + line('M60 104V77H130V104M49 77L67 59H123L141 77Z',pink) + line('M180 104V77H250V104M169 77L187 59H243L261 77Z',blue) + line('M73 90H118M192 89H237M81 104V92M225 104V90') + rect(142,93,22,14,2,mint),
|
|
31
|
+
bathhouse: rect(69,33,181,74,5,warm) + line('M60 34L89 18H229L258 34Z',blue) + rect(89,53,142,54,2,paper) + line('M89 54H231V76Q211 66 195 76Q177 67 160 77Q141 67 124 76Q105 66 89 76ZM160 54V107',mint) + line('M112 44Q102 34 112 25M156 45Q145 34 156 25M200 44Q189 34 200 25'),
|
|
32
|
+
thrift: rect(67,29,179,78,4,mint) + line('M60 48H253L241 26H73Z',warm) + rect(84,64,56,43,3,paper) + circle(112,81,12,blue) + line('M112 72V81L119 84') + line('M163 80L180 65L197 80M180 65V59Q180 53 187 55M163 80H197',pink) + rect(205,86,26,21,2,pink) + line('M210 86V79H226V86M90 103L102 96H129'),
|
|
33
|
+
riverside: line('M36 90Q93 80 151 90T284 90M36 103Q93 93 151 103T284 103M52 115Q99 107 145 115M187 115Q224 107 269 115',blue) + line('M62 82V57M88 82V57M114 82V57M140 82V57M57 63H147M57 75H147') + line('M165 60Q202 8 262 60M173 60V78M253 60V78M170 60H259',warm) + circle(103,26,13,pink) + line('M218 105L230 96H253L247 105Z',mint),
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export function venueArtwork(id) {
|
|
37
|
+
const drawing = scenes[id] ?? (line('M83 107V51L160 20L237 51V107Z',mint) + rect(108,64,32,43,3,paper) + rect(169,62,42,27,3,blue));
|
|
38
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 128" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M28 112H292" opacity=".2"/><g>${drawing}</g></svg>`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const symbols = {
|
|
42
|
+
ticket: line('M4 6H20V10Q16 12 20 14V18H4V14Q8 12 4 10ZM14 7V9M14 11V13M14 15V17'),
|
|
43
|
+
keychain: circle(9,7,4) + line('M9 11V15M7 15H15L18 21H5Z'),
|
|
44
|
+
bookmark: line('M7 3H17V21L12 17L7 21ZM10 7H14M10 10H14'),
|
|
45
|
+
postcard: rect(3,5,18,14,2) + line('M14 8V16M17 9H19M6 14L9 10L12 14ZM6 16H12'),
|
|
46
|
+
sticker: line('M4 4H20V15L15 20H4ZM15 20V15H20') + circle(9,9,1) + circle(15,9,1) + line('M8 12Q12 16 16 12'),
|
|
47
|
+
coin: circle(12,12,9) + circle(12,12,6) + line('M12 7L14 10L17 12L14 14L12 17L10 14L7 12L10 10Z'),
|
|
48
|
+
cup: line('M5 8H16V17Q10 22 5 17ZM16 10H20V15H16M8 3V5M12 3V5'),
|
|
49
|
+
light: line('M8 15Q1 7 8 4Q16 0 19 8Q20 12 16 15V19H8ZM9 22H15M9 16H15'),
|
|
50
|
+
plush: circle(6,6,3) + circle(18,6,3) + circle(12,10,7) + line('M7 16Q4 23 12 22Q20 23 17 16') + circle(9,9,1) + circle(15,9,1) + line('M11 12H13'),
|
|
51
|
+
charm: line('M12 3V6M7 6H17L20 12L17 21H7L4 12ZM9 10H15M9 14H15M10 18H14'),
|
|
52
|
+
generic: rect(4,8,16,13,2) + rect(3,5,18,4,1) + line('M12 5V21M12 5Q4 4 7 1Q10 0 12 5Q14 0 17 1Q20 4 12 5'),
|
|
53
|
+
};
|
|
54
|
+
export function souvenirCategory(name) {
|
|
55
|
+
const value = String(name ?? '');
|
|
56
|
+
return (/票|券|入场/.test(value) ? 'ticket' : /钥匙|挂件|挂饰|吊坠/.test(value) ? 'keychain'
|
|
57
|
+
: /书签/.test(value) ? 'bookmark' : /明信片|卡片|画片|海报/.test(value) ? 'postcard'
|
|
58
|
+
: /贴纸|贴画|徽章/.test(value) ? 'sticker' : /币|章/.test(value) ? 'coin'
|
|
59
|
+
: /杯|茶|咖啡/.test(value) ? 'cup' : /灯/.test(value) ? 'light'
|
|
60
|
+
: /玩偶|公仔|小熊|毛绒/.test(value) ? 'plush' : /御守|护符|签/.test(value) ? 'charm' : 'generic');
|
|
61
|
+
}
|
|
62
|
+
export function souvenirArtwork(name) {
|
|
63
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${symbols[souvenirCategory(name)]}</svg>`;
|
|
64
|
+
}
|