koishi-plugin-mcdle 0.4.0 → 0.5.1
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/README.md +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +118 -108
- package/package.json +2 -2
package/README.md
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Context, Schema, Session } from 'koishi';
|
|
2
2
|
import { MobData, BlockData, ItemData } from './data';
|
|
3
3
|
export declare const name = "mcdle";
|
|
4
|
-
export declare const usage = "## \u4F7F\u7528\n\n\u53D1\u9001 `mcdle` \u67E5\u770B\u73A9\u6CD5\u4E0E\u5168\u90E8\u6307\u4EE4\u3002`mcdle.\u731C [\u540D\u79F0]` \u7528\u6709\u6548\u8BCD\u6761\u5F00\u5C40\u6216\u731C\u6D4B\u3002\u9996\u6B21\u731C\u6D4B\u7684\u8BCD\u6761\u51B3\u5B9A\u751F\u7269\u3001\u7269\u54C1\u6216\u65B9\u5757\u6A21\u5F0F\uFF0C\u7CFB\u7EDF\u518D\u4ECE\u540C\u7C7B\u8BCD\u5E93\u4E2D\u62BD\u53D6\u7B54\u6848\u3002\n\n## \u6307\u4EE4\n\n| \u6307\u4EE4 | \u8BF4\u660E |\n| --- | --- |\n| `mcdle` | \u73A9\u6CD5\u4E0E\u6307\u4EE4\u8BF4\u660E |\n| `mcdle.\u731C [\u540D\u79F0]` | \u7528\u6709\u6548\u8BCD\u6761\u5F00\u5C40\u6216\u731C\u6D4B |\n| `mcdle.\u88F8\u731C [\u5F00/\u5173]` | \u5F00\u5173\u672C\u9891\u9053\u7684\u65E0\u524D\u7F00\u7EED\u731C |\n| `mcdle.\u6392\u884C\u699C` | \
|
|
4
|
+
export declare const usage = "## \u4F7F\u7528\n\n\u53D1\u9001 `mcdle` \u67E5\u770B\u73A9\u6CD5\u4E0E\u5168\u90E8\u6307\u4EE4\u3002`mcdle.\u731C [\u540D\u79F0]` \u7528\u6709\u6548\u8BCD\u6761\u5F00\u5C40\u6216\u731C\u6D4B\u3002\u9996\u6B21\u731C\u6D4B\u7684\u8BCD\u6761\u51B3\u5B9A\u751F\u7269\u3001\u7269\u54C1\u6216\u65B9\u5757\u6A21\u5F0F\uFF0C\u7CFB\u7EDF\u518D\u4ECE\u540C\u7C7B\u8BCD\u5E93\u4E2D\u62BD\u53D6\u7B54\u6848\u3002\n\n## \u6307\u4EE4\n\n| \u6307\u4EE4 | \u8BF4\u660E |\n| --- | --- |\n| `mcdle` | \u73A9\u6CD5\u4E0E\u6307\u4EE4\u8BF4\u660E |\n| `mcdle.\u731C [\u540D\u79F0]` | \u7528\u6709\u6548\u8BCD\u6761\u5F00\u5C40\u6216\u731C\u6D4B |\n| `mcdle.\u88F8\u731C [\u5F00/\u5173]` | \u5F00\u5173\u672C\u9891\u9053\u7684\u65E0\u524D\u7F00\u7EED\u731C |\n| `mcdle.\u6392\u884C\u699C` | \u7D2F\u8BA1\u6218\u7EE9 |\n| `mcdle.\u8BCD\u5E93` | \u5168\u90E8\u8BCD\u6761 |\n\n## \u63D0\u793A\n\n| \u7B26\u53F7 | \u542B\u4E49 |\n| --- | --- |\n| \uD83D\uDFE9 | \u5B8C\u5168\u5339\u914D |\n| \uD83D\uDFE8 | \u90E8\u5206\u5339\u914D |\n| \uD83D\uDFE5 | \u4E0D\u5339\u914D |\n| \uD83D\uDFE5\u2B06\uFE0F / \uD83D\uDFE5\u2B07\uFE0F | \u7B54\u6848\u66F4\u5927 / \u66F4\u5C0F |";
|
|
5
5
|
export declare const inject: {
|
|
6
6
|
required: string[];
|
|
7
7
|
optional: string[];
|
package/lib/index.js
CHANGED
|
@@ -14804,6 +14804,7 @@ var TYPE = {
|
|
|
14804
14804
|
labelMedium: { size: 12, line: 16, weight: 500, tracking: 0.5 },
|
|
14805
14805
|
labelSmall: { size: 11, line: 16, weight: 500, tracking: 0.5 }
|
|
14806
14806
|
};
|
|
14807
|
+
var EMPHASIZED_WEIGHT = { display: 600, headline: 600, title: 600, label: 600 };
|
|
14807
14808
|
var ELEVATION = [
|
|
14808
14809
|
"none",
|
|
14809
14810
|
"0 1px 2px 0 rgba(0,0,0,.30), 0 1px 3px 1px rgba(0,0,0,.15)",
|
|
@@ -15461,6 +15462,7 @@ function statusOf(guess, key) {
|
|
|
15461
15462
|
return STATUS_META[v] ? v : "unknown";
|
|
15462
15463
|
}
|
|
15463
15464
|
__name(statusOf, "statusOf");
|
|
15465
|
+
var INK = lch(100, 0, HUE);
|
|
15464
15466
|
var STATUS_TILE = {
|
|
15465
15467
|
hit: lch(42, 44, 142),
|
|
15466
15468
|
half: lch(44, 46, 82),
|
|
@@ -15468,6 +15470,7 @@ var STATUS_TILE = {
|
|
|
15468
15470
|
none: SCHEME.surfaceContainerHigh
|
|
15469
15471
|
};
|
|
15470
15472
|
var FONT_STACK_CJK = `"Minecraft", "Fusion Pixel 12px monospaced", "Fusion Pixel 12px", "Zpix", ` + FONT_STACK;
|
|
15473
|
+
var NUM_FONT = `${MONO_STACK},${FONT_STACK_CJK}`;
|
|
15471
15474
|
var CSS = `
|
|
15472
15475
|
${baseline(SCHEME)}${components()}
|
|
15473
15476
|
body{font-family:${FONT_STACK_CJK};background:transparent}
|
|
@@ -15478,9 +15481,7 @@ html,body{background:transparent}
|
|
|
15478
15481
|
position:relative;
|
|
15479
15482
|
display:inline-block;
|
|
15480
15483
|
overflow:hidden;
|
|
15481
|
-
|
|
15482
|
-
color:var(--md-sys-color-on-surface);
|
|
15483
|
-
border-radius:${SHAPE.extraLarge}px;
|
|
15484
|
+
border-radius:var(--md-sys-shape-corner-extra-large);
|
|
15484
15485
|
}
|
|
15485
15486
|
.pad{padding:24px}
|
|
15486
15487
|
|
|
@@ -15493,24 +15494,25 @@ html,body{background:transparent}
|
|
|
15493
15494
|
/* 顶端那道强调色仍在,但收成一条细的圆头指示条,不再模拟草皮 */
|
|
15494
15495
|
.hd .turf{
|
|
15495
15496
|
position:absolute;left:24px;top:14px;width:56px;height:4px;
|
|
15496
|
-
border-radius
|
|
15497
|
+
border-radius:var(--md-sys-shape-corner-full);background:var(--accent);
|
|
15497
15498
|
}
|
|
15498
15499
|
.hd-row{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-top:18px}
|
|
15499
15500
|
.brand{display:flex;align-items:center;gap:12px}
|
|
15500
15501
|
.brand .mark{color:var(--accent)}
|
|
15501
|
-
.brand .word{font-size
|
|
15502
|
-
.brand .word b{color:var(--accent);font-weight
|
|
15503
|
-
.hd .sub{margin-top:8px;font-size
|
|
15502
|
+
.brand .word{font-size:${TYPE.headlineMedium.size}px;font-weight:${EMPHASIZED_WEIGHT.headline};letter-spacing:.18em;line-height:1}
|
|
15503
|
+
.brand .word b{color:var(--accent);font-weight:${EMPHASIZED_WEIGHT.headline}}
|
|
15504
|
+
.hd .sub{margin-top:8px;font-size:${TYPE.bodySmall.size}px;letter-spacing:.05em;color:var(--md-sys-color-on-surface-variant)}
|
|
15504
15505
|
.hd-meta{text-align:right;flex:none}
|
|
15505
|
-
.hd-meta .big{font-size
|
|
15506
|
-
.hd-meta .cap{font-size
|
|
15506
|
+
.hd-meta .big{font-family:${NUM_FONT};font-size:${TYPE.headlineMedium.size}px;font-weight:${EMPHASIZED_WEIGHT.headline};color:var(--accent);line-height:1;font-variant-numeric:tabular-nums}
|
|
15507
|
+
.hd-meta .cap{font-size:${TYPE.labelSmall.size}px;letter-spacing:.1em;color:var(--md-sys-color-on-surface-variant);margin-top:6px}
|
|
15507
15508
|
|
|
15508
|
-
/*
|
|
15509
|
+
/* 模式徽记:药丸形。底色是每模式各自的 accent(同一套色调板上的色调 80),
|
|
15510
|
+
不是主题容器色,m3-chip 没有对应档位 */
|
|
15509
15511
|
.badge{
|
|
15510
15512
|
display:inline-flex;align-items:center;gap:7px;padding:6px 14px;
|
|
15511
|
-
border-radius
|
|
15513
|
+
border-radius:var(--md-sys-shape-corner-full);
|
|
15512
15514
|
background:var(--accent);color:var(--md-sys-color-surface);
|
|
15513
|
-
font-size
|
|
15515
|
+
font-size:${TYPE.labelMedium.size}px;letter-spacing:.06em;font-weight:${EMPHASIZED_WEIGHT.label};
|
|
15514
15516
|
}
|
|
15515
15517
|
|
|
15516
15518
|
/* ── 猜测板 ───────────────────────────────────────── */
|
|
@@ -15518,8 +15520,8 @@ table{border-collapse:separate;border-spacing:6px;margin:0 -6px}
|
|
|
15518
15520
|
th{padding:0 0 8px;vertical-align:bottom}
|
|
15519
15521
|
.col{display:flex;flex-direction:column;align-items:center;gap:6px;
|
|
15520
15522
|
min-width:80px;max-width:132px;color:var(--md-sys-color-on-surface-variant)}
|
|
15521
|
-
.col .lb{font-size
|
|
15522
|
-
text-align:center;line-height:1.25;font-weight
|
|
15523
|
+
.col .lb{font-size:${TYPE.labelSmall.size}px;letter-spacing:.04em;color:var(--md-sys-color-on-surface-variant);
|
|
15524
|
+
text-align:center;line-height:1.25;font-weight:${EMPHASIZED_WEIGHT.label}}
|
|
15523
15525
|
th.n .col{align-items:flex-start;min-width:150px}
|
|
15524
15526
|
|
|
15525
15527
|
td{padding:0}
|
|
@@ -15528,26 +15530,26 @@ td{padding:0}
|
|
|
15528
15530
|
min-height:60px;min-width:76px;max-width:132px;
|
|
15529
15531
|
padding:9px 10px;
|
|
15530
15532
|
display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;
|
|
15531
|
-
border-radius
|
|
15533
|
+
border-radius:var(--md-sys-shape-corner-medium);
|
|
15532
15534
|
background:var(--tile);
|
|
15533
15535
|
}
|
|
15534
15536
|
/* 多标签字段给更宽的上限,否则一列里会折成很高的一坨 */
|
|
15535
15537
|
.tile.list{max-width:168px}
|
|
15536
15538
|
th.list .col{max-width:168px}
|
|
15537
|
-
.tile .v{font-size
|
|
15538
|
-
color
|
|
15539
|
+
.tile .v{font-size:${TYPE.titleSmall.size}px;font-weight:${EMPHASIZED_WEIGHT.title};line-height:1.35;text-align:center;
|
|
15540
|
+
color:${INK};word-break:break-word}
|
|
15539
15541
|
.tile .chips{display:flex;flex-wrap:wrap;gap:4px;justify-content:center}
|
|
15540
15542
|
.chip{
|
|
15541
|
-
font-size
|
|
15542
|
-
border-radius
|
|
15543
|
-
color
|
|
15543
|
+
font-size:${TYPE.labelSmall.size}px;line-height:1.35;padding:2px 8px;
|
|
15544
|
+
border-radius:var(--md-sys-shape-corner-full);
|
|
15545
|
+
color:${INK};background:color-mix(in srgb, var(--md-sys-color-scrim) 24%, transparent);
|
|
15544
15546
|
}
|
|
15545
15547
|
/* 部分匹配时把真正命中的标签点亮,让「黄」变得可读 */
|
|
15546
|
-
.chip.on{background
|
|
15547
|
-
.tile .flag{position:absolute;top:5px;right:5px;color:
|
|
15548
|
+
.chip.on{background:${INK};color:var(--md-sys-color-surface);font-weight:${EMPHASIZED_WEIGHT.label}}
|
|
15549
|
+
.tile .flag{position:absolute;top:5px;right:5px;color:color-mix(in srgb, ${INK} 85%, transparent)}
|
|
15548
15550
|
/* 数值方向不只靠角标:整块的上/下边缘会亮起一条,指向答案所在的一侧 */
|
|
15549
15551
|
.tile.s-up::after,.tile.s-down::after{content:"";position:absolute;left:12px;right:12px;height:4px;
|
|
15550
|
-
border-radius
|
|
15552
|
+
border-radius:var(--md-sys-shape-corner-full);background:color-mix(in srgb, ${INK} 62%, transparent)}
|
|
15551
15553
|
.tile.s-up::after{top:5px}
|
|
15552
15554
|
.tile.s-down::after{bottom:5px}
|
|
15553
15555
|
|
|
@@ -15560,14 +15562,14 @@ th.list .col{max-width:168px}
|
|
|
15560
15562
|
.name{
|
|
15561
15563
|
display:flex;align-items:center;gap:12px;min-height:60px;min-width:150px;
|
|
15562
15564
|
padding:8px 12px 8px 9px;
|
|
15563
|
-
border-radius
|
|
15565
|
+
border-radius:var(--md-sys-shape-corner-medium);
|
|
15564
15566
|
background:var(--md-sys-color-surface-container-high);
|
|
15565
15567
|
}
|
|
15566
15568
|
.name.correct{background:${STATUS_TILE.hit}}
|
|
15567
15569
|
.thumb{
|
|
15568
15570
|
width:44px;height:44px;flex:none;
|
|
15569
15571
|
display:flex;align-items:center;justify-content:center;
|
|
15570
|
-
border-radius
|
|
15572
|
+
border-radius:var(--md-sys-shape-corner-small);
|
|
15571
15573
|
background:var(--md-sys-color-surface-container-lowest);
|
|
15572
15574
|
}
|
|
15573
15575
|
.thumb img{max-width:38px;max-height:38px;display:block}
|
|
@@ -15576,28 +15578,31 @@ th.list .col{max-width:168px}
|
|
|
15576
15578
|
.thumb .fb{display:none;color:var(--md-sys-color-on-surface-variant)}
|
|
15577
15579
|
.thumb.failed .fb{display:block}
|
|
15578
15580
|
.name .txt{min-width:0}
|
|
15579
|
-
.name .cn{font-size
|
|
15580
|
-
.name .en{font-size
|
|
15581
|
+
.name .cn{font-size:${TYPE.titleMedium.size}px;font-weight:${EMPHASIZED_WEIGHT.title};line-height:1.25}
|
|
15582
|
+
.name .en{font-size:${TYPE.labelSmall.size}px;letter-spacing:.04em;color:var(--md-sys-color-on-surface-variant);margin-top:3px;
|
|
15581
15583
|
white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px}
|
|
15582
|
-
.name.correct .cn,.name.correct .en,.name.correct .no{color
|
|
15584
|
+
.name.correct .cn,.name.correct .en,.name.correct .no{color:${INK}}
|
|
15583
15585
|
.name.correct .en,.name.correct .no{opacity:.78}
|
|
15584
|
-
.name .no{font-size
|
|
15586
|
+
.name .no{font-family:${NUM_FONT};font-size:${TYPE.labelSmall.size}px;color:var(--md-sys-color-on-surface-variant);margin-top:3px}
|
|
15585
15587
|
|
|
15586
|
-
/*
|
|
15587
|
-
|
|
15588
|
+
/* 最新一行的强调:外圈一圈 2px 描边 + 行首的圆头标记。
|
|
15589
|
+
这是高亮环不是层高,所以用 outline 而不是 box-shadow */
|
|
15590
|
+
tr.fresh .tile,tr.fresh .name{outline:2px solid var(--accent)}
|
|
15588
15591
|
tr.fresh .name{position:relative}
|
|
15589
15592
|
tr.fresh .name::before{content:"";position:absolute;left:0;top:14px;bottom:14px;width:4px;
|
|
15590
|
-
border-radius
|
|
15593
|
+
border-radius:var(--md-sys-shape-corner-full);background:var(--accent)}
|
|
15591
15594
|
|
|
15592
15595
|
/* ── 进度条 ───────────────────────────────────────── */
|
|
15596
|
+
/* 轨道内嵌填充、宽度按百分比,高度 12px;m3-bar 是「填充与轨道两个全圆角块 +
|
|
15597
|
+
4px 空隙」的 16px 结构,换过去要连 DOM 与高度一起改,故保留本地类名 */
|
|
15593
15598
|
.prog{display:flex;align-items:center;gap:12px;margin-top:20px}
|
|
15594
15599
|
.prog .bar{
|
|
15595
15600
|
flex:1;height:12px;overflow:hidden;
|
|
15596
|
-
border-radius
|
|
15601
|
+
border-radius:var(--md-sys-shape-corner-full);
|
|
15597
15602
|
background:var(--md-sys-color-surface-container-highest);
|
|
15598
15603
|
}
|
|
15599
|
-
.prog .fill{height:100%;border-radius
|
|
15600
|
-
.prog .num{font-size
|
|
15604
|
+
.prog .fill{height:100%;border-radius:var(--md-sys-shape-corner-full);background:var(--accent)}
|
|
15605
|
+
.prog .num{font-family:${NUM_FONT};font-size:${TYPE.labelMedium.size}px;color:var(--md-sys-color-on-surface-variant);letter-spacing:.04em;flex:none;
|
|
15601
15606
|
font-variant-numeric:tabular-nums}
|
|
15602
15607
|
|
|
15603
15608
|
/* ── 图例 / 页脚 ──────────────────────────────────── */
|
|
@@ -15608,49 +15613,51 @@ tr.fresh .name::before{content:"";position:absolute;left:0;top:14px;bottom:14px;
|
|
|
15608
15613
|
}
|
|
15609
15614
|
.lg{
|
|
15610
15615
|
display:flex;align-items:center;gap:6px;padding:5px 12px;
|
|
15611
|
-
border-radius
|
|
15612
|
-
font-size
|
|
15616
|
+
border-radius:var(--md-sys-shape-corner-full);
|
|
15617
|
+
font-size:${TYPE.labelSmall.size}px;color:${INK};background:var(--tile);
|
|
15613
15618
|
}
|
|
15614
15619
|
.lg.s-none{color:var(--md-sys-color-on-surface-variant)}
|
|
15615
|
-
.tip{margin-left:auto;font-size
|
|
15620
|
+
.tip{margin-left:auto;font-size:${TYPE.labelSmall.size}px;color:var(--md-sys-color-on-surface-variant);letter-spacing:.02em}
|
|
15616
15621
|
|
|
15617
15622
|
/* ── 通用区块 ─────────────────────────────────────── */
|
|
15618
15623
|
.sec{margin-top:22px}
|
|
15619
15624
|
.sec:first-child{margin-top:0}
|
|
15620
|
-
.sec-t{display:flex;align-items:center;gap:10px;font-size
|
|
15621
|
-
font-weight
|
|
15625
|
+
.sec-t{display:flex;align-items:center;gap:10px;font-size:${TYPE.labelMedium.size}px;letter-spacing:.1em;
|
|
15626
|
+
font-weight:${EMPHASIZED_WEIGHT.label};color:var(--md-sys-color-on-surface-variant);margin-bottom:12px}
|
|
15622
15627
|
.sec-t::after{content:"";flex:1;height:1px;background:var(--md-sys-color-outline-variant)}
|
|
15623
15628
|
.panel{
|
|
15624
15629
|
padding:16px 18px;
|
|
15625
|
-
border-radius
|
|
15630
|
+
border-radius:var(--md-sys-shape-corner-large);
|
|
15626
15631
|
background:var(--md-sys-color-surface-container);
|
|
15627
15632
|
}
|
|
15628
15633
|
.rows{display:flex;flex-direction:column;gap:9px}
|
|
15629
|
-
.row{display:flex;align-items:center;gap:10px;font-size
|
|
15634
|
+
.row{display:flex;align-items:center;gap:10px;font-size:${TYPE.bodyMedium.size}px;
|
|
15630
15635
|
color:var(--md-sys-color-on-surface);line-height:1.5}
|
|
15631
|
-
.row .k{color:var(--accent);flex:none;font-weight
|
|
15632
|
-
.row .m{color:var(--md-sys-color-on-surface-variant);font-size
|
|
15636
|
+
.row .k{color:var(--accent);flex:none;font-weight:${EMPHASIZED_WEIGHT.label}}
|
|
15637
|
+
.row .m{color:var(--md-sys-color-on-surface-variant);font-size:${TYPE.bodySmall.size}px}
|
|
15633
15638
|
.cmd{
|
|
15634
|
-
font-weight
|
|
15639
|
+
font-weight:${EMPHASIZED_WEIGHT.label};color:var(--md-sys-color-on-surface);
|
|
15635
15640
|
background:var(--md-sys-color-surface-container-highest);
|
|
15636
|
-
padding:2px 9px;border-radius
|
|
15641
|
+
padding:2px 9px;border-radius:var(--md-sys-shape-corner-small);
|
|
15637
15642
|
}
|
|
15638
15643
|
|
|
15639
15644
|
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
|
|
15640
15645
|
.mode-card{
|
|
15641
15646
|
padding:15px 16px;
|
|
15642
|
-
border-radius
|
|
15647
|
+
border-radius:var(--md-sys-shape-corner-large);
|
|
15643
15648
|
background:var(--md-sys-color-surface-container);
|
|
15644
15649
|
}
|
|
15645
|
-
.mode-card .top{display:flex;align-items:center;gap:9px;font-size
|
|
15646
|
-
.mode-card .cnt{font-size
|
|
15647
|
-
.mode-card .tl{font-size
|
|
15650
|
+
.mode-card .top{display:flex;align-items:center;gap:9px;font-size:${TYPE.titleMedium.size}px;font-weight:${EMPHASIZED_WEIGHT.title}}
|
|
15651
|
+
.mode-card .cnt{font-size:${TYPE.labelSmall.size}px;color:var(--md-sys-color-on-surface-variant);margin-top:8px;letter-spacing:.04em}
|
|
15652
|
+
.mode-card .tl{font-size:${TYPE.labelSmall.size}px;color:var(--md-sys-color-on-surface-variant);margin-top:6px;line-height:1.5}
|
|
15648
15653
|
|
|
15649
15654
|
.attrs{display:flex;flex-wrap:wrap;gap:8px}
|
|
15655
|
+
/* 配色与 m3-chip 的默认档(secondary-container)一致,但尺寸更小:
|
|
15656
|
+
12px 字、7px/14px 内距、无固定高度,降级要覆盖组件的字号与内距,故留本地类名 */
|
|
15650
15657
|
.attr{
|
|
15651
15658
|
display:flex;align-items:center;gap:7px;padding:7px 14px;
|
|
15652
|
-
border-radius
|
|
15653
|
-
font-size
|
|
15659
|
+
border-radius:var(--md-sys-shape-corner-full);
|
|
15660
|
+
font-size:${TYPE.labelMedium.size}px;color:var(--md-sys-color-on-secondary-container);
|
|
15654
15661
|
background:var(--md-sys-color-secondary-container);
|
|
15655
15662
|
}
|
|
15656
15663
|
.attr .px{color:var(--accent)}
|
|
@@ -15662,7 +15669,7 @@ tr.fresh .name::before{content:"";position:absolute;left:0;top:14px;bottom:14px;
|
|
|
15662
15669
|
.reveal .big-thumb{
|
|
15663
15670
|
width:136px;height:136px;flex:none;
|
|
15664
15671
|
display:flex;align-items:center;justify-content:center;
|
|
15665
|
-
border-radius
|
|
15672
|
+
border-radius:var(--md-sys-shape-corner-extra-large);
|
|
15666
15673
|
background:var(--md-sys-color-surface-container);
|
|
15667
15674
|
}
|
|
15668
15675
|
.reveal .big-thumb img{max-width:112px;max-height:112px;display:block}
|
|
@@ -15670,56 +15677,44 @@ tr.fresh .name::before{content:"";position:absolute;left:0;top:14px;bottom:14px;
|
|
|
15670
15677
|
.reveal .big-thumb img.broken{display:none}
|
|
15671
15678
|
.reveal .big-thumb .fb{display:none;color:var(--md-sys-color-on-surface-variant)}
|
|
15672
15679
|
.reveal .big-thumb.failed .fb{display:block}
|
|
15673
|
-
.reveal .cn{font-size
|
|
15674
|
-
.reveal .en{font-size
|
|
15680
|
+
.reveal .cn{font-size:${TYPE.displaySmall.size}px;font-weight:${EMPHASIZED_WEIGHT.display};line-height:1.1}
|
|
15681
|
+
.reveal .en{font-size:${TYPE.bodySmall.size}px;letter-spacing:.1em;color:var(--md-sys-color-on-surface-variant);margin-top:10px}
|
|
15675
15682
|
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
|
|
15676
15683
|
.stat{
|
|
15677
15684
|
padding:13px 16px;
|
|
15678
|
-
border-radius
|
|
15685
|
+
border-radius:var(--md-sys-shape-corner-large);
|
|
15679
15686
|
background:var(--md-sys-color-surface-container);
|
|
15680
15687
|
}
|
|
15681
|
-
.stat .n{font-size
|
|
15682
|
-
.stat .c{font-size
|
|
15688
|
+
.stat .n{font-family:${NUM_FONT};font-size:${TYPE.titleLarge.size}px;font-weight:${EMPHASIZED_WEIGHT.title};color:var(--accent);line-height:1;font-variant-numeric:tabular-nums}
|
|
15689
|
+
.stat .c{font-size:${TYPE.labelSmall.size}px;color:var(--md-sys-color-on-surface-variant);margin-top:7px;letter-spacing:.06em}
|
|
15683
15690
|
|
|
15684
15691
|
/* ── 排行榜 ───────────────────────────────────────── */
|
|
15692
|
+
/* 列用 m3-list、行用 m3-list-item:圆角(首尾项放大到 extraLarge)、容器色与
|
|
15693
|
+
徽章配色都由组件给,本地只补这张卡片自己的行距与内距 */
|
|
15685
15694
|
.rank{display:flex;flex-direction:column;gap:6px}
|
|
15686
|
-
.rk{
|
|
15687
|
-
display:flex;align-items:center;gap:14px;padding:12px 14px;
|
|
15688
|
-
border-radius:${SHAPE.medium}px;
|
|
15689
|
-
background:var(--md-sys-color-surface-container);
|
|
15690
|
-
}
|
|
15691
|
-
.rk:first-child{border-top-left-radius:${SHAPE.extraLarge}px;border-top-right-radius:${SHAPE.extraLarge}px}
|
|
15692
|
-
.rk:last-child{border-bottom-left-radius:${SHAPE.extraLarge}px;border-bottom-right-radius:${SHAPE.extraLarge}px}
|
|
15695
|
+
.rk{gap:14px;padding:12px 14px}
|
|
15693
15696
|
.rk .pos{
|
|
15694
|
-
width:34px;height:34px;
|
|
15695
|
-
|
|
15696
|
-
border-radius:${SHAPE.full}px;
|
|
15697
|
-
font-size:15px;font-weight:600;
|
|
15698
|
-
color:var(--md-sys-color-on-surface-variant);
|
|
15699
|
-
background:var(--md-sys-color-surface-container-highest);
|
|
15697
|
+
width:34px;height:34px;padding:0;
|
|
15698
|
+
font-family:${NUM_FONT};
|
|
15700
15699
|
}
|
|
15701
|
-
.rk.p1
|
|
15702
|
-
.rk.p1 .pos{background:${MEDAL.gold}}
|
|
15703
|
-
.rk.p2 .pos{background:${MEDAL.silver}}
|
|
15704
|
-
.rk.p3 .pos{background:${MEDAL.bronze}}
|
|
15705
|
-
.rk.p1{box-shadow:0 0 0 2px ${MEDAL.gold}}
|
|
15700
|
+
.rk.p1{outline:2px solid ${MEDAL.gold}}
|
|
15706
15701
|
.rk .who{flex:1;min-width:0}
|
|
15707
|
-
.rk .nm{font-size
|
|
15702
|
+
.rk .nm{font-size:${TYPE.titleSmall.size}px;font-weight:${EMPHASIZED_WEIGHT.title};white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
|
|
15708
15703
|
max-width:260px}
|
|
15709
15704
|
.rk .split{display:flex;gap:10px;margin-top:6px}
|
|
15710
|
-
.rk .sp{display:flex;align-items:center;gap:4px;font-size
|
|
15705
|
+
.rk .sp{display:flex;align-items:center;gap:4px;font-size:${TYPE.labelSmall.size}px;font-family:${NUM_FONT};color:var(--md-sys-color-on-surface-variant)}
|
|
15711
15706
|
.rk .tot{flex:none;text-align:right}
|
|
15712
|
-
.rk .tot .n{font-size
|
|
15713
|
-
.rk .tot .c{font-size
|
|
15707
|
+
.rk .tot .n{font-family:${NUM_FONT};font-size:${TYPE.titleLarge.size}px;font-weight:${EMPHASIZED_WEIGHT.title};color:var(--accent);line-height:1;font-variant-numeric:tabular-nums}
|
|
15708
|
+
.rk .tot .c{font-size:${TYPE.labelSmall.size}px;color:var(--md-sys-color-on-surface-variant);margin-top:5px;letter-spacing:.06em}
|
|
15714
15709
|
|
|
15715
15710
|
.empty{padding:36px 20px;min-width:400px;text-align:center;
|
|
15716
|
-
color:var(--md-sys-color-on-surface-variant);font-size
|
|
15711
|
+
color:var(--md-sys-color-on-surface-variant);font-size:${TYPE.bodyMedium.size}px;line-height:2}
|
|
15717
15712
|
.empty .px{margin:0 auto 14px;color:var(--md-sys-color-on-surface-variant)}
|
|
15718
15713
|
`;
|
|
15719
15714
|
function shell(body, opts) {
|
|
15720
15715
|
const width = opts.width ? `width:${opts.width}px;` : "";
|
|
15721
15716
|
return `<!DOCTYPE html><html lang="zh-CN"><head><meta charset="utf-8"><style>${CSS}</style></head>
|
|
15722
|
-
<body><div id="card" style="--accent:${opts.accent};${width}">${body}</div></body></html>`;
|
|
15717
|
+
<body><div id="card" class="m3-surface" style="--accent:${opts.accent};${width}">${body}</div></body></html>`;
|
|
15723
15718
|
}
|
|
15724
15719
|
__name(shell, "shell");
|
|
15725
15720
|
function esc(s) {
|
|
@@ -15869,7 +15864,7 @@ function winCard(o) {
|
|
|
15869
15864
|
<div class="sec-t"><span>答 案 档 案</span></div>
|
|
15870
15865
|
<div class="attrs">${attrs}</div>
|
|
15871
15866
|
</div>
|
|
15872
|
-
</div>` + noteRow("mcdle
|
|
15867
|
+
</div>` + noteRow("发送「mcdle.排行榜」查看累计战绩");
|
|
15873
15868
|
return shell(body, { accent: meta.accent, width: 720 });
|
|
15874
15869
|
}
|
|
15875
15870
|
__name(winCard, "winCard");
|
|
@@ -15919,7 +15914,7 @@ function helpCard(dailyLimit, allowRepeat, middleware) {
|
|
|
15919
15914
|
<div class="panel"><div class="rows">
|
|
15920
15915
|
<div class="row"><span class="cmd">mcdle</span><span class="m">这份玩法与指令说明</span></div>
|
|
15921
15916
|
<div class="row"><span class="cmd">mcdle.猜 [名称]</span><span class="m">开始一局,或提交猜测</span></div>
|
|
15922
|
-
<div class="row"><span class="cmd">mcdle.猜</span><span class="m"
|
|
15917
|
+
<div class="row"><span class="cmd">mcdle.猜</span><span class="m">局中再次发送可回看当前棋盘</span></div>
|
|
15923
15918
|
<div class="row"><span class="cmd">mcdle.裸猜 [开/关]</span><span class="m">临时切换本频道的无前缀续猜</span></div>
|
|
15924
15919
|
<div class="row"><span class="cmd">mcdle.排行榜</span><span class="m">查看累计战绩</span></div>
|
|
15925
15920
|
<div class="row"><span class="cmd">mcdle.词库</span><span class="m">查阅全部候选词条</span></div>
|
|
@@ -15928,21 +15923,22 @@ function helpCard(dailyLimit, allowRepeat, middleware) {
|
|
|
15928
15923
|
<div class="sec">
|
|
15929
15924
|
<div class="sec-t"><span>规 则 细 则</span></div>
|
|
15930
15925
|
<div class="panel"><div class="rows">
|
|
15931
|
-
<div class="row"><span class="k"
|
|
15932
|
-
<div class="row"><span class="k"
|
|
15933
|
-
<div class="row"><span class="k"
|
|
15934
|
-
<div class="row"><span class="k"
|
|
15935
|
-
<div class="row"><span class="k"
|
|
15926
|
+
<div class="row"><span class="k">•</span><span>每个频道每日可开始 <b>${dailyLimit}</b> 局,跨零点重置。</span></div>
|
|
15927
|
+
<div class="row"><span class="k">•</span><span>${allowRepeat ? "允许重复提交已经猜过的词条。" : "同一局内不能重复提交已猜过的词条。"}</span></div>
|
|
15928
|
+
<div class="row"><span class="k">•</span><span>${middleware ? "本频道裸猜已开启:只接受当前模式词库中的完整纯文本词条。" : "本频道裸猜已停用:续猜请用完整指令。"}</span></div>
|
|
15929
|
+
<div class="row"><span class="k">•</span><span>空指令与词库外名称不会开启新局或消耗额度。</span></div>
|
|
15930
|
+
<div class="row"><span class="k">•</span><span>词条与数据来自 Minecraft Wiki,版本号按发布先后比较。</span></div>
|
|
15936
15931
|
</div></div>
|
|
15937
15932
|
</div>
|
|
15938
15933
|
</div>` + noteRow("灵感来自 Wordle 与 mcdle.net");
|
|
15939
15934
|
return shell(body, { accent: accentOf(138), width: 760 });
|
|
15940
15935
|
}
|
|
15941
15936
|
__name(helpCard, "helpCard");
|
|
15937
|
+
var RANK_BADGE = ["m3-badge--gold", "m3-badge--silver", "m3-badge--bronze"];
|
|
15942
15938
|
function rankCard(entries, shown) {
|
|
15943
15939
|
if (!entries.length) {
|
|
15944
15940
|
const body2 = header(null, "排行榜", { big: "0", cap: "上榜人数" }) + `<div class="pad"><div class="empty">${px("trophy", 44)}
|
|
15945
|
-
排行榜还空着<br><span style="font-size
|
|
15941
|
+
排行榜还空着<br>第一个猜中的人,名字会写在这里。<br><span style="font-size:${TYPE.bodySmall.size}px">用 <span class="cmd">mcdle.猜 苦力怕</span> 开出第一局,成为榜首</span></div></div>`;
|
|
15946
15942
|
return shell(body2, { accent: accentOf(90), width: 560 });
|
|
15947
15943
|
}
|
|
15948
15944
|
const max = Math.max(...entries.map((e) => e.total), 1);
|
|
@@ -15950,18 +15946,18 @@ function rankCard(entries, shown) {
|
|
|
15950
15946
|
const pos = i + 1;
|
|
15951
15947
|
const split = ["mob", "item", "block"].map((m) => {
|
|
15952
15948
|
const n = m === "mob" ? e.mob : m === "item" ? e.item : e.block;
|
|
15953
|
-
return `<span class="sp" style="color:${n ? MODES[m].accent :
|
|
15949
|
+
return `<span class="sp" style="color:${n ? MODES[m].accent : "var(--md-sys-color-on-surface-variant)"}">${px(MODES[m].icon, 10)}<span>${n}</span></span>`;
|
|
15954
15950
|
}).join("");
|
|
15955
15951
|
const w = Math.round(e.total / max * 100);
|
|
15956
|
-
return `<div class="rk p${pos <= 3 ? pos : "n"}">
|
|
15957
|
-
<div class="pos">${pos === 1 ? px("crown", 15) : pos}</div>
|
|
15952
|
+
return `<div class="rk p${pos <= 3 ? pos : "n"} m3-list-item">
|
|
15953
|
+
<div class="pos m3-badge ${RANK_BADGE[pos - 1] || ""}">${pos === 1 ? px("crown", 15) : pos}</div>
|
|
15958
15954
|
<div class="who"><div class="nm">${esc(e.username || e.userId)}</div><div class="split">${split}</div>
|
|
15959
15955
|
<div class="prog" style="margin-top:8px"><div class="bar" style="height:6px"><div class="fill" style="width:${w}%"></div></div></div>
|
|
15960
15956
|
</div>
|
|
15961
15957
|
<div class="tot"><div class="n">${e.total}</div><div class="c">猜 中</div></div>
|
|
15962
15958
|
</div>`;
|
|
15963
15959
|
}).join("");
|
|
15964
|
-
const body = header(null, "累计战绩 · 按累计猜中排序", { big: `${shown}`, cap: "上榜人数" }) + `<div class="pad"><div class="rank">${rows}</div></div>` + noteRow("每猜中一局记一分,按模式分别计数");
|
|
15960
|
+
const body = header(null, "累计战绩 · 按累计猜中排序", { big: `${shown}`, cap: "上榜人数" }) + `<div class="pad"><div class="rank m3-list">${rows}</div></div>` + noteRow("每猜中一局记一分,按模式分别计数");
|
|
15965
15961
|
return shell(body, { accent: accentOf(90), width: 560 });
|
|
15966
15962
|
}
|
|
15967
15963
|
__name(rankCard, "rankCard");
|
|
@@ -15979,7 +15975,7 @@ var usage = `## 使用
|
|
|
15979
15975
|
| \`mcdle\` | 玩法与指令说明 |
|
|
15980
15976
|
| \`mcdle.猜 [名称]\` | 用有效词条开局或猜测 |
|
|
15981
15977
|
| \`mcdle.裸猜 [开/关]\` | 开关本频道的无前缀续猜 |
|
|
15982
|
-
| \`mcdle.排行榜\` |
|
|
15978
|
+
| \`mcdle.排行榜\` | 累计战绩 |
|
|
15983
15979
|
| \`mcdle.词库\` | 全部词条 |
|
|
15984
15980
|
|
|
15985
15981
|
## 提示
|
|
@@ -16181,6 +16177,12 @@ function apply(ctx, cfg) {
|
|
|
16181
16177
|
return cfg.addStatusTextAfterEmoji ? `(${label})` : "";
|
|
16182
16178
|
}
|
|
16183
16179
|
__name(statusTag, "statusTag");
|
|
16180
|
+
function guessList(titles) {
|
|
16181
|
+
const recent = titles.slice(-6);
|
|
16182
|
+
const rest = titles.length - recent.length;
|
|
16183
|
+
return recent.join(" › ") + (rest > 0 ? ` …… 另有 ${rest} 个未列` : "");
|
|
16184
|
+
}
|
|
16185
|
+
__name(guessList, "guessList");
|
|
16184
16186
|
function wikiImage(entry) {
|
|
16185
16187
|
if (cfg.disableImages || !entry?.wiki_image_url) return null;
|
|
16186
16188
|
return `${(0, import_koishi.h)("p", "")}${import_koishi.h.image(entry.wiki_image_url)}${(0, import_koishi.h)("p", "")}`;
|
|
@@ -16197,7 +16199,7 @@ function apply(ctx, cfg) {
|
|
|
16197
16199
|
return `${meta.emoji}${statusTag(meta.label)} ${fieldLabel(key)} ${value}`;
|
|
16198
16200
|
});
|
|
16199
16201
|
const locked = fields.filter((k) => statusOf(last, k) === "true").length;
|
|
16200
|
-
const history = titles.length > 1 ? `本局已猜:${titles
|
|
16202
|
+
const history = titles.length > 1 ? `本局已猜:${guessList(titles)}` : null;
|
|
16201
16203
|
return textCard(
|
|
16202
16204
|
`${modeName(mode)}模式 · 第 ${guesses.length} 次猜测`,
|
|
16203
16205
|
wikiImage(last),
|
|
@@ -16236,7 +16238,7 @@ function apply(ctx, cfg) {
|
|
|
16236
16238
|
`${o.username} 累计猜中 ${o.total} 次`
|
|
16237
16239
|
],
|
|
16238
16240
|
`答案档案:${profile}`,
|
|
16239
|
-
left > 0 ? `今日还剩 ${left} 局 · mcdle
|
|
16241
|
+
left > 0 ? `今日还剩 ${left} 局 · 发送「mcdle.排行榜」看战绩` : "今日额度已用完 · 发送「mcdle.排行榜」看战绩"
|
|
16240
16242
|
);
|
|
16241
16243
|
}
|
|
16242
16244
|
__name(winText, "winText");
|
|
@@ -16292,7 +16294,7 @@ function apply(ctx, cfg) {
|
|
|
16292
16294
|
const hint = on ? "仅在已有对局中,直接发送当前模式的完整词条名称才会响应" : "续猜请发送「mcdle.猜 [名称]」";
|
|
16293
16295
|
return [
|
|
16294
16296
|
`${mark} 裸猜续局 · 本频道临时${state}(插件配置:${config})`,
|
|
16295
|
-
`${hint}
|
|
16297
|
+
`${hint};再次发送「mcdle.裸猜」可复原`
|
|
16296
16298
|
].join("\n");
|
|
16297
16299
|
}
|
|
16298
16300
|
__name(middlewareSwitchText, "middlewareSwitchText");
|
|
@@ -16493,7 +16495,7 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16493
16495
|
textCard(
|
|
16494
16496
|
"💡 本频道没有进行中的对局",
|
|
16495
16497
|
"发送完整指令开局,例如「mcdle.猜 苦力怕」。",
|
|
16496
|
-
"
|
|
16498
|
+
"名称必须来自「mcdle.词库」。"
|
|
16497
16499
|
)
|
|
16498
16500
|
);
|
|
16499
16501
|
return;
|
|
@@ -16517,7 +16519,7 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16517
16519
|
textCard(
|
|
16518
16520
|
`⏳ 今日 ${cfg.dailyPlayLimit} 局已经用完`,
|
|
16519
16521
|
`跨零点后重置,还要等 ${untilReset(now)}。`,
|
|
16520
|
-
"
|
|
16522
|
+
"在那之前可以发送「mcdle.排行榜」或「mcdle.词库」看看。"
|
|
16521
16523
|
)
|
|
16522
16524
|
);
|
|
16523
16525
|
return;
|
|
@@ -16579,7 +16581,7 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16579
16581
|
if (state.guesses.length) {
|
|
16580
16582
|
await sendCard(
|
|
16581
16583
|
session,
|
|
16582
|
-
boardCard({ mode, guesses: state.guesses, tip: "轮到你了 · mcdle.猜 [名称]" }),
|
|
16584
|
+
boardCard({ mode, guesses: state.guesses, tip: "轮到你了 · 发送「mcdle.猜 [名称]」" }),
|
|
16583
16585
|
boardText(mode, state.guesses, state.titles)
|
|
16584
16586
|
);
|
|
16585
16587
|
} else {
|
|
@@ -16587,7 +16589,7 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16587
16589
|
session,
|
|
16588
16590
|
textCard(
|
|
16589
16591
|
`轮到你了 · ${modeName(mode)}模式`,
|
|
16590
|
-
`报一个${modeName(mode)}
|
|
16592
|
+
`报一个${modeName(mode)}的名字,比如发送「mcdle.猜 ${POOLS[mode][0].chinese_title}」。`,
|
|
16591
16593
|
`拿不准有哪些词条,发送「mcdle.词库」翻一翻。`
|
|
16592
16594
|
)
|
|
16593
16595
|
);
|
|
@@ -16599,7 +16601,7 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16599
16601
|
session,
|
|
16600
16602
|
textCard(
|
|
16601
16603
|
`⚠️ 「${guess}」这一局已经猜过了`,
|
|
16602
|
-
`本局已猜 ${state.titles.length} 个:${state.titles
|
|
16604
|
+
`本局已猜 ${state.titles.length} 个:${guessList(state.titles)}`,
|
|
16603
16605
|
"换一个还没试过的词条吧。"
|
|
16604
16606
|
)
|
|
16605
16607
|
);
|
|
@@ -16613,7 +16615,7 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16613
16615
|
textCard(
|
|
16614
16616
|
`⚠️ 「${guess}」不在${modeName(mode)}词库里`,
|
|
16615
16617
|
near.length ? `是不是想猜:${near.join("、")}?` : null,
|
|
16616
|
-
`本局共有 ${MODES[mode].total} 个${modeName(mode)}
|
|
16618
|
+
`本局共有 ${MODES[mode].total} 个${modeName(mode)}候选,发送「mcdle.词库」可以全部翻看。`
|
|
16617
16619
|
)
|
|
16618
16620
|
);
|
|
16619
16621
|
return;
|
|
@@ -16674,7 +16676,11 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16674
16676
|
);
|
|
16675
16677
|
return textCard(
|
|
16676
16678
|
"MCDLE · 我的世界猜谜",
|
|
16677
|
-
|
|
16679
|
+
[
|
|
16680
|
+
`从 ${total} 个词条里,只凭属性提示锁定唯一答案。`,
|
|
16681
|
+
"每局随机抽一个生物、物品或方块。",
|
|
16682
|
+
"首次猜测的词条属于哪一类,本局就在哪一类里出题。"
|
|
16683
|
+
],
|
|
16678
16684
|
legend,
|
|
16679
16685
|
[
|
|
16680
16686
|
"部分匹配的字段里,【】括起来的就是与答案重合的那几项。",
|
|
@@ -16693,9 +16699,9 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16693
16699
|
[
|
|
16694
16700
|
"mcdle 这份玩法与指令说明",
|
|
16695
16701
|
"mcdle.猜 [名称] 开始一局,或提交猜测",
|
|
16696
|
-
"mcdle.猜
|
|
16702
|
+
"mcdle.猜 局中再次发送可回看当前棋盘",
|
|
16697
16703
|
"mcdle.裸猜 [开/关] 临时切换本频道的无前缀续猜",
|
|
16698
|
-
"mcdle.排行榜
|
|
16704
|
+
"mcdle.排行榜 查看累计战绩",
|
|
16699
16705
|
"mcdle.词库 查阅全部候选词条"
|
|
16700
16706
|
],
|
|
16701
16707
|
[
|
|
@@ -16726,7 +16732,11 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16726
16732
|
await sendCard(
|
|
16727
16733
|
session,
|
|
16728
16734
|
rankCard([], 0),
|
|
16729
|
-
textCard(
|
|
16735
|
+
textCard(
|
|
16736
|
+
"📋 排行榜还空着",
|
|
16737
|
+
"第一个猜中的人,名字会写在这里。",
|
|
16738
|
+
"发送「mcdle.猜 苦力怕」开一局。"
|
|
16739
|
+
)
|
|
16730
16740
|
);
|
|
16731
16741
|
return;
|
|
16732
16742
|
}
|
package/package.json
CHANGED