dsh-folia 4.0.4 → 4.0.5
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/client.js +20 -0
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -17484,6 +17484,19 @@ window.__ModuleLoader__.load({
|
|
|
17484
17484
|
);
|
|
17485
17485
|
}
|
|
17486
17486
|
|
|
17487
|
+
/**
|
|
17488
|
+
* 这张图是不是"预览尺寸"(当壁纸会糊)。
|
|
17489
|
+
*
|
|
17490
|
+
* 判据用**短边 < 1280**:站点上实测有 192×192 / 254×254 / 1024×1024 的条目,
|
|
17491
|
+
* 它们标题里就写着「(预览)」。用户看不到分辨率,就会把它当壁纸用,然后觉得"糊"。
|
|
17492
|
+
* 视频不判(分辨率高但体积大是另一类问题,不该混在一起提示)。
|
|
17493
|
+
*/
|
|
17494
|
+
function qpIsLowRes(w) {
|
|
17495
|
+
if (!w || w.type !== 'image') return false;
|
|
17496
|
+
const shortSide = Math.min(Number(w.width) || 0, Number(w.height) || 0);
|
|
17497
|
+
return shortSide > 0 && shortSide < 1280;
|
|
17498
|
+
}
|
|
17499
|
+
|
|
17487
17500
|
function qpRenderCard(w, sel) {
|
|
17488
17501
|
// ── 卡:缩略图网格形态(视图切换的「卡片」档;点击语义与列表行一致)──
|
|
17489
17502
|
return React.createElement("div", {
|
|
@@ -17506,6 +17519,13 @@ window.__ModuleLoader__.load({
|
|
|
17506
17519
|
})
|
|
17507
17520
|
: React.createElement("span", { className: "we-qp__card-empty" }, weT("无预览")),
|
|
17508
17521
|
React.createElement("span", { className: "we-qp__card-type" }, CARD_TYPE_LABELS[w.type] || weT("壁纸")),
|
|
17522
|
+
qpIsLowRes(w)
|
|
17523
|
+
? React.createElement("span", {
|
|
17524
|
+
className: "we-qp__card-badge",
|
|
17525
|
+
style: { right: "auto", left: "6px", background: "rgba(255,196,120,0.9)", color: "#3a2600" },
|
|
17526
|
+
title: weT("这张图只有 ") + w.width + "×" + w.height + weT(",当壁纸会糊 —— 建议在站点上传原图"),
|
|
17527
|
+
}, weT("预览尺寸"))
|
|
17528
|
+
: null,
|
|
17509
17529
|
w.id === sel.id && React.createElement("span", { className: "we-qp__card-badge" }, weT("当前")),
|
|
17510
17530
|
React.createElement("span", { className: "we-qp__card-title" }, w.title),
|
|
17511
17531
|
);
|