koishi-plugin-booth-get 6.0.2 → 6.0.4

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.
@@ -0,0 +1,526 @@
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>BOOTH Card Preview</title>
7
+ <style>
8
+ * {
9
+ box-sizing: border-box;
10
+ margin: 0;
11
+ padding: 0;
12
+ }
13
+
14
+ body {
15
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
16
+ background-color: #f5f5f5;
17
+ display: flex;
18
+ gap: 20px;
19
+ padding: 20px;
20
+ min-height: 100vh;
21
+ }
22
+
23
+ .preview-panel {
24
+ flex: 1;
25
+ display: flex;
26
+ justify-content: center;
27
+ align-items: flex-start;
28
+ padding: 20px;
29
+ background: white;
30
+ border-radius: 10px;
31
+ box-shadow: 0 2px 10px rgba(0,0,0,0.1);
32
+ overflow: auto;
33
+ max-height: 100vh;
34
+ }
35
+
36
+ .config-panel {
37
+ width: 350px;
38
+ background: white;
39
+ border-radius: 10px;
40
+ padding: 20px;
41
+ box-shadow: 0 2px 10px rgba(0,0,0,0.1);
42
+ overflow-y: auto;
43
+ max-height: 100vh;
44
+ }
45
+
46
+ .config-section {
47
+ margin-bottom: 25px;
48
+ }
49
+
50
+ .config-section h3 {
51
+ font-size: 16px;
52
+ color: #333;
53
+ margin-bottom: 15px;
54
+ padding-bottom: 8px;
55
+ border-bottom: 2px solid #eee;
56
+ }
57
+
58
+ .config-item {
59
+ margin-bottom: 12px;
60
+ }
61
+
62
+ .config-item label {
63
+ display: block;
64
+ font-size: 13px;
65
+ color: #666;
66
+ margin-bottom: 5px;
67
+ }
68
+
69
+ .config-item input[type="number"],
70
+ .config-item input[type="text"],
71
+ .config-item input[type="color"] {
72
+ width: 100%;
73
+ padding: 8px 10px;
74
+ border: 1px solid #ddd;
75
+ border-radius: 5px;
76
+ font-size: 13px;
77
+ }
78
+
79
+ .config-item input[type="color"] {
80
+ height: 40px;
81
+ cursor: pointer;
82
+ }
83
+
84
+ .config-item input:focus {
85
+ outline: none;
86
+ border-color: #3498db;
87
+ }
88
+
89
+ .btn-generate {
90
+ width: 100%;
91
+ padding: 12px;
92
+ background: linear-gradient(90deg, #667eea, #764ba2);
93
+ color: white;
94
+ border: none;
95
+ border-radius: 5px;
96
+ font-size: 14px;
97
+ font-weight: bold;
98
+ cursor: pointer;
99
+ transition: all 0.3s;
100
+ }
101
+
102
+ .btn-generate:hover {
103
+ transform: translateY(-2px);
104
+ box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
105
+ }
106
+
107
+ /* Card Styles */
108
+ .card-container {
109
+ background-color: #fff;
110
+ border-radius: 30px;
111
+ overflow: hidden;
112
+ box-shadow: 0 4px 15px rgba(0,0,0,0.1);
113
+ position: relative;
114
+ }
115
+
116
+ .top-gradient-bg {
117
+ height: 60px;
118
+ position: absolute;
119
+ top: 0;
120
+ left: 0;
121
+ right: 0;
122
+ z-index: 0;
123
+ }
124
+
125
+ .header-logo-area {
126
+ position: absolute;
127
+ top: 20px;
128
+ right: 30px;
129
+ z-index: 10;
130
+ display: flex;
131
+ align-items: center;
132
+ gap: 8px;
133
+ }
134
+
135
+ .booth-text {
136
+ font-weight: bold;
137
+ font-size: 18px;
138
+ color: #333;
139
+ }
140
+
141
+ .booth-icon {
142
+ width: 30px;
143
+ height: 30px;
144
+ background-color: #ff4d4d;
145
+ border-radius: 4px;
146
+ display: flex;
147
+ justify-content: center;
148
+ align-items: center;
149
+ color: white;
150
+ font-size: 12px;
151
+ }
152
+
153
+ .content-wrapper {
154
+ display: flex;
155
+ padding: 20px 30px 40px 30px;
156
+ position: relative;
157
+ z-index: 5;
158
+ margin-top: 40px;
159
+ }
160
+
161
+ .left-column {
162
+ flex-shrink: 0;
163
+ margin-right: 30px;
164
+ }
165
+
166
+ .main-image {
167
+ width: 100%;
168
+ aspect-ratio: 1/1;
169
+ background-color: #ddd;
170
+ border-radius: 8px;
171
+ object-fit: cover;
172
+ margin-bottom: 10px;
173
+ box-shadow: 0 2px 5px rgba(0,0,0,0.1);
174
+ }
175
+
176
+ .price-row {
177
+ display: flex;
178
+ align-items: center;
179
+ margin-bottom: 10px;
180
+ }
181
+
182
+ .price-tag {
183
+ color: white;
184
+ font-weight: bold;
185
+ font-size: 20px;
186
+ padding: 5px 10px;
187
+ border-radius: 4px;
188
+ margin-right: 15px;
189
+ }
190
+
191
+ .like-count {
192
+ display: flex;
193
+ align-items: center;
194
+ color: #666;
195
+ font-weight: bold;
196
+ font-size: 16px;
197
+ }
198
+
199
+ .heart-icon {
200
+ color: #333;
201
+ margin-right: 5px;
202
+ font-size: 18px;
203
+ }
204
+
205
+ .item-title {
206
+ font-size: 14px;
207
+ color: #333;
208
+ line-height: 1.4;
209
+ margin-bottom: 5px;
210
+ }
211
+
212
+ .item-subtitle {
213
+ font-size: 12px;
214
+ color: #666;
215
+ margin-bottom: 20px;
216
+ }
217
+
218
+ .other-works-title {
219
+ font-size: 14px;
220
+ font-weight: bold;
221
+ color: #333;
222
+ margin-bottom: 10px;
223
+ }
224
+
225
+ .thumbnails {
226
+ display: flex;
227
+ gap: 10px;
228
+ }
229
+
230
+ .thumb-img {
231
+ width: 70px;
232
+ height: 70px;
233
+ background-color: #eee;
234
+ border-radius: 6px;
235
+ object-fit: cover;
236
+ border: 1px solid #eee;
237
+ }
238
+
239
+ .right-column {
240
+ flex-grow: 1;
241
+ display: flex;
242
+ flex-direction: column;
243
+ }
244
+
245
+ .shop-banner {
246
+ width: 100%;
247
+ height: 80px;
248
+ border-radius: 8px;
249
+ margin-bottom: 20px;
250
+ display: flex;
251
+ align-items: center;
252
+ justify-content: space-between;
253
+ padding: 0 20px;
254
+ position: relative;
255
+ overflow: hidden;
256
+ border: 1px solid #eee;
257
+ }
258
+
259
+ .banner-text {
260
+ font-family: 'Courier New', Courier, monospace;
261
+ font-weight: bold;
262
+ font-size: 24px;
263
+ color: #fff;
264
+ text-shadow: 1px 1px 0 #aaa;
265
+ letter-spacing: 1px;
266
+ }
267
+
268
+ .banner-char {
269
+ height: 90%;
270
+ position: absolute;
271
+ right: 0;
272
+ bottom: 0;
273
+ }
274
+
275
+ .author-info {
276
+ display: flex;
277
+ align-items: center;
278
+ margin-bottom: 20px;
279
+ }
280
+
281
+ .author-avatar {
282
+ width: 40px;
283
+ height: 40px;
284
+ border-radius: 50%;
285
+ background-color: #ddd;
286
+ margin-right: 10px;
287
+ object-fit: cover;
288
+ }
289
+
290
+ .author-name {
291
+ font-weight: bold;
292
+ font-size: 14px;
293
+ }
294
+
295
+ .info-bubble {
296
+ border-radius: 15px;
297
+ padding: 25px;
298
+ font-size: 13px;
299
+ line-height: 1.6;
300
+ position: relative;
301
+ }
302
+
303
+ .bubble-header {
304
+ font-weight: bold;
305
+ margin-bottom: 10px;
306
+ display: block;
307
+ }
308
+
309
+ .bubble-text p {
310
+ margin-bottom: 10px;
311
+ }
312
+
313
+ .bubble-link {
314
+ display: block;
315
+ margin-top: 20px;
316
+ text-align: right;
317
+ font-weight: bold;
318
+ text-decoration: none;
319
+ font-size: 14px;
320
+ }
321
+
322
+ .footer-bar {
323
+ padding: 15px 30px;
324
+ display: flex;
325
+ justify-content: space-between;
326
+ align-items: center;
327
+ border-top: 1px solid rgba(0,0,0,0.05);
328
+ }
329
+
330
+ .footer-left {
331
+ display: flex;
332
+ align-items: center;
333
+ gap: 8px;
334
+ }
335
+
336
+ .footer-center {
337
+ font-weight: bold;
338
+ color: #333;
339
+ font-size: 14px;
340
+ }
341
+ </style>
342
+ </head>
343
+ <body>
344
+ <div class="preview-panel">
345
+ <div id="cardPreview"></div>
346
+ </div>
347
+
348
+ <div class="config-panel">
349
+ <h2 style="margin-bottom: 20px; color: #333;">卡片配置预览</h2>
350
+
351
+ <div class="config-section">
352
+ <h3>尺寸设置</h3>
353
+ <div class="config-item">
354
+ <label for="cardWidth">卡片宽度 (px)</label>
355
+ <input type="number" id="cardWidth" value="900" min="400" max="1200">
356
+ </div>
357
+ <div class="config-item">
358
+ <label for="leftColumnWidth">左侧栏宽度 (px)</label>
359
+ <input type="number" id="leftColumnWidth" value="280" min="200" max="500">
360
+ </div>
361
+ </div>
362
+
363
+ <div class="config-section">
364
+ <h3>顶部渐变颜色</h3>
365
+ <div class="config-item">
366
+ <label for="topGradientColor1">起始颜色</label>
367
+ <input type="color" id="topGradientColor1" value="#e8bdf6">
368
+ </div>
369
+ <div class="config-item">
370
+ <label for="topGradientColor2">结束颜色</label>
371
+ <input type="color" id="topGradientColor2" value="#fceabb">
372
+ </div>
373
+ </div>
374
+
375
+ <div class="config-section">
376
+ <h3>底部渐变颜色</h3>
377
+ <div class="config-item">
378
+ <label for="footerGradientColor1">起始颜色</label>
379
+ <input type="color" id="footerGradientColor1" value="#fceabb">
380
+ </div>
381
+ <div class="config-item">
382
+ <label for="footerGradientColor2">结束颜色</label>
383
+ <input type="color" id="footerGradientColor2" value="#e8bdf6">
384
+ </div>
385
+ </div>
386
+
387
+ <div class="config-section">
388
+ <h3>元素颜色</h3>
389
+ <div class="config-item">
390
+ <label for="priceTagBgColor">价格标签背景</label>
391
+ <input type="color" id="priceTagBgColor" value="#ff66b2">
392
+ </div>
393
+ <div class="config-item">
394
+ <label for="infoBubbleBgColor">说明气泡框背景</label>
395
+ <input type="color" id="infoBubbleBgColor" value="#aafcf5">
396
+ </div>
397
+ <div class="config-item">
398
+ <label for="textColor">主要文字颜色</label>
399
+ <input type="color" id="textColor" value="#d63384">
400
+ </div>
401
+ <div class="config-item">
402
+ <label for="shopBannerBgColor">店铺横幅背景</label>
403
+ <input type="color" id="shopBannerBgColor" value="#fcfcd0">
404
+ </div>
405
+ </div>
406
+
407
+ <button class="btn-generate" onclick="generateCard()">生成预览</button>
408
+ </div>
409
+
410
+ <script>
411
+ // 示例数据
412
+ const sampleData = {
413
+ title: "イサナイ・ヌク [Isanai Nuku]",
414
+ price: 4500,
415
+ likes: 1125,
416
+ category: "3D Models/3D Characters",
417
+ author: "あふろだアフロ",
418
+ author_thumbnail_url: "https://via.placeholder.com/50/cccccc/333?text=A",
419
+ image_url: "https://via.placeholder.com/300x300/ffcccc/333333?text=Main+Image",
420
+ description: "このアバターはまめふれんず共通素体を使用しています。「まめふれんず」とは、首から下の素体メッシュを共通規格としたアバターシリーズです。",
421
+ id: "6044846"
422
+ };
423
+
424
+ const relatedItems = [
425
+ { image_url: "https://via.placeholder.com/100/e0f7fa/333?text=Thumb1" },
426
+ { image_url: "https://via.placeholder.com/100/fff9c4/333?text=Thumb2" },
427
+ { image_url: "https://via.placeholder.com/100/dcedc8/333?text=Thumb3" }
428
+ ];
429
+
430
+ function generateCard() {
431
+ const config = {
432
+ cardWidth: document.getElementById('cardWidth').value,
433
+ leftColumnWidth: document.getElementById('leftColumnWidth').value,
434
+ topGradientColor1: document.getElementById('topGradientColor1').value,
435
+ topGradientColor2: document.getElementById('topGradientColor2').value,
436
+ footerGradientColor1: document.getElementById('footerGradientColor1').value,
437
+ footerGradientColor2: document.getElementById('footerGradientColor2').value,
438
+ priceTagBgColor: document.getElementById('priceTagBgColor').value,
439
+ infoBubbleBgColor: document.getElementById('infoBubbleBgColor').value,
440
+ textColor: document.getElementById('textColor').value,
441
+ shopBannerBgColor: document.getElementById('shopBannerBgColor').value
442
+ };
443
+
444
+ const html = `
445
+ <div class="card-container" style="width: ${config.cardWidth}px;">
446
+ <div class="top-gradient-bg" style="background: linear-gradient(to right, ${config.topGradientColor1}, ${config.topGradientColor2});"></div>
447
+
448
+ <div class="header-logo-area">
449
+ <span class="booth-text">BOOTH</span>
450
+ <div class="booth-icon">
451
+ <svg viewBox="0 0 24 24" width="20" height="20" fill="white">
452
+ <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/>
453
+ </svg>
454
+ </div>
455
+ </div>
456
+
457
+ <div class="content-wrapper">
458
+ <div class="left-column" style="width: ${config.leftColumnWidth}px;">
459
+ <img src="${sampleData.image_url}" alt="${sampleData.title}" class="main-image">
460
+
461
+ <div class="price-row">
462
+ <div class="price-tag" style="background-color: ${config.priceTagBgColor};">¥${sampleData.price.toLocaleString()}</div>
463
+ <div class="like-count">
464
+ <span class="heart-icon">♥</span> ${sampleData.likes}
465
+ </div>
466
+ </div>
467
+
468
+ <div class="item-title">${sampleData.title}</div>
469
+ <div class="item-subtitle">${sampleData.category}</div>
470
+
471
+ <div class="other-works-title">其余作品</div>
472
+ <div class="thumbnails">
473
+ ${relatedItems.map(item => `<img src="${item.image_url}" class="thumb-img">`).join('')}
474
+ </div>
475
+ </div>
476
+
477
+ <div class="right-column">
478
+ <div class="shop-banner" style="background-color: ${config.shopBannerBgColor};">
479
+ <div class="banner-text">${sampleData.author}'s SHOP</div>
480
+ <img src="${sampleData.author_thumbnail_url}" class="banner-char" style="opacity: 0.5;">
481
+ </div>
482
+
483
+ <div class="author-info">
484
+ <img src="${sampleData.author_thumbnail_url}" alt="Avatar" class="author-avatar">
485
+ <span class="author-name" style="color: ${config.textColor};">作者:${sampleData.author}</span>
486
+ </div>
487
+
488
+ <div class="info-bubble" style="background-color: ${config.infoBubbleBgColor}; color: ${config.textColor};">
489
+ <span class="bubble-header">🏠 商品说明 🏠</span>
490
+ <div class="bubble-text">
491
+ <p>${sampleData.description}</p>
492
+ </div>
493
+ <a href="https://booth.pm/zh-cn/items/${sampleData.id}" class="bubble-link" style="color: ${config.textColor};">链接:https://booth.pm/zh-cn/items/${sampleData.id}</a>
494
+ </div>
495
+ </div>
496
+ </div>
497
+
498
+ <div class="footer-bar" style="background: linear-gradient(to right, ${config.footerGradientColor1}, ${config.footerGradientColor2});">
499
+ <div class="footer-left">
500
+ <span class="booth-text">BOOTH</span>
501
+ <div class="booth-icon">
502
+ <svg viewBox="0 0 24 24" width="20" height="20" fill="white">
503
+ <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/>
504
+ </svg>
505
+ </div>
506
+ </div>
507
+ <div class="footer-center">
508
+ 由乃花生成 | BOOTH 提供
509
+ </div>
510
+ </div>
511
+ </div>
512
+ `;
513
+
514
+ document.getElementById('cardPreview').innerHTML = html;
515
+ }
516
+
517
+ // 初始化时生成一次预览
518
+ generateCard();
519
+
520
+ // 监听所有输入变化,实时更新预览
521
+ document.querySelectorAll('input').forEach(input => {
522
+ input.addEventListener('input', generateCard);
523
+ });
524
+ </script>
525
+ </body>
526
+ </html>