koishi-plugin-ll-mc 3.1.2 → 3.1.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.
- package/lib/index.js +5 -11
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -2578,19 +2578,14 @@ ${targetUserRecord[0].username}
|
|
|
2578
2578
|
background-color: #F5F7FA;
|
|
2579
2579
|
}
|
|
2580
2580
|
body {
|
|
2581
|
-
padding: 16px;
|
|
2582
2581
|
font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
2583
2582
|
-webkit-font-smoothing: antialiased;
|
|
2584
2583
|
}
|
|
2585
2584
|
.card {
|
|
2586
2585
|
width: 100%;
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
background: #FFFFFF;
|
|
2590
|
-
border-radius: 12px;
|
|
2586
|
+
/* 去掉容器白色圆角背景,让自定义背景直接透出;边距即卡片内边距(到边缘的真实距离) */
|
|
2587
|
+
background: transparent;
|
|
2591
2588
|
padding: 24px;
|
|
2592
|
-
box-shadow: 0 4px 6px rgba(0,0,0,0.06);
|
|
2593
|
-
border: 1px solid #F3F4F6;
|
|
2594
2589
|
}
|
|
2595
2590
|
.card-header { text-align: center; margin-bottom: 22px; }
|
|
2596
2591
|
.card-title { font-size: 28px; font-weight: 700; letter-spacing: 0.02em; color: #000000; margin-bottom: 6px; }
|
|
@@ -2637,10 +2632,9 @@ ${rows}
|
|
|
2637
2632
|
logger.warn("Leaderboard template wait timed out, screenshotting current content.");
|
|
2638
2633
|
}
|
|
2639
2634
|
await page.waitForSelector(".card").catch(() => {});
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
: await page.screenshot({ type: "png", fullPage: true });
|
|
2635
|
+
// 背景(自定义 CSS/API 背景)是加在 html 上的,必须截整页才能把卡片外的背景一起截进来;
|
|
2636
|
+
// body 高度由内容撑开(无 min-height),所以 fullPage 不会产生多余空白。
|
|
2637
|
+
const buf = await page.screenshot({ type: "png", fullPage: true });
|
|
2644
2638
|
return `data:image/png;base64,${buf.toString("base64")}`;
|
|
2645
2639
|
} catch (error) {
|
|
2646
2640
|
logger.error("Failed to render leaderboard template:", error);
|