koishi-plugin-vsinger-gacha 1.5.2 → 1.5.3

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/lib/handbook.js CHANGED
@@ -209,7 +209,9 @@ async function render({ game, store, uid, displayName, outDir, tagsDir, thumbsDi
209
209
  const W = PAD * 2 + part.length * COLW + (part.length - 1) * GAP * 2;
210
210
  // 头部高度随图标自适应(避免标题压到第一个系列条)
211
211
  const _R = Math.max(26, Math.min(72, Math.round(W * 0.017)));
212
- const HEADY = Math.max(HEAD, 34 + _R * 2 + 40);
212
+ const _BW = Math.max(150, Math.min(400, Math.round(W * 0.13)));
213
+ const _BH = Math.round(_BW * 0.5);
214
+ const HEADY = Math.max(HEAD, 34 + Math.max(_R * 2, _BH) + 40);
213
215
  const H = HEADY + Math.max(...part.map((c) => c.reduce((a, b) => a + b.h, 0))) + 70;
214
216
  const canvas = Canvas.createCanvas(W, H);
215
217
  const g = canvas.getContext('2d');
package/lib/render/kit.js CHANGED
@@ -121,26 +121,27 @@ function header(g, o) {
121
121
  g.fillText(o.subtitle, x + R * 2 + 18, y + Math.max(40, R * 2 - 8));
122
122
  }
123
123
 
124
- // 右侧徽章
124
+ // 右侧徽章(按画布宽度自适应)
125
125
  if (o.badge != null) {
126
- const bw = 118;
127
- const bh = 58;
126
+ const bw = Math.max(150, Math.min(400, Math.round(W * 0.13)));
127
+ const bh = Math.round(bw * 0.5);
128
128
  const bx = x + W - bw;
129
129
  panel(g, bx, y - 4, bw, bh, { radius: RADIUS.md, fill: 'rgba(255,255,255,0.95)' });
130
130
  g.fillStyle = COLOR.accent;
131
- g.font = `bold 26px ${FONT}`;
132
- g.fillText(String(o.badge), bx + 14, y + 6);
131
+ g.font = `bold ${Math.round(bh * 0.46)}px ${FONT}`;
132
+ g.fillText(String(o.badge), bx + bw * 0.1, y + bh * 0.06);
133
133
  g.fillStyle = COLOR.textSub;
134
- g.font = `12px ${FONT}`;
135
- g.fillText(String(o.badgeSub || ''), bx + 14, y + 36);
134
+ g.font = `${Math.round(bh * 0.2)}px ${FONT}`;
135
+ g.fillText(String(o.badgeSub || ''), bx + bw * 0.1, y + bh * 0.6);
136
136
  // 进度条
137
137
  const pct = Math.max(0, Math.min(1, Number(o.progress || 0)));
138
+ const pbH = Math.max(5, Math.round(bh * 0.08));
138
139
  g.fillStyle = 'rgba(74,144,217,0.15)';
139
- roundRect(g, bx + 10, y + bh - 6, bw - 20, 5, 3);
140
+ roundRect(g, bx + bw * 0.08, y + bh - pbH - 8, bw * 0.84, pbH, pbH / 2);
140
141
  g.fill();
141
142
  if (pct > 0) {
142
143
  g.fillStyle = COLOR.accent;
143
- roundRect(g, bx + 10, y + bh - 6, Math.max(4, (bw - 20) * pct), 5, 3);
144
+ roundRect(g, bx + bw * 0.08, y + bh - pbH - 8, Math.max(6, bw * 0.84 * pct), pbH, pbH / 2);
144
145
  g.fill();
145
146
  }
146
147
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koishi-plugin-vsinger-gacha",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "description": "VSinger 收藏集抽卡 / 签到积分 / 图鉴(Koishi 插件,一次性安装)",
5
5
  "main": "lib/index.js",
6
6
  "files": [